xrootd
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
XrdCl::XRootDTransport Class Reference

XRootD transport handler. More...

#include <XrdClXRootDTransport.hh>

Inheritance diagram for XrdCl::XRootDTransport:
Inheritance graph
[legend]
Collaboration diagram for XrdCl::XRootDTransport:
Collaboration graph
[legend]

Public Member Functions

 XRootDTransport ()
 Constructor. More...
 
 ~XRootDTransport ()
 Destructor. More...
 
virtual Status GetHeader (Message *message, int socket)
 
virtual Status GetBody (Message *message, int socket)
 
virtual void InitializeChannel (AnyObject &channelData)
 Initialize channel. More...
 
virtual void FinalizeChannel (AnyObject &channelData)
 Finalize channel. More...
 
virtual Status HandShake (HandShakeData *handShakeData, AnyObject &channelData)
 HandShake. More...
 
virtual bool IsStreamTTLElapsed (time_t time, AnyObject &channelData)
 Check if the stream should be disconnected. More...
 
virtual PathID Multiplex (Message *msg, AnyObject &channelData, PathID *hint=0)
 
virtual PathID MultiplexSubStream (Message *msg, AnyObject &channelData, PathID *hint=0)
 
virtual uint16_t StreamNumber (AnyObject &channelData)
 Return a number of streams that should be created. More...
 
virtual uint16_t SubStreamNumber (AnyObject &channelData)
 Return a number of substreams per stream that should be created. More...
 
virtual bool NeedControlConnection ()
 
virtual void Disconnect (AnyObject &channelData, uint16_t streamId, uint16_t subStreamId)
 The stream has been disconnected, do the cleanups. More...
 
virtual Status Query (uint16_t query, AnyObject &result, AnyObject &channelData)
 Query the channel. More...
 
virtual uint32_t StreamAction (Message *msg, AnyObject &channelData)
 Check if the message invokes a stream action. More...
 
- Public Member Functions inherited from XrdCl::TransportHandler
virtual ~TransportHandler ()
 

Static Public Member Functions

static Status MarshallRequest (Message *msg)
 Marshal the outgoing message. More...
 
static Status UnMarshallRequest (Message *msg)
 
static Status UnMarshallBody (Message *msg, uint16_t reqType)
 Unmarshall the body of the incoming message. More...
 
static void UnMarshallHeader (Message *msg)
 Unmarshall the header incoming message. More...
 
static void LogErrorResponse (const Message &msg)
 Log server error response. More...
 
static void SetDescription (Message *msg)
 Get the description of a message. More...
 

Private Types

typedef XrdSecProtocol *(* XrdSecGetProt_t )(const char *, const sockaddr &, const XrdSecParameters &, XrdOucErrInfo *)
 

Private Member Functions

Status HandShakeMain (HandShakeData *handShakeData, AnyObject &channelData)
 
Status HandShakeParallel (HandShakeData *handShakeData, AnyObject &channelData)
 
MessageGenerateInitialHS (HandShakeData *hsData, XRootDChannelInfo *info)
 
MessageGenerateInitialHSProtocol (HandShakeData *hsData, XRootDChannelInfo *info)
 
Status ProcessServerHS (HandShakeData *hsData, XRootDChannelInfo *info)
 
Status ProcessProtocolResp (HandShakeData *hsData, XRootDChannelInfo *info)
 
MessageGenerateBind (HandShakeData *hsData, XRootDChannelInfo *info)
 
Status ProcessBindResp (HandShakeData *hsData, XRootDChannelInfo *info)
 
MessageGenerateLogIn (HandShakeData *hsData, XRootDChannelInfo *info)
 
Status ProcessLogInResp (HandShakeData *hsData, XRootDChannelInfo *info)
 
Status DoAuthentication (HandShakeData *hsData, XRootDChannelInfo *info)
 
Status GetCredentials (XrdSecCredentials *&credentials, HandShakeData *hsData, XRootDChannelInfo *info)
 
Status CleanUpAuthentication (XRootDChannelInfo *info)
 
XrdSecGetProt_t GetAuthHandler ()
 

Static Private Member Functions

static std::string ServerFlagsToStr (uint32_t flags)
 
static std::string FileHandleToStr (const unsigned char handle[4])
 

Private Attributes

void * pSecLibHandle
 
XrdSecGetProt_t pAuthHandler
 

Additional Inherited Members

- Public Types inherited from XrdCl::TransportHandler
enum  StreamAction {
  NoAction = 0x0000, DigestMsg = 0x0001, AbortStream = 0x0002, CloseStream = 0x0004,
  ResumeStream = 0x0008, HoldStream = 0x0010
}
 Stream actions that may be triggered by incoming control messages. More...
 

Detailed Description

XRootD transport handler.

Member Typedef Documentation

typedef XrdSecProtocol*(* XrdCl::XRootDTransport::XrdSecGetProt_t)(const char *, const sockaddr &, const XrdSecParameters &, XrdOucErrInfo *)
private

Constructor & Destructor Documentation

XrdCl::XRootDTransport::XRootDTransport ( )

Constructor.

XrdCl::XRootDTransport::~XRootDTransport ( )

Destructor.

References pSecLibHandle.

Member Function Documentation

Status XrdCl::XRootDTransport::CleanUpAuthentication ( XRootDChannelInfo info)
private
void XrdCl::XRootDTransport::Disconnect ( AnyObject channelData,
uint16_t  streamId,
uint16_t  subStreamId 
)
virtual
Status XrdCl::XRootDTransport::DoAuthentication ( HandShakeData hsData,
XRootDChannelInfo info 
)
private
std::string XrdCl::XRootDTransport::FileHandleToStr ( const unsigned char  handle[4])
staticprivate

Referenced by SetDescription().

void XrdCl::XRootDTransport::FinalizeChannel ( AnyObject channelData)
virtual

Finalize channel.

Implements XrdCl::TransportHandler.

Message * XrdCl::XRootDTransport::GenerateBind ( HandShakeData hsData,
XRootDChannelInfo info 
)
private
Message * XrdCl::XRootDTransport::GenerateInitialHS ( HandShakeData hsData,
XRootDChannelInfo info 
)
private
Message * XrdCl::XRootDTransport::GenerateInitialHSProtocol ( HandShakeData hsData,
XRootDChannelInfo info 
)
private
Message * XrdCl::XRootDTransport::GenerateLogIn ( HandShakeData hsData,
XRootDChannelInfo info 
)
private
XRootDTransport::XrdSecGetProt_t XrdCl::XRootDTransport::GetAuthHandler ( )
private
Status XrdCl::XRootDTransport::GetBody ( Message message,
int  socket 
)
virtual

Read the message body from the socket, the socket is non-blocking, the method may be called multiple times - see GetHeader for details

Parameters
messagethe message buffer containing the header
socketthe socket
Returns
stOK & suDone if the whole message has been processed stOK & suRetry if more data is needed stError on failure

Implements XrdCl::TransportHandler.

References XrdCl::Buffer::AdvanceCursor(), XrdCl::errSocketError, XrdCl::Buffer::GetBuffer(), XrdCl::Buffer::GetBufferAtCursor(), XrdCl::Buffer::GetCursor(), read(), XrdCl::Buffer::ReAllocate(), XrdCl::stError, XrdCl::stOK, XrdCl::suDone, and XrdCl::suRetry.

Status XrdCl::XRootDTransport::GetCredentials ( XrdSecCredentials *&  credentials,
HandShakeData hsData,
XRootDChannelInfo info 
)
private
Status XrdCl::XRootDTransport::GetHeader ( Message message,
int  socket 
)
virtual

Read a message header from the socket, the socket is non-blocking, so if there is not enough data the function should return errRetry in which case it will be called again when more data arrives, with the data previously read stored in the message buffer

Parameters
messagethe message buffer
socketthe socket
Returns
stOK & suDone if the whole message has been processed stOK & suRetry if more data is needed stError on failure

Implements XrdCl::TransportHandler.

References XrdCl::Buffer::AdvanceCursor(), XrdCl::Buffer::Allocate(), XrdCl::errInternal, XrdCl::errSocketError, XrdCl::Buffer::GetBufferAtCursor(), XrdCl::Buffer::GetCursor(), XrdCl::Buffer::GetSize(), read(), XrdCl::stError, XrdCl::stOK, XrdCl::suDone, XrdCl::suRetry, and UnMarshallHeader().

Status XrdCl::XRootDTransport::HandShake ( HandShakeData handShakeData,
AnyObject channelData 
)
virtual
Status XrdCl::XRootDTransport::HandShakeMain ( HandShakeData handShakeData,
AnyObject channelData 
)
private
Status XrdCl::XRootDTransport::HandShakeParallel ( HandShakeData handShakeData,
AnyObject channelData 
)
private
void XrdCl::XRootDTransport::InitializeChannel ( AnyObject channelData)
virtual
bool XrdCl::XRootDTransport::IsStreamTTLElapsed ( time_t  time,
AnyObject channelData 
)
virtual

Check if the stream should be disconnected.

Implements XrdCl::TransportHandler.

void XrdCl::XRootDTransport::LogErrorResponse ( const Message msg)
static
Status XrdCl::XRootDTransport::MarshallRequest ( Message msg)
static
PathID XrdCl::XRootDTransport::Multiplex ( Message msg,
AnyObject channelData,
PathID hint = 0 
)
virtual

Return the ID for the up stream this message should be sent by and the down stream which the answer should be expected at. Modify the message itself if necessary. If hint is non-zero then the message should be modified such that the answer will be returned via the hinted stream.

Implements XrdCl::TransportHandler.

PathID XrdCl::XRootDTransport::MultiplexSubStream ( Message msg,
AnyObject channelData,
PathID hint = 0 
)
virtual
virtual bool XrdCl::XRootDTransport::NeedControlConnection ( )
inlinevirtual

Return the information whether a control connection needs to be valid before establishing other connections

Status XrdCl::XRootDTransport::ProcessBindResp ( HandShakeData hsData,
XRootDChannelInfo info 
)
private
Status XrdCl::XRootDTransport::ProcessLogInResp ( HandShakeData hsData,
XRootDChannelInfo info 
)
private
Status XrdCl::XRootDTransport::ProcessProtocolResp ( HandShakeData hsData,
XRootDChannelInfo info 
)
private
Status XrdCl::XRootDTransport::ProcessServerHS ( HandShakeData hsData,
XRootDChannelInfo info 
)
private
Status XrdCl::XRootDTransport::Query ( uint16_t  query,
AnyObject result,
AnyObject channelData 
)
virtual
std::string XrdCl::XRootDTransport::ServerFlagsToStr ( uint32_t  flags)
staticprivate
void XrdCl::XRootDTransport::SetDescription ( Message msg)
static

Get the description of a message.

References ClientProtocolRequest::clientpv, ClientMvRequest::dlen, ClientQueryRequest::dlen, ClientStatRequest::dlen, ClientTruncateRequest::dlen, ClientWriteRequest::dlen, ClientRequestHdr::dlen, XrdCl::Log::DumpMsg, ClientCloseRequest::fhandle, ClientReadRequest::fhandle, ClientStatRequest::fhandle, ClientSyncRequest::fhandle, ClientTruncateRequest::fhandle, ClientWriteRequest::fhandle, readahead_list::fhandle, FileHandleToStr(), XrdCl::Buffer::GetBuffer(), XrdCl::Log::GetLevel(), XrdCl::DefaultEnv::GetLog(), ClientQueryRequest::infotype, kXR_async, kXR_chmod, kXR_close, kXR_coloc, kXR_delete, kXR_dirlist, kXR_force, kXR_fresh, kXR_locate, kXR_mkdir, kXR_mkdirpath, kXR_mkpath, kXR_mv, kXR_new, kXR_nowait, kXR_open, kXR_open_apnd, kXR_open_read, kXR_open_updt, kXR_ping, kXR_posc, kXR_prepare, kXR_protocol, kXR_Qckscan, kXR_Qcksum, kXR_Qconfig, kXR_Qopaque, kXR_Qopaquf, kXR_QPrep, kXR_Qspace, kXR_QStats, kXR_query, kXR_Qvisa, kXR_Qxattr, kXR_read, kXR_readv, kXR_refresh, kXR_replica, kXR_retstat, kXR_rm, kXR_rmdir, kXR_seqio, kXR_set, kXR_stage, kXR_stat, kXR_sync, kXR_truncate, kXR_vfs, kXR_wmode, kXR_write, ClientChmodRequest::mode, ClientMkdirRequest::mode, ClientOpenRequest::mode, ClientReadRequest::offset, ClientTruncateRequest::offset, ClientWriteRequest::offset, ClientLocateRequest::options, ClientMkdirRequest::options, ClientOpenRequest::options, ClientPrepareRequest::options, ClientStatRequest::options, ClientPrepareRequest::prty, ClientRequestHdr::requestid, ClientReadRequest::rlen, readahead_list::rlen, and XrdCl::Message::SetDescription().

Referenced by XrdCl::MessageUtils::AppendCGI(), XrdCl::FileSystem::ChMod(), XrdCl::FileStateHandler::Close(), XrdCl::FileSystem::DirList(), XrdCl::FileSystem::Locate(), XrdCl::FileSystem::MkDir(), XrdCl::FileSystem::Mv(), XrdCl::FileStateHandler::Open(), XrdCl::FileSystem::Ping(), XrdCl::FileSystem::Prepare(), XrdCl::FileSystem::Protocol(), XrdCl::FileSystem::Query(), XrdCl::FileStateHandler::Read(), XrdCl::FileStateHandler::ReOpenFileAtServer(), XrdCl::FileStateHandler::ReWriteFileHandle(), XrdCl::XRootDMsgHandler::RewriteRequestWait(), XrdCl::FileSystem::Rm(), XrdCl::FileSystem::RmDir(), XrdCl::FileSystem::SendInfo(), XrdCl::FileStateHandler::Stat(), XrdCl::FileSystem::Stat(), XrdCl::FileSystem::StatVFS(), XrdCl::XRootDMsgHandler::SwitchOnRefreshFlag(), XrdCl::FileStateHandler::Sync(), XrdCl::FileStateHandler::Truncate(), XrdCl::FileSystem::Truncate(), XrdCl::FileStateHandler::VectorRead(), and XrdCl::FileStateHandler::Write().

uint32_t XrdCl::XRootDTransport::StreamAction ( Message msg,
AnyObject channelData 
)
virtual
uint16_t XrdCl::XRootDTransport::StreamNumber ( AnyObject channelData)
virtual

Return a number of streams that should be created.

Implements XrdCl::TransportHandler.

uint16_t XrdCl::XRootDTransport::SubStreamNumber ( AnyObject channelData)
virtual
Status XrdCl::XRootDTransport::UnMarshallBody ( Message msg,
uint16_t  reqType 
)
static
void XrdCl::XRootDTransport::UnMarshallHeader ( Message msg)
static

Unmarshall the header incoming message.

References ServerResponseHeader::dlen, XrdCl::Buffer::GetBuffer(), and ServerResponseHeader::status.

Referenced by GetHeader(), and XrdCl::XRootDMsgHandler::Process().

Status XrdCl::XRootDTransport::UnMarshallRequest ( Message msg)
static

Member Data Documentation

XrdSecGetProt_t XrdCl::XRootDTransport::pAuthHandler
private

Referenced by GetAuthHandler().

void* XrdCl::XRootDTransport::pSecLibHandle
private

Referenced by GetAuthHandler(), and ~XRootDTransport().


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