xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XrdPssUrlInfo.hh
Go to the documentation of this file.
1 #ifndef _XRDPSS_URLINFO_H
2 #define _XRDPSS_URLINFO_H
3 /******************************************************************************/
4 /* */
5 /* X r d P s s U r l I n f o . h h */
6 /* */
7 /* (c) 2018 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 <cstdio>
34 
35 class XrdOucEnv;
36 
38 {
39 public:
40 
41  bool addCGI(const char *prot, char *buff, int blen);
42 
43  bool Extend(const char *cgi, int cgiln);
44 
45 const char *getID() {return theID;}
46 
47  bool hasCGI() {return CgiSsz || CgiUsz;}
48 
49  void setID(const char *tid=0);
50 
51  void setID(XrdOucSid *sP)
52  {if (sP != 0 && !(sP->Obtain(&idVal))) return;
53  sidP = sP;
54  snprintf(theID, sizeof(theID), "p%d@", idVal.sidS);
55  }
56 
57 static void setMapID(bool onoff) {MapID = onoff;}
58 
59 const char *thePath() {return Path;}
60 
61 const char *Tident() {return tident;}
62 
63  XrdPssUrlInfo(XrdOucEnv *envP, const char *path, const char *xtra="",
64  bool addusrcgi=true, bool addident=true);
65 
66  ~XrdPssUrlInfo() {if (*theID == 'p' && sidP) sidP->Release(&idVal);}
67 
68 private:
69 
70 static bool MapID;
71 
72 const char *tident;
73 const char *Path;
74 const char *CgiUsr;
75  int CgiUsz;
76  int CgiSsz;
78 unsigned
79  int entityID;
80  bool eIDvalid;
81  char theID[13];
83  char CgiSfx[512];
84 };
85 #endif
int CgiSsz
Definition: XrdPssUrlInfo.hh:76
const char * CgiUsr
Definition: XrdPssUrlInfo.hh:74
const char * tident
Definition: XrdPssUrlInfo.hh:72
static void setMapID(bool onoff)
Definition: XrdPssUrlInfo.hh:57
The type to pass to Obtain(). Simply cast the char[2] to (theSid *).
Definition: XrdOucSid.hh:53
const char * Tident()
Definition: XrdPssUrlInfo.hh:61
bool Extend(const char *cgi, int cgiln)
XrdOucSid::theSid idVal
Definition: XrdPssUrlInfo.hh:82
bool hasCGI()
Definition: XrdPssUrlInfo.hh:47
bool addCGI(const char *prot, char *buff, int blen)
Definition: XrdPssUrlInfo.hh:37
XrdPssUrlInfo(XrdOucEnv *envP, const char *path, const char *xtra="", bool addusrcgi=true, bool addident=true)
const char * thePath()
Definition: XrdPssUrlInfo.hh:59
unsigned int entityID
Definition: XrdPssUrlInfo.hh:79
void setID(const char *tid=0)
XrdOucSid * sidP
Definition: XrdPssUrlInfo.hh:77
Definition: XrdOucSid.hh:45
Definition: XrdOucEnv.hh:41
char theID[13]
Definition: XrdPssUrlInfo.hh:81
bool Obtain(theSid *sidP)
short sidS
Definition: XrdOucSid.hh:53
static bool MapID
Definition: XrdPssUrlInfo.hh:70
bool eIDvalid
Definition: XrdPssUrlInfo.hh:80
const char * getID()
Definition: XrdPssUrlInfo.hh:45
void setID(XrdOucSid *sP)
Definition: XrdPssUrlInfo.hh:51
const char * Path
Definition: XrdPssUrlInfo.hh:73
char CgiSfx[512]
Definition: XrdPssUrlInfo.hh:83
~XrdPssUrlInfo()
Definition: XrdPssUrlInfo.hh:66
int CgiUsz
Definition: XrdPssUrlInfo.hh:75
bool Release(theSid *sidP)