xrootd
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
XrdSecTLayer Class Referenceabstract

#include <XrdSecTLayer.hh>

Inheritance diagram for XrdSecTLayer:
Inheritance graph
[legend]
Collaboration diagram for XrdSecTLayer:
Collaboration graph
[legend]

Classes

struct  TLayerRR
 

Public Types

enum  Initiator { isClient = 0, isServer }
 

Public Member Functions

 XrdSecTLayer (const char *pName, Initiator who1st=isClient)
 
virtual void secClient (int theFD, XrdOucErrInfo *einfo)=0
 
virtual void secServer (int theFD, XrdOucErrInfo *einfo)=0
 
virtual void Delete ()=0
 Delete the protocol object. DO NOT use C++ delete() on this object. More...
 
virtual int Authenticate (XrdSecCredentials *cred, XrdSecParameters **parms, XrdOucErrInfo *einfo=0)
 
virtual XrdSecCredentialsgetCredentials (XrdSecParameters *parm=0, XrdOucErrInfo *einfo=0)
 
void secXeq ()
 
- Public Member Functions inherited from XrdSecProtocol
virtual int Encrypt (const char *, int, XrdSecBuffer **)
 
virtual int Decrypt (const char *, int, XrdSecBuffer **)
 
virtual int Sign (const char *, int, XrdSecBuffer **)
 
virtual int Verify (const char *, int, const char *, int)
 
virtual int getKey (char *=0, int=0)
 
virtual int setKey (char *, int)
 
 XrdSecProtocol (const char *pName)
 Constructor. More...
 

Protected Member Functions

virtual ~XrdSecTLayer ()
 
- Protected Member Functions inherited from XrdSecProtocol
virtual ~XrdSecProtocol ()
 Destructor (prevents use of direct delete). More...
 

Protected Attributes

pthread_t secTid
 

Private Member Functions

int bootUp (Initiator Who)
 
int Read (int FD, char *Buff, int rdLen)
 
int secDone ()
 
void secDrain ()
 
const char * secErrno (int rc, char *buff)
 
void secError (const char *Msg, int rc, int iserrno=1)
 

Private Attributes

XrdSysSemaphore mySem
 
Initiator Starter
 
Initiator Responder
 
int myFD
 
int urFD
 
int Tmax
 
int Tcur
 
int eCode
 
char * eText
 
XrdOucErrInfoeDest
 
struct XrdSecTLayer::TLayerRR Hdr
 

Static Private Attributes

static const int buffSz = 8192
 
static const int hdrSz = sizeof(TLayerRR)
 
static const int dataSz = buffSz - hdrSz
 

Additional Inherited Members

- Public Attributes inherited from XrdSecProtocol
XrdSecEntity Entity
 

Member Enumeration Documentation

Enumerator
isClient 
isServer 

Constructor & Destructor Documentation

XrdSecTLayer::XrdSecTLayer ( const char *  pName,
Initiator  who1st = isClient 
)
virtual XrdSecTLayer::~XrdSecTLayer ( )
inlineprotectedvirtual

References close(), eText, and myFD.

Member Function Documentation

int XrdSecTLayer::Authenticate ( XrdSecCredentials cred,
XrdSecParameters **  parms,
XrdOucErrInfo einfo = 0 
)
virtual

Authenticate a client.

Parameters
credCredentials supplied by the client.
parmsPlace where the address of additional authentication data is to be placed for another autrhentication handshake.
einfoThe error information object where error messages should be placed. The messages are returned to the client. Should einfo be null, messages should be written to stderr.
Returns
> 0 -> parms present (more authentication needed) = 0 -> Entity present (authentication suceeded) < 0 -> einfo present (error has occured)

Implements XrdSecProtocol.

References bootUp(), XrdSecBuffer::buffer, dataSz, eDest, XrdSecTLayer::TLayerRR::endData, Hdr, hdrSz, isServer, myFD, XrdSecTLayer::TLayerRR::protCode, Read(), secDone(), secError(), XrdSecBuffer::size, Tcur, Tmax, write(), and XrdSecTLayer::TLayerRR::xfrData.

int XrdSecTLayer::bootUp ( Initiator  Who)
private
virtual void XrdSecTLayer::Delete ( )
pure virtual

Delete the protocol object. DO NOT use C++ delete() on this object.

Implements XrdSecProtocol.

XrdSecCredentials * XrdSecTLayer::getCredentials ( XrdSecParameters parm = 0,
XrdOucErrInfo einfo = 0 
)
virtual

Generate client credentials to be used in the authentication process.

Parameters
parmPointer to the information returned by the server either in the initial login response or the authmore response.
einfoThe error information object where error messages should be placed. The messages are returned to the client. Should einfo be null, messages should be written to stderr.
Returns
Success: Pointer to credentials to sent to the server. The caller is responsible for deleting the object. Failure: Null pointer with einfo, if supplied, containing the reason for the failure.

Implements XrdSecProtocol.

References bootUp(), XrdSecBuffer::buffer, dataSz, eDest, XrdSecTLayer::TLayerRR::endData, Hdr, hdrSz, isClient, isServer, myFD, XrdSecTLayer::TLayerRR::protCode, Read(), secDone(), secError(), XrdSecBuffer::size, Starter, Tcur, Tmax, write(), and XrdSecTLayer::TLayerRR::xfrData.

int XrdSecTLayer::Read ( int  FD,
char *  Buff,
int  rdLen 
)
private

References read(), and Tcur.

Referenced by Authenticate(), and getCredentials().

virtual void XrdSecTLayer::secClient ( int  theFD,
XrdOucErrInfo einfo 
)
pure virtual

Referenced by secXeq().

int XrdSecTLayer::secDone ( )
private

References eCode, eText, secDrain(), and secError().

Referenced by Authenticate(), and getCredentials().

void XrdSecTLayer::secDrain ( )
private

References close(), myFD, mySem, and XrdSysSemaphore::Wait().

Referenced by secDone(), and secError().

const char * XrdSecTLayer::secErrno ( int  rc,
char *  buff 
)
private

Referenced by secError().

void XrdSecTLayer::secError ( const char *  Msg,
int  rc,
int  iserrno = 1 
)
private
virtual void XrdSecTLayer::secServer ( int  theFD,
XrdOucErrInfo einfo 
)
pure virtual

Referenced by secXeq().

void XrdSecTLayer::secXeq ( )

Member Data Documentation

const int XrdSecTLayer::buffSz = 8192
staticprivate
const int XrdSecTLayer::dataSz = buffSz - hdrSz
staticprivate

Referenced by Authenticate(), and getCredentials().

int XrdSecTLayer::eCode
private

Referenced by secDone(), and secXeq().

XrdOucErrInfo* XrdSecTLayer::eDest
private
char* XrdSecTLayer::eText
private

Referenced by secDone(), secXeq(), and ~XrdSecTLayer().

struct XrdSecTLayer::TLayerRR XrdSecTLayer::Hdr
private
const int XrdSecTLayer::hdrSz = sizeof(TLayerRR)
staticprivate

Referenced by Authenticate(), and getCredentials().

int XrdSecTLayer::myFD
private
XrdSysSemaphore XrdSecTLayer::mySem
private

Referenced by secDrain(), and secXeq().

Initiator XrdSecTLayer::Responder
private

Referenced by bootUp(), and secXeq().

pthread_t XrdSecTLayer::secTid
protected

Referenced by bootUp().

Initiator XrdSecTLayer::Starter
private

Referenced by getCredentials().

int XrdSecTLayer::Tcur
private

Referenced by Authenticate(), getCredentials(), and Read().

int XrdSecTLayer::Tmax
private

Referenced by Authenticate(), and getCredentials().

int XrdSecTLayer::urFD
private

Referenced by bootUp(), and secXeq().


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