#include <XrdProtLoad.hh>
|
static int | Load (const char *lname, const char *pname, char *parms, XrdProtocol_Config *pi, bool istls) |
|
static int | Port (const char *lname, const char *pname, char *parms, XrdProtocol_Config *pi) |
|
static void | Port (int protIdx, int port, bool isTLS) |
|
static int | Statistics (char *buff, int blen, int do_sync=0) |
|
Definition at line 36 of file XrdProtLoad.hh.
◆ XrdProtLoad()
XrdProtLoad::XrdProtLoad |
( |
int |
port = -1 | ) |
|
Definition at line 80 of file XrdProtLoad.cc.
88 for (
int i = 0; i < (int)portVec.size(); i++)
89 {
if (myPort == portVec[i].port)
90 {
if (portVec[i].protTLS) hastls =
true;
91 else myProt[j++] = portVec[i].protIdx;
99 for (
int i = 0; i < (int)portVec.size(); i++)
100 {
if (myPort == portVec[i].port && portVec[i].protTLS)
101 myProt[j++] = portVec[i].protIdx;
XrdProtocol(const char *jname)
◆ ~XrdProtLoad()
XrdProtLoad::~XrdProtLoad |
( |
| ) |
|
◆ DoIt()
void XrdProtLoad::DoIt |
( |
| ) |
|
|
inlinevirtual |
◆ Load()
int XrdProtLoad::Load |
( |
const char * |
lname, |
|
|
const char * |
pname, |
|
|
char * |
parms, |
|
|
XrdProtocol_Config * |
pi, |
|
|
bool |
istls |
|
) |
| |
|
static |
Definition at line 116 of file XrdProtLoad.cc.
124 TRACE(
DEBUG,
"getting protocol object " <<pname);
129 {
Log.
Emsg(
"Protocol",
"Too many protocols have been defined.");
135 xp = getProtocol(lname, pname, parms, pi);
136 if (!xp) {
Log.
Emsg(
"Protocol",
"Protocol", pname,
"could not be loaded");
142 ProtName[ProtoCnt] = strdup(pname);
143 Protocol[ProtoCnt] = xp;
148 Port(ProtoCnt, port, istls);
static int Port(const char *lname, const char *pname, char *parms, XrdProtocol_Config *pi)
static const int ProtoMax
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
References DEBUG, XrdSysError::Emsg(), XrdGlobal::Log, Port(), XrdProtocol_Config::Port, ProtoMax, and TRACE.
◆ Match()
◆ Port() [1/2]
int XrdProtLoad::Port |
( |
const char * |
lname, |
|
|
const char * |
pname, |
|
|
char * |
parms, |
|
|
XrdProtocol_Config * |
pi |
|
) |
| |
|
static |
Definition at line 156 of file XrdProtLoad.cc.
163 port = getProtocolPort(lname, pname, parms, pi);
167 TRACE(
DEBUG,
"protocol " <<pname <<
" wants to use port " <<port);
171 if (port < 0)
Log.
Emsg(
"Protocol",
"Protocol", pname,
172 "port number could not be determined");
References DEBUG, XrdSysError::Emsg(), XrdGlobal::Log, and TRACE.
Referenced by Load().
◆ Port() [2/2]
void XrdProtLoad::Port |
( |
int |
protIdx, |
|
|
int |
port, |
|
|
bool |
isTLS |
|
) |
| |
|
static |
Definition at line 178 of file XrdProtLoad.cc.
180 if (protIdx > 0 && protIdx <= ProtoCnt && port > 0)
181 {portMap pMap(port, protIdx-1, isTLS);
182 portVec.push_back(pMap);
183 TRACE(
DEBUG,
"enabling " <<(isTLS ?
"tls port " :
"port ") <<port
184 <<
" for protocol " <<ProtName[protIdx-1]);
187 snprintf(buff,
sizeof(buff),
"prot=%d port=%d;", protIdx, port);
188 Log.
Emsg(
"Protocol",
"Invalid Port() parms:", buff,
"port not mapped!");
References DEBUG, XrdSysError::Emsg(), XrdGlobal::Log, and TRACE.
◆ Process()
int XrdProtLoad::Process |
( |
XrdLink * |
lp | ) |
|
|
virtual |
Implements XrdProtocol.
Definition at line 196 of file XrdProtLoad.cc.
199 signed char *pVec = myProt;
207 {lp->
setEtext(
"TLS negotiation failed.");
211 if ((pp = Protocol[i]->
Match(lp)))
break;
219 if (!pp) {lp->
setEtext(
"matching protocol not found");
return -1;}
228 TRACE(
DEBUG,
"matched port " <<myPort <<
" protocol " <<ProtName[i]);
XrdProtocol * setProtocol(XrdProtocol *pp, bool runit=false, bool push=false)
int setEtext(const char *text)
bool setTLS(bool enable, XrdTlsContext *ctx=0)
Enable or disable TLS on the link.
void setProtName(const char *name)
XrdProtocol * Match(XrdLink *)
virtual int Process(XrdLink *lp)=0
References XrdLink::Activate(), DEBUG, XrdLink::isFlawed(), Match(), XrdProtocol::Process(), XrdLink::setEtext(), XrdLink::setProtName(), XrdLink::setProtocol(), XrdLink::setTLS(), and TRACE.
◆ Recycle()
void XrdProtLoad::Recycle |
( |
XrdLink * |
lp, |
|
|
int |
ctime, |
|
|
const char * |
txt |
|
) |
| |
|
virtual |
◆ Statistics()
int XrdProtLoad::Statistics |
( |
char * |
buff, |
|
|
int |
blen, |
|
|
int |
do_sync = 0 |
|
) |
| |
|
static |
Definition at line 256 of file XrdProtLoad.cc.
258 int i, k, totlen = 0;
260 for (i = 0; i < ProtoCnt && (blen > 0 || !buff); i++)
261 {k = Protocol[i]->
Stats(buff, blen, do_sync);
262 totlen += k; buff += k; blen -= k;
virtual int Stats(char *buff, int blen, int do_sync=0)=0
References XrdProtocol::Stats().
◆ Stats()
int XrdProtLoad::Stats |
( |
char * |
buff, |
|
|
int |
blen, |
|
|
int |
do_sync = 0 |
|
) |
| |
|
inlinevirtual |
◆ PortoMax
const int XrdProtLoad::PortoMax = 8 |
|
static |
◆ ProtoMax
const int XrdProtLoad::ProtoMax = 8 |
|
static |
The documentation for this class was generated from the following files: