xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
XrdSecPManager.hh
Go to the documentation of this file.
1 #ifndef __SEC_PMANAGER_HH__
2 #define __SEC_PMANAGER_HH__
3 /******************************************************************************/
4 /* */
5 /* X r d S e c P M a n a g e r . h h */
6 /* */
7 /* (c) 2003 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 
34 #include "XrdSys/XrdSysPthread.hh"
35 
36 class XrdNetAddrInfo;
37 class XrdOucErrInfo;
38 class XrdSecProtList;
39 class XrdSecProtocol;
41 
42 typedef int XrdSecPMask_t;
43 
44 #define PROTPARMS const char, const char *, XrdNetAddrInfo &, \
45  const char *, XrdOucErrInfo *
46 
48 {
49 public:
50 
51 XrdSecPMask_t Find(const char *pid, // In
52  char **parg=0); // Out
53 
54 XrdSecProtocol *Get(const char *hname,
55  XrdNetAddrInfo &endPoint,
56  const char *pname,
57  XrdOucErrInfo *erp);
58 
59 XrdSecProtocol *Get(const char *hname,
60  XrdNetAddrInfo &netaddr,
61  XrdSecParameters &secparm)
62  {return Get(hname, netaddr, secparm, (XrdOucErrInfo *)0);}
63 
64 XrdSecProtocol *Get(const char *hname,
65  XrdNetAddrInfo &netaddr,
66  XrdSecParameters &secparm,
67  XrdOucErrInfo *erp);
68 
69 int Load(XrdOucErrInfo *eMsg, // In
70  const char pmode, // In 'c' | 's'
71  const char *pid, // In
72  const char *parg, // In
73  const char *path) // In
74  {return (0 != ldPO(eMsg, pmode, pid, parg, path));}
75 
76 void setDebug(int dbg) {DebugON = dbg;}
77 
78 void setErrP(XrdSysError *eP) {errP = eP;}
79 
80  XrdSecPManager(int dbg=0, bool secproxy=false,
81  bool fwdcreds=false)
82  : protnum(1), First(0), Last(0), errP(0),
83  DebugON(dbg), isProxy(secproxy),
84  fwdCreds(fwdcreds) {}
86 
87 private:
88 
89 XrdSecProtList *Add(XrdOucErrInfo *eMsg, const char *pid,
90  XrdSecProtocol *(*ep)(PROTPARMS), const char *parg);
91 XrdSecProtList *ldPO(XrdOucErrInfo *eMsg, // In
92  const char pmode, // In 'c' | 's'
93  const char *pid, // In
94  const char *parg=0, // In
95  const char *spath=0);// In
96 XrdSecProtList *Lookup(const char *pid);
97 
100 XrdSecProtList *First;
101 XrdSecProtList *Last;
104 bool isProxy;
105 bool fwdCreds;
106 };
107 #endif
void setDebug(int dbg)
Definition: XrdSecPManager.hh:76
XrdSecProtList * Lookup(const char *pid)
XrdSecProtList * ldPO(XrdOucErrInfo *eMsg, const char pmode, const char *pid, const char *parg=0, const char *spath=0)
Definition: XrdSecInterface.hh:130
XrdSecProtList * Add(XrdOucErrInfo *eMsg, const char *pid, XrdSecProtocol *(*ep)(PROTPARMS), const char *parg)
~XrdSecPManager()
Definition: XrdSecPManager.hh:85
int DebugON
Definition: XrdSecPManager.hh:103
XrdSecPMask_t Find(const char *pid, char **parg=0)
Definition: XrdSysError.hh:89
XrdSecPManager(int dbg=0, bool secproxy=false, bool fwdcreds=false)
Definition: XrdSecPManager.hh:80
Definition: XrdSysPthread.hh:165
Definition: XrdSecPManager.hh:47
void setErrP(XrdSysError *eP)
Definition: XrdSecPManager.hh:78
int Load(XrdOucErrInfo *eMsg, const char pmode, const char *pid, const char *parg, const char *path)
Definition: XrdSecPManager.hh:69
Definition: XrdOucErrInfo.hh:97
XrdSysMutex myMutex
Definition: XrdSecPManager.hh:99
XrdSecProtList * Last
Definition: XrdSecPManager.hh:101
int XrdSecPMask_t
Definition: XrdSecPManager.hh:40
XrdSecPMask_t protnum
Definition: XrdSecPManager.hh:98
Definition: XrdNetAddrInfo.hh:53
XrdSecProtocol * Get(const char *hname, XrdNetAddrInfo &netaddr, XrdSecParameters &secparm)
Definition: XrdSecPManager.hh:59
#define PROTPARMS
Definition: XrdSecPManager.hh:44
XrdSysError * errP
Definition: XrdSecPManager.hh:102
XrdSecProtList * First
Definition: XrdSecPManager.hh:100
bool isProxy
Definition: XrdSecPManager.hh:104
Generic structure to pass security information back and forth.
Definition: XrdSecInterface.hh:50
XrdSecProtocol * Get(const char *hname, XrdNetAddrInfo &endPoint, const char *pname, XrdOucErrInfo *erp)
bool fwdCreds
Definition: XrdSecPManager.hh:105