xrootd
Loading...
Searching...
No Matches
XrdOucMsubs.hh
Go to the documentation of this file.
1#ifndef __XRDOUCMSUBS_H__
2#define __XRDOUCMSUBS_H__
3/******************************************************************************/
4/* */
5/* X r d O u c M S u b s . h h */
6/* */
7/* (c) 2006 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
35#include "XrdSys/XrdSysError.hh"
36#include "XrdOuc/XrdOucEnv.hh"
38
39/******************************************************************************/
40/* P r e d e f i n e d E n v i r o n m e n t V a r i a b l e s */
41/******************************************************************************/
42
43#define CMS_CID "cms&cid"
44#define SEC_USER "sec&user"
45#define SEC_HOST "sec&host"
46#define SEC_POLICY "sec&policy"
47#define XRD_INS "xrd&ins"
48
49/******************************************************************************/
50/* X r d O u c M s u b s */
51/******************************************************************************/
52
54{
55const char *Tid; // $TID or $RID unless Rid is defined.
58const char *lfn; // $LFN
59const char *lfn2; // $LFN2 or $NOTIFY or $SRC
60const char *pfn; // $PFN
61const char *pfn2; // $PFN2 or $DST
62const char *misc; // $OPTS or $MDP
63const char *Rid; // $RID for real
64char *pfnbuff;
65char *rfnbuff;
68mode_t Mode; // $FMODE or $PRTY
69int Oflag; // $OFLAG
70char mbuff[12];
71char obuff[4];
72
73 XrdOucMsubsInfo(const char *tid, XrdOucEnv *envP,
74 XrdOucName2Name *n2np,
75 const char *lfnP, const char *lfn2P,
76 mode_t mode=0, int ofl=0,
77 const char *Opts=0, const char *ridP=0,
78 const char *pfnP=0, const char *pfn2P=0)
79 : Tid(tid), Env(envP), N2N(n2np),
80 lfn(lfnP), lfn2(lfn2P), pfn(pfnP), pfn2(pfn2P),
81 misc(Opts), Rid(ridP), Mode(mode), Oflag(ofl)
82 {pfnbuff = rfnbuff = pfn2buff = rfn2buff = 0;}
84 if (rfnbuff ) free(rfnbuff);
85 if (pfn2buff) free(pfn2buff);
86 if (rfn2buff) free(rfn2buff);
87 }
88};
89
91{
92public:
93
94static const int maxElem = 32;
95
96int Parse(const char *oname, char *msg);
97
98int Subs(XrdOucMsubsInfo &Info, char **Data, int *Dlen);
99
102
103private:
104char *getVal(XrdOucMsubsInfo &Info, int vNum);
105
106enum vNum {vLFN = 1, vPFN = 2, vRFN = 3, vLFN2 = 4, vPFN2 = 5, vRFN2 = 6,
107 vFM = 7, vOFL = 8, vUSR = 9, vHST = 10, vTID = 11,
108 vNFY = 12, vOPT = 13, vPTY = 14, vRID = 15, vCGI = 16,
109 vMDP = 17, vSRC = 18, vDST = 19, vCID = 20, vINS = 21};
110
111static const int vMax = 22;
112static const char *vName[vMax];
113
115char *mText;
116char *mData[maxElem+1];
119};
120#endif
Definition XrdOucEnv.hh:42
Definition XrdOucMsubs.hh:91
char * mText
Definition XrdOucMsubs.hh:115
static const int vMax
Definition XrdOucMsubs.hh:111
int Parse(const char *oname, char *msg)
vNum
Definition XrdOucMsubs.hh:106
@ vLFN2
Definition XrdOucMsubs.hh:106
@ vINS
Definition XrdOucMsubs.hh:109
@ vOPT
Definition XrdOucMsubs.hh:108
@ vSRC
Definition XrdOucMsubs.hh:109
@ vPFN
Definition XrdOucMsubs.hh:106
@ vRFN2
Definition XrdOucMsubs.hh:106
@ vPTY
Definition XrdOucMsubs.hh:108
@ vHST
Definition XrdOucMsubs.hh:107
@ vOFL
Definition XrdOucMsubs.hh:107
@ vLFN
Definition XrdOucMsubs.hh:106
@ vTID
Definition XrdOucMsubs.hh:107
@ vFM
Definition XrdOucMsubs.hh:107
@ vPFN2
Definition XrdOucMsubs.hh:106
@ vNFY
Definition XrdOucMsubs.hh:108
@ vCGI
Definition XrdOucMsubs.hh:108
@ vDST
Definition XrdOucMsubs.hh:109
@ vRFN
Definition XrdOucMsubs.hh:106
@ vRID
Definition XrdOucMsubs.hh:108
@ vMDP
Definition XrdOucMsubs.hh:109
@ vUSR
Definition XrdOucMsubs.hh:107
@ vCID
Definition XrdOucMsubs.hh:109
int Subs(XrdOucMsubsInfo &Info, char **Data, int *Dlen)
int mDlen[maxElem+1]
Definition XrdOucMsubs.hh:117
char * getVal(XrdOucMsubsInfo &Info, int vNum)
XrdOucMsubs(XrdSysError *errp)
static const int maxElem
Definition XrdOucMsubs.hh:94
XrdSysError * eDest
Definition XrdOucMsubs.hh:114
char * mData[maxElem+1]
Definition XrdOucMsubs.hh:116
int numElem
Definition XrdOucMsubs.hh:118
static const char * vName[vMax]
Definition XrdOucMsubs.hh:112
Definition XrdOucName2Name.hh:49
Definition XrdSysError.hh:90
Definition XrdOucMsubs.hh:54
char * rfnbuff
Definition XrdOucMsubs.hh:65
int Oflag
Definition XrdOucMsubs.hh:69
XrdOucName2Name * N2N
Definition XrdOucMsubs.hh:57
~XrdOucMsubsInfo()
Definition XrdOucMsubs.hh:83
const char * lfn
Definition XrdOucMsubs.hh:58
const char * pfn
Definition XrdOucMsubs.hh:60
char obuff[4]
Definition XrdOucMsubs.hh:71
const char * Rid
Definition XrdOucMsubs.hh:63
mode_t Mode
Definition XrdOucMsubs.hh:68
char * pfn2buff
Definition XrdOucMsubs.hh:66
const char * misc
Definition XrdOucMsubs.hh:62
const char * lfn2
Definition XrdOucMsubs.hh:59
const char * pfn2
Definition XrdOucMsubs.hh:61
const char * Tid
Definition XrdOucMsubs.hh:55
char mbuff[12]
Definition XrdOucMsubs.hh:70
XrdOucEnv * Env
Definition XrdOucMsubs.hh:56
XrdOucMsubsInfo(const char *tid, XrdOucEnv *envP, XrdOucName2Name *n2np, const char *lfnP, const char *lfn2P, mode_t mode=0, int ofl=0, const char *Opts=0, const char *ridP=0, const char *pfnP=0, const char *pfn2P=0)
Definition XrdOucMsubs.hh:73
char * pfnbuff
Definition XrdOucMsubs.hh:64
char * rfn2buff
Definition XrdOucMsubs.hh:67