XRootD
Loading...
Searching...
No Matches
XrdOucN2NLoader Class Reference

#include <XrdOucN2NLoader.hh>

+ Collaboration diagram for XrdOucN2NLoader:

Public Member Functions

 XrdOucN2NLoader (XrdOucgetName2NameArgs)
 
 ~XrdOucN2NLoader ()
 
XrdOucName2NameLoad (const char *libName, XrdVersionInfo &urVer, XrdOucEnv *envP=0)
 

Detailed Description

Definition at line 38 of file XrdOucN2NLoader.hh.

Constructor & Destructor Documentation

◆ XrdOucN2NLoader()

XrdOucN2NLoader::XrdOucN2NLoader ( XrdOucgetName2NameArgs )
inline

Definition at line 45 of file XrdOucN2NLoader.hh.

46 : eRoute(eDest), cFN(confg),
47 libParms((parms ? parms : "")),
48 lclRoot(lroot), rmtRoot(rroot) {}
static XrdSysError eDest(0,"crypto_")

References eDest, and XrdOucgetName2NameArgs.

◆ ~XrdOucN2NLoader()

XrdOucN2NLoader::~XrdOucN2NLoader ( )
inline

Definition at line 49 of file XrdOucN2NLoader.hh.

49{}

Member Function Documentation

◆ Load()

XrdOucName2Name * XrdOucN2NLoader::Load ( const char * libName,
XrdVersionInfo & urVer,
XrdOucEnv * envP = 0 )

Definition at line 47 of file XrdOucN2NLoader.cc.

50{
51 extern XrdOucName2NameVec *XrdOucN2NVec_P;
52 XrdOucName2Name *(*ep)(XrdOucgetName2NameArgs);
53 static XrdVERSIONINFODEF (myVer, XrdN2N, XrdVNUMBER, XrdVERSION);
54 XrdOucName2Name *n2nP;
55 XrdOucName2NameVec *n2nV;
56
57// Use the default mapping if there is no library. Verify version numbers
58// as we are normally in a different shared library.
59//
60 if (!libName)
61 {if (!XrdSysPlugin::VerCmp(urVer, myVer)) return 0;
62 if (lclRoot)
63 {struct stat Stat;
64 if (stat(lclRoot, &Stat))
65 {eRoute->Emsg("N2N", errno, "use localroot", lclRoot);
66 return 0;
67 }
68 if (!S_ISDIR(Stat.st_mode))
69 {eRoute->Emsg("N2N", ENOTDIR, "use localroot", lclRoot);
70 return 0;
71 }
72 XrdOucEnv::Export("XRDLCLROOT", lclRoot);
73 }
74 if (rmtRoot) XrdOucEnv::Export("XRDRMTROOT", rmtRoot);
75 n2nP = XrdOucgetName2Name(eRoute, cFN, libParms, lclRoot, rmtRoot);
76 if (XrdOucN2NVec_P && envP)
77 envP->PutPtr("XrdOucName2NameVec*", XrdOucN2NVec_P);
78 return n2nP;
79 } else {
80 XrdOucEnv::Export("XRDN2NLIB", libName);
81 if (libParms) XrdOucEnv::Export("XRDN2NPARMS", libParms);
82 }
83
84// Get the entry point of the object creator
85//
86 XrdOucPinLoader myLib(eRoute, &urVer, "namelib", libName);
87 ep = (XrdOucName2Name *(*)(XrdOucgetName2NameArgs))(myLib.Resolve("XrdOucgetName2Name"));
88 if (!ep) return 0;
89
90// Get the Object now
91//
92 if ((n2nP = ep(eRoute, cFN, libParms, lclRoot, rmtRoot)) && envP)
93 {n2nV = (XrdOucName2NameVec *)myLib.Resolve("?Name2NameVec");
94 if (n2nV) envP->PutPtr("XrdOucName2NameVec*", n2nV);
95 }
96 return n2nP;
97}
struct stat Stat
Definition XrdCks.cc:49
static XrdVERSIONINFODEF(compiledVer, XrdHttpProtocolTest, XrdVNUMBER, XrdVERSION)
XrdOucName2Name * XrdOucgetName2Name(XrdOucgetName2NameArgs)
XrdOucName2NameVec * XrdOucN2NVec_P
#define XrdOucgetName2NameArgs
#define stat(a, b)
Definition XrdPosix.hh:101
static int Export(const char *Var, const char *Val)
Definition XrdOucEnv.cc:170
void PutPtr(const char *varname, void *value)
Definition XrdOucEnv.cc:298
static bool VerCmp(XrdVersionInfo &vInf1, XrdVersionInfo &vInf2, bool noMsg=false)
XrdOucEnv * envP
Definition XrdPss.cc:109

References XrdOucEnv::Export(), XrdOucEnv::PutPtr(), XrdOucPinLoader::Resolve(), Stat, stat, XrdSysPlugin::VerCmp(), XrdOucgetName2Name(), XrdOucgetName2NameArgs, XrdOucN2NVec_P, and XrdVERSIONINFODEF().

Referenced by XrdOssSys::ConfigN2N(), and XrdCephOss::Configure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: