xrootd
XrdCmsAdmin.hh
Go to the documentation of this file.
1 #ifndef __CMSADMIN__
2 #define __CMSADMIN__
3 /******************************************************************************/
4 /* */
5 /* X r d C m s A d m i n . h h */
6 /* */
7 /* (c) 2007 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /* */
12 /* This file is part of the XRootD software suite. */
13 /* */
14 /* XRootD is free software: you can redistribute it and/or modify it under */
15 /* the terms of the GNU Lesser General Public License as published by the */
16 /* Free Software Foundation, either version 3 of the License, or (at your */
17 /* option) any later version. */
18 /* */
19 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22 /* License for more details. */
23 /* */
24 /* You should have received a copy of the GNU Lesser General Public License */
25 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27 /* */
28 /* The copyright holder's institutional names and contributor's names may not */
29 /* be used to endorse or promote products derived from this software without */
30 /* specific prior written permission of the institution or contributor. */
31 /******************************************************************************/
32 
33 #include <stdlib.h>
34 #include <sys/uio.h>
35 
36 #include "XrdCms/XrdCmsProtocol.hh"
37 #include "XrdCms/XrdCmsRRData.hh"
38 #include "XrdOss/XrdOssStatInfo.hh"
39 #include "XrdOuc/XrdOucStream.hh"
40 #include "XrdSys/XrdSysPthread.hh"
41 
42 class XrdNetSocket;
43 class XrdOucTList;
44 
46 {
47 public:
48 
49 static bool InitAREvents(void *arFunc);
50 
51  void Login(int socknum);
52 
53  void MonAds();
54 
55 static void setSync(XrdSysSemaphore *sync) {SyncUp = sync;}
56 
57  void *Notes(XrdNetSocket *AdminSock);
58 
59 static void Relay(int setSock, int newSock);
60 
61 static void RelayAREvent();
62 
63  void Send(const char *Req, XrdCmsRRData &Data);
64 
65  void *Start(XrdNetSocket *AdminSock);
66 
67  XrdCmsAdmin() {Sname = 0; Stype = "Server"; Primary = 0;}
68  ~XrdCmsAdmin() {if (Sname) free(Sname);}
69 
70 private:
71 
72 static
73 void AddEvent(const char *path, XrdCms::CmsReqCode req, int mods);
74 void BegAds();
75 bool CheckVNid(const char *xNid);
76 int Con2Ads(const char *pname);
77 int do_Login();
78 void do_RmDid(int dotrim=0);
79 void do_RmDud(int dotrim=0);
80 
86 static bool arePost;
87 
90 static int POnline;
92  const char *Stype;
93  char *Sname;
94  int Primary;
95 };
96 #endif
XrdCmsAdmin::Con2Ads
int Con2Ads(const char *pname)
XrdCmsAdmin::setSync
static void setSync(XrdSysSemaphore *sync)
Definition: XrdCmsAdmin.hh:55
XrdSysMutex
Definition: XrdSysPthread.hh:165
XrdCmsAdmin::areMutex
static XrdSysMutex areMutex
Definition: XrdCmsAdmin.hh:84
XrdCmsAdmin::Relay
static void Relay(int setSock, int newSock)
XrdSysPthread.hh
XrdCmsAdmin::myMutex
static XrdSysMutex myMutex
Definition: XrdCmsAdmin.hh:88
XrdCms::CmsReqCode
CmsReqCode
Definition: YProtocol.hh:89
XrdCmsAdmin::arePost
static bool arePost
Definition: XrdCmsAdmin.hh:86
XrdCmsRRData
Definition: XrdCmsRRData.hh:51
XrdCmsAdmin::MonAds
void MonAds()
XrdCmsAdmin::Primary
int Primary
Definition: XrdCmsAdmin.hh:94
XrdCmsAdmin::AddEvent
static void AddEvent(const char *path, XrdCms::CmsReqCode req, int mods)
XrdCmsAdmin::do_Login
int do_Login()
XrdOucStream
Definition: XrdOucStream.hh:45
XrdOssStatInfo2_t
int(* XrdOssStatInfo2_t)(const char *path, struct stat *buff, int opts, XrdOucEnv *envP, const char *lfn)
Definition: XrdOssStatInfo.hh:66
XrdCmsAdmin
Definition: XrdCmsAdmin.hh:45
XrdCmsAdmin::Stype
const char * Stype
Definition: XrdCmsAdmin.hh:92
XrdCmsAdmin::~XrdCmsAdmin
~XrdCmsAdmin()
Definition: XrdCmsAdmin.hh:68
XrdCmsAdmin::POnline
static int POnline
Definition: XrdCmsAdmin.hh:90
XrdCmsAdmin::areFunc
static XrdOssStatInfo2_t areFunc
Definition: XrdCmsAdmin.hh:81
XrdCmsAdmin::Start
void * Start(XrdNetSocket *AdminSock)
XrdCmsAdmin::SyncUp
static XrdSysSemaphore * SyncUp
Definition: XrdCmsAdmin.hh:89
XrdSysSemaphore
Definition: XrdSysPthread.hh:403
XrdOssStatInfo.hh
XrdCmsAdmin::Stream
XrdOucStream Stream
Definition: XrdCmsAdmin.hh:91
XrdCmsAdmin::BegAds
void BegAds()
XrdCmsAdmin::areSem
static XrdSysSemaphore areSem
Definition: XrdCmsAdmin.hh:85
XrdCmsAdmin::RelayAREvent
static void RelayAREvent()
XrdCmsProtocol.hh
XrdCmsAdmin::CheckVNid
bool CheckVNid(const char *xNid)
XrdCmsAdmin::Notes
void * Notes(XrdNetSocket *AdminSock)
XrdNetSocket
Definition: XrdNetSocket.hh:47
XrdCmsAdmin::Send
void Send(const char *Req, XrdCmsRRData &Data)
XrdCmsAdmin::do_RmDud
void do_RmDud(int dotrim=0)
XrdCmsRRData.hh
XrdCmsAdmin::InitAREvents
static bool InitAREvents(void *arFunc)
XrdCmsAdmin::do_RmDid
void do_RmDid(int dotrim=0)
XrdCmsAdmin::Login
void Login(int socknum)
XrdCmsAdmin::XrdCmsAdmin
XrdCmsAdmin()
Definition: XrdCmsAdmin.hh:67
XrdCmsAdmin::areFirst
static XrdOucTList * areFirst
Definition: XrdCmsAdmin.hh:82
XrdCmsAdmin::Sname
char * Sname
Definition: XrdCmsAdmin.hh:93
XrdOucStream.hh
XrdCmsAdmin::areLast
static XrdOucTList * areLast
Definition: XrdCmsAdmin.hh:83
XrdOucTList
Definition: XrdOucTList.hh:41