xrootd
Loading...
Searching...
No Matches
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
35class XrdOucEnv;
36
38{
39public:
40
41 bool addCGI(const char *prot, char *buff, int blen);
42
43 bool Extend(const char *cgi, int cgiln);
44
45const 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
57static void setMapID(bool onoff) {MapID = onoff;}
58
59const char *thePath() {return Path;}
60
61const 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
68private:
69
70static bool MapID;
71
72const char *tident;
73const char *Path;
74const char *CgiUsr;
75 int CgiUsz;
76 int CgiSsz;
78unsigned
81 char theID[13];
83 char CgiSfx[512];
84};
85#endif
Definition XrdOucEnv.hh:42
Definition XrdOucSid.hh:46
bool Obtain(theSid *sidP)
bool Release(theSid *sidP)
Definition XrdPssUrlInfo.hh:38
const char * Tident()
Definition XrdPssUrlInfo.hh:61
int CgiUsz
Definition XrdPssUrlInfo.hh:75
char theID[13]
Definition XrdPssUrlInfo.hh:81
int CgiSsz
Definition XrdPssUrlInfo.hh:76
void setID(XrdOucSid *sP)
Definition XrdPssUrlInfo.hh:51
XrdPssUrlInfo(XrdOucEnv *envP, const char *path, const char *xtra="", bool addusrcgi=true, bool addident=true)
const char * getID()
Definition XrdPssUrlInfo.hh:45
XrdOucSid * sidP
Definition XrdPssUrlInfo.hh:77
XrdOucSid::theSid idVal
Definition XrdPssUrlInfo.hh:82
static void setMapID(bool onoff)
Definition XrdPssUrlInfo.hh:57
bool Extend(const char *cgi, int cgiln)
bool eIDvalid
Definition XrdPssUrlInfo.hh:80
bool hasCGI()
Definition XrdPssUrlInfo.hh:47
static bool MapID
Definition XrdPssUrlInfo.hh:70
const char * CgiUsr
Definition XrdPssUrlInfo.hh:74
~XrdPssUrlInfo()
Definition XrdPssUrlInfo.hh:66
void setID(const char *tid=0)
const char * Path
Definition XrdPssUrlInfo.hh:73
unsigned int entityID
Definition XrdPssUrlInfo.hh:79
const char * thePath()
Definition XrdPssUrlInfo.hh:59
char CgiSfx[512]
Definition XrdPssUrlInfo.hh:83
const char * tident
Definition XrdPssUrlInfo.hh:72
bool addCGI(const char *prot, char *buff, int blen)
The type to pass to Obtain(). Simply cast the char[2] to (theSid *).
Definition XrdOucSid.hh:53
short sidS
Definition XrdOucSid.hh:53