00001 #ifndef __SEC_PMANAGER_HH__
00002 #define __SEC_PMANAGER_HH__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "XrdSec/XrdSecInterface.hh"
00034 #include "XrdSys/XrdSysPthread.hh"
00035
00036 class XrdNetAddrInfo;
00037 class XrdOucErrInfo;
00038 class XrdSecProtList;
00039 class XrdSecProtocol;
00040 class XrdSysError;
00041
00042 typedef int XrdSecPMask_t;
00043
00044 #define PROTPARMS const char, const char *, XrdNetAddrInfo &, \
00045 const char *, XrdOucErrInfo *
00046
00047 class XrdSecPManager
00048 {
00049 public:
00050
00051 XrdSecPMask_t Find(const char *pid,
00052 char **parg=0);
00053
00054 XrdSecProtocol *Get(const char *hname,
00055 XrdNetAddrInfo &endPoint,
00056 const char *pname,
00057 XrdOucErrInfo *erp);
00058
00059 XrdSecProtocol *Get(const char *hname,
00060 XrdNetAddrInfo &netaddr,
00061 XrdSecParameters &secparm)
00062 {return Get(hname, netaddr, secparm, (XrdOucErrInfo *)0);}
00063
00064 XrdSecProtocol *Get(const char *hname,
00065 XrdNetAddrInfo &netaddr,
00066 XrdSecParameters &secparm,
00067 XrdOucErrInfo *erp);
00068
00069 int Load(XrdOucErrInfo *eMsg,
00070 const char pmode,
00071 const char *pid,
00072 const char *parg,
00073 const char *path)
00074 {return (0 != ldPO(eMsg, pmode, pid, parg, path));}
00075
00076 void setDebug(int dbg) {DebugON = dbg;}
00077
00078 void setErrP(XrdSysError *eP) {errP = eP;}
00079
00080 const char *protTLS() {return tlsProt;}
00081
00082 XrdSecPManager(int dbg=0, bool secproxy=false,
00083 bool fwdcreds=false)
00084 : protnum(1), First(0), Last(0), errP(0),
00085 tlsProt(0), DebugON(dbg), isProxy(secproxy),
00086 fwdCreds(fwdcreds) {}
00087 ~XrdSecPManager() {}
00088
00089 private:
00090
00091 XrdSecProtList *Add(XrdOucErrInfo *eMsg, const char *pid,
00092 XrdSecProtocol *(*ep)(PROTPARMS), const char *parg);
00093 XrdSecProtList *ldPO(XrdOucErrInfo *eMsg,
00094 const char pmode,
00095 const char *pid,
00096 const char *parg=0,
00097 const char *spath=0);
00098 XrdSecProtList *Lookup(const char *pid);
00099
00100 XrdSecPMask_t protnum;
00101 XrdSysMutex myMutex;
00102 XrdSecProtList *First;
00103 XrdSecProtList *Last;
00104 XrdSysError *errP;
00105 char *tlsProt;
00106 int DebugON;
00107 bool isProxy;
00108 bool fwdCreds;
00109 };
00110 #endif