xrootd
|
00001 #ifndef __XRDOUCREQID__ 00002 #define __XRDOUCREQID__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d O u c R e q I D . h h */ 00006 /* */ 00007 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC03-76-SFO0515 with the Department of Energy */ 00011 /******************************************************************************/ 00012 00013 // $Id$ 00014 00015 #include <stdlib.h> 00016 #ifndef WIN32 00017 #include <strings.h> 00018 #endif 00019 00020 #include "XrdSys/XrdSysPthread.hh" 00021 00022 class XrdOucReqID 00023 { 00024 public: 00025 00026 static char *ID(char *buff, int blen); // blen >= 48 00027 00028 static int isMine(char *reqid) 00029 {return !strncmp((const char *)reqPFX,(const char *)reqid,reqPFXlen);} 00030 00031 static int isMine(char *reqid, int &hport, char *hname, int hlen); 00032 00033 static char *PFX() {return reqPFX;} 00034 00035 static int Index(int KeyMax, const char *KeyVal, int KeyLen=0); 00036 00037 XrdOucReqID(int instance, const char *myhost, unsigned int myaddr); 00038 ~XrdOucReqID() {} // Statics go away at exit 00039 00040 private: 00041 00042 static XrdSysMutex myMutex; 00043 static int reqPFXlen; 00044 static char *reqPFX; 00045 static char *reqFMT; 00046 static int reqNum; 00047 }; 00048 #endif