xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 <cstdlib>
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_Perf(bool alert=false);
79 void do_RmDid(int dotrim=0);
80 void do_RmDud(int dotrim=0);
81 
87 static bool arePost;
88 
91 static int POnline;
93  const char *Stype;
94  char *Sname;
95  int Primary;
96 };
97 #endif
int Con2Ads(const char *pname)
static XrdOucTList * areFirst
Definition: XrdCmsAdmin.hh:83
static bool arePost
Definition: XrdCmsAdmin.hh:87
void MonAds()
static XrdSysMutex myMutex
Definition: XrdCmsAdmin.hh:89
CmsReqCode
Definition: YProtocol.hh:89
static void AddEvent(const char *path, XrdCms::CmsReqCode req, int mods)
Definition: XrdOucStream.hh:46
static void setSync(XrdSysSemaphore *sync)
Definition: XrdCmsAdmin.hh:55
static XrdSysMutex areMutex
Definition: XrdCmsAdmin.hh:85
static int POnline
Definition: XrdCmsAdmin.hh:91
static XrdOssStatInfo2_t areFunc
Definition: XrdCmsAdmin.hh:82
Definition: XrdNetSocket.hh:47
Definition: XrdSysPthread.hh:164
int Primary
Definition: XrdCmsAdmin.hh:95
static void RelayAREvent()
int do_Login()
void * Notes(XrdNetSocket *AdminSock)
void * Start(XrdNetSocket *AdminSock)
void do_Perf(bool alert=false)
const char * Stype
Definition: XrdCmsAdmin.hh:93
Definition: XrdCmsRRData.hh:51
static XrdSysSemaphore * SyncUp
Definition: XrdCmsAdmin.hh:90
~XrdCmsAdmin()
Definition: XrdCmsAdmin.hh:68
Definition: XrdSysPthread.hh:493
XrdOucStream Stream
Definition: XrdCmsAdmin.hh:92
void Send(const char *Req, XrdCmsRRData &Data)
Definition: XrdOucTList.hh:41
void do_RmDud(int dotrim=0)
Definition: XrdCmsAdmin.hh:45
bool CheckVNid(const char *xNid)
int(* XrdOssStatInfo2_t)(const char *path, struct stat *buff, int opts, XrdOucEnv *envP, const char *lfn)
Definition: XrdOssStatInfo.hh:66
void BegAds()
static XrdSysSemaphore areSem
Definition: XrdCmsAdmin.hh:86
static XrdOucTList * areLast
Definition: XrdCmsAdmin.hh:84
void Login(int socknum)
XrdCmsAdmin()
Definition: XrdCmsAdmin.hh:67
static bool InitAREvents(void *arFunc)
void do_RmDid(int dotrim=0)
char * Sname
Definition: XrdCmsAdmin.hh:94
static void Relay(int setSock, int newSock)