xrootd
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
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]

List of all members.

Public Member Functions

 XRootDTransport ()
 Constructor.
 ~XRootDTransport ()
 Destructor.
virtual Status GetHeader (Message *message, int socket)
virtual Status GetBody (Message *message, int socket)
virtual void InitializeChannel (AnyObject &channelData)
 Initialize channel.
virtual void FinalizeChannel (AnyObject &channelData)
 Finalize channel.
virtual Status HandShake (HandShakeData *handShakeData, AnyObject &channelData)
 HandShake.
virtual bool IsStreamTTLElapsed (time_t time, AnyObject &channelData)
 Check if the stream should be disconnected.
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.
virtual uint16_t SubStreamNumber (AnyObject &channelData)
 Return a number of substreams per stream that should be created.
virtual bool NeedControlConnection ()
virtual void Disconnect (AnyObject &channelData, uint16_t streamId, uint16_t subStreamId)
 The stream has been disconnected, do the cleanups.
virtual Status Query (uint16_t query, AnyObject &result, AnyObject &channelData)
 Query the channel.
virtual uint32_t StreamAction (Message *msg, AnyObject &channelData)
 Check if the message invokes a stream action.

Static Public Member Functions

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

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)
Message * GenerateInitialHS (HandShakeData *hsData, XRootDChannelInfo *info)
Message * GenerateInitialHSProtocol (HandShakeData *hsData, XRootDChannelInfo *info)
Status ProcessServerHS (HandShakeData *hsData, XRootDChannelInfo *info)
Status ProcessProtocolResp (HandShakeData *hsData, XRootDChannelInfo *info)
Message * GenerateBind (HandShakeData *hsData, XRootDChannelInfo *info)
Status ProcessBindResp (HandShakeData *hsData, XRootDChannelInfo *info)
Message * GenerateLogIn (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

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

Constructor.

Destructor.

References pSecLibHandle.


Member Function Documentation

void XrdCl::XRootDTransport::Disconnect ( AnyObject &  channelData,
uint16_t  streamId,
uint16_t  subStreamId 
) [virtual]
std::string XrdCl::XRootDTransport::FileHandleToStr ( const unsigned char  handle[4]) [static, private]

Referenced by SetDescription().

void XrdCl::XRootDTransport::FinalizeChannel ( AnyObject &  channelData) [virtual]

Finalize channel.

Implements XrdCl::TransportHandler.

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]
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 ( ) [inline, virtual]

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

Status XrdCl::XRootDTransport::Query ( uint16_t  query,
AnyObject &  result,
AnyObject &  channelData 
) [virtual]
std::string XrdCl::XRootDTransport::ServerFlagsToStr ( uint32_t  flags) [static, private]

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]

Unmarshall the header incoming message.

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

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


Member Data Documentation

Referenced by GetAuthHandler().

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


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