xrootd
XrdOucReqID.hh
Go to the documentation of this file.
1 #ifndef __XRDOUCREQID__
2 #define __XRDOUCREQID__
3 /******************************************************************************/
4 /* */
5 /* X r d O u c R e q I D . h h */
6 /* */
7 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC03-76-SFO0515 with the Department of Energy */
11 /******************************************************************************/
12 
13 // $Id$
14 
15 #include <stdlib.h>
16 #ifndef WIN32
17 #include <strings.h>
18 #endif
19 
20 #include "XrdSys/XrdSysPthread.hh"
21 
23 {
24 public:
25 
26 static char *ID(char *buff, int blen); // blen >= 48
27 
28 static int isMine(char *reqid)
29  {return !strncmp((const char *)reqPFX,(const char *)reqid,reqPFXlen);}
30 
31 static int isMine(char *reqid, int &hport, char *hname, int hlen);
32 
33 static char *PFX() {return reqPFX;}
34 
35 static int Index(int KeyMax, const char *KeyVal, int KeyLen=0);
36 
37  XrdOucReqID(int instance, const char *myhost, unsigned int myaddr);
38  ~XrdOucReqID() {} // Statics go away at exit
39 
40 private:
41 
43 static int reqPFXlen;
44 static char *reqPFX;
45 static char *reqFMT;
46 static int reqNum;
47 };
48 #endif