XRootD
XrdSecProtBind Class Reference
+ Collaboration diagram for XrdSecProtBind:

Public Member Functions

 XrdSecProtBind (char *th, char *st, XrdSecPMask_t pmask=0)
 
 ~XrdSecProtBind ()
 
XrdSecProtBindFind (const char *hname)
 
int Match (const char *hname)
 

Public Attributes

XrdSecProtBindnext
 
XrdSecParameters SecToken
 
char * thost
 
char * thostsfx
 
int tpfxlen
 
int tsfxlen
 
XrdSecPMask_t ValidProts
 

Detailed Description

Definition at line 96 of file XrdSecServer.cc.

Constructor & Destructor Documentation

◆ XrdSecProtBind()

XrdSecProtBind::XrdSecProtBind ( char *  th,
char *  st,
XrdSecPMask_t  pmask = 0 
)

Definition at line 122 of file XrdSecServer.cc.

123 {
124  char *starp;
125  next = 0;
126  thost = th;
127  if (!(starp = index(thost, '*')))
128  {tsfxlen = -1;
129  thostsfx = (char *)0;
130  tpfxlen = 0;
131  } else {
132  *starp = '\0';
133  tpfxlen = strlen(thost);
134  thostsfx = starp+1;
135  tsfxlen = strlen(thostsfx);
136  }
137  if (st) {SecToken.buffer = strdup(st); SecToken.size = strlen(st);}
138  else {SecToken.buffer = 0; SecToken.size = 0;}
139  ValidProts = (pmask ? pmask : ~(XrdSecPMask_t)0);
140 }
int XrdSecPMask_t
XrdSecProtBind * next
Definition: XrdSecServer.cc:99
XrdSecPMask_t ValidProts
XrdSecParameters SecToken
char * buffer
Pointer to the buffer.
int size
Size of the buffer or length of data in the buffer.

References XrdSecBuffer::buffer, next, SecToken, XrdSecBuffer::size, thost, thostsfx, tpfxlen, tsfxlen, and ValidProts.

◆ ~XrdSecProtBind()

XrdSecProtBind::~XrdSecProtBind ( )
inline

Definition at line 112 of file XrdSecServer.cc.

113  {free(thost);
114  if (SecToken.buffer) free(SecToken.buffer);
115  }

References XrdSecBuffer::buffer, SecToken, and thost.

Member Function Documentation

◆ Find()

XrdSecProtBind * XrdSecProtBind::Find ( const char *  hname)

Definition at line 146 of file XrdSecServer.cc.

147 {
148  XrdSecProtBind *bp = this;
149 
150  while(bp && !bp->Match(hname)) bp = bp->next;
151 
152  return bp;
153 }
int Match(const char *hname)

References Match(), and next.

Referenced by XrdSecServer::getProtocol().

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

◆ Match()

int XrdSecProtBind::Match ( const char *  hname)

Definition at line 159 of file XrdSecServer.cc.

160 {
161  int i;
162 
163 // If an exact match wanted, return the result
164 //
165  if (tsfxlen < 0) return !strcmp(thost, hname);
166 
167 // Try to match the prefix
168 //
169  if (tpfxlen && strncmp(thost, hname, tpfxlen)) return 0;
170 
171 // If no suffix matching is wanted, then we have succeeded
172 //
173  if (!(thostsfx)) return 1;
174 
175 // Try to match the suffix
176 //
177  if ((i = (strlen(hname) - tsfxlen)) < 0) return 0;
178  return !strcmp(&hname[i], thostsfx);
179 }

References thost, thostsfx, tpfxlen, and tsfxlen.

Referenced by Find(), and XrdSecServer::getParms().

+ Here is the caller graph for this function:

Member Data Documentation

◆ next

XrdSecProtBind* XrdSecProtBind::next

Definition at line 99 of file XrdSecServer.cc.

Referenced by XrdSecProtBind(), Find(), and XrdSecServer::getParms().

◆ SecToken

XrdSecParameters XrdSecProtBind::SecToken

Definition at line 104 of file XrdSecServer.cc.

Referenced by XrdSecProtBind(), ~XrdSecProtBind(), and XrdSecServer::getParms().

◆ thost

char* XrdSecProtBind::thost

Definition at line 100 of file XrdSecServer.cc.

Referenced by XrdSecProtBind(), ~XrdSecProtBind(), and Match().

◆ thostsfx

char* XrdSecProtBind::thostsfx

Definition at line 102 of file XrdSecServer.cc.

Referenced by XrdSecProtBind(), and Match().

◆ tpfxlen

int XrdSecProtBind::tpfxlen

Definition at line 101 of file XrdSecServer.cc.

Referenced by XrdSecProtBind(), and Match().

◆ tsfxlen

int XrdSecProtBind::tsfxlen

Definition at line 103 of file XrdSecServer.cc.

Referenced by XrdSecProtBind(), and Match().

◆ ValidProts

XrdSecPMask_t XrdSecProtBind::ValidProts

Definition at line 105 of file XrdSecServer.cc.

Referenced by XrdSecProtBind(), and XrdSecServer::getProtocol().


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