xrootd
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | 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.
 
 ~XRootDTransport ()
 Destructor.
 
virtual XRootDStatus GetHeader (Message &message, Socket *socket)
 
virtual XRootDStatus GetBody (Message &message, Socket *socket)
 
virtual XRootDStatus GetMore (Message &message, Socket *socket)
 
virtual void InitializeChannel (const URL &url, AnyObject &channelData)
 Initialize channel.
 
virtual void FinalizeChannel (AnyObject &channelData)
 Finalize channel.
 
virtual XRootDStatus HandShake (HandShakeData *handShakeData, AnyObject &channelData)
 HandShake.
 
virtual bool HandShakeDone (HandShakeData *handShakeData, AnyObject &channelData)
 
virtual bool IsStreamTTLElapsed (time_t time, AnyObject &channelData)
 Check if the stream should be disconnected.
 
virtual Status IsStreamBroken (time_t inactiveTime, AnyObject &channelData)
 
virtual PathID Multiplex (Message *msg, AnyObject &channelData, PathID *hint=0)
 
virtual PathID MultiplexSubStream (Message *msg, AnyObject &channelData, PathID *hint=0)
 
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 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 MessageReceived (Message &msg, uint16_t subStream, AnyObject &channelData)
 Check if the message invokes a stream action.
 
virtual void MessageSent (Message *msg, uint16_t subStream, uint32_t bytesSent, AnyObject &channelData)
 Notify the transport about a message having been sent.
 
virtual Status GetSignature (Message *toSign, Message *&sign, AnyObject &channelData)
 Get signature for given message.
 
virtual Status GetSignature (Message *toSign, Message *&sign, XRootDChannelInfo *info)
 Get signature for given message.
 
virtual void DecFileInstCnt (AnyObject &channelData)
 Decrement file object instance count bound to this channel.
 
virtual void WaitBeforeExit ()
 Wait until the program can safely exit.
 
virtual bool NeedEncryption (HandShakeData *handShakeData, AnyObject &channelData)
 
virtual URL GetBindPreference (const URL &url, AnyObject &channelData)
 Get bind preference for the next data stream.
 
- Public Member Functions inherited from XrdCl::TransportHandler
virtual ~TransportHandler ()
 

Static Public Member Functions

static XRootDStatus MarshallRequest (Message *msg)
 Marshal the outgoing message.
 
static XRootDStatus MarshallRequest (char *msg)
 Marshal the outgoing message.
 
static XRootDStatus UnMarshallRequest (Message *msg)
 
static XRootDStatus UnMarshallBody (Message *msg, uint16_t reqType)
 Unmarshall the body of the incoming message.
 
static XRootDStatus UnMarshalStatusBody (Message &msg, uint16_t reqType)
 Unmarshall the body of the status response.
 
static XRootDStatus UnMarchalStatusMore (Message &msg)
 Unmarshall the correction-segment of the status response for pgwrite.
 
static void UnMarshallHeader (Message &msg)
 Unmarshall the header incoming message.
 
static void LogErrorResponse (const Message &msg)
 Log server error response.
 
static uint16_t NbConnectedStrm (AnyObject &channelData)
 Number of currently connected data streams.
 
static void GenerateDescription (char *msg, std::ostringstream &o)
 Get the description of a message.
 
static void SetDescription (Message *msg)
 Get the description of a message.
 

Private Member Functions

XRootDStatus HandShakeMain (HandShakeData *handShakeData, AnyObject &channelData)
 
XRootDStatus HandShakeParallel (HandShakeData *handShakeData, AnyObject &channelData)
 
MessageGenerateInitialHSProtocol (HandShakeData *hsData, XRootDChannelInfo *info, kXR_char expect)
 
MessageGenerateProtocol (HandShakeData *hsData, XRootDChannelInfo *info, kXR_char expect)
 
void InitProtocolReq (ClientProtocolRequest *request, XRootDChannelInfo *info, kXR_char expect)
 
XRootDStatus ProcessServerHS (HandShakeData *hsData, XRootDChannelInfo *info)
 
XRootDStatus ProcessProtocolResp (HandShakeData *hsData, XRootDChannelInfo *info)
 
XRootDStatus ProcessProtocolBody (char *bodybuff, size_t bodysize, XRootDChannelInfo *info)
 
MessageGenerateBind (HandShakeData *hsData, XRootDChannelInfo *info)
 
XRootDStatus ProcessBindResp (HandShakeData *hsData, XRootDChannelInfo *info)
 
MessageGenerateLogIn (HandShakeData *hsData, XRootDChannelInfo *info)
 
XRootDStatus ProcessLogInResp (HandShakeData *hsData, XRootDChannelInfo *info)
 
XRootDStatus DoAuthentication (HandShakeData *hsData, XRootDChannelInfo *info)
 
XRootDStatus GetCredentials (XrdSecCredentials *&credentials, HandShakeData *hsData, XRootDChannelInfo *info)
 
Status CleanUpAuthentication (XRootDChannelInfo *info)
 
Status CleanUpProtection (XRootDChannelInfo *info)
 
XrdSecGetProt_t GetAuthHandler ()
 
MessageGenerateEndSession (HandShakeData *hsData, XRootDChannelInfo *info)
 
Status ProcessEndSessionResp (HandShakeData *hsData, XRootDChannelInfo *info)
 

Static Private Member Functions

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

Private Attributes

PluginUnloadHandlerpSecUnloadHandler
 

Friends

struct PluginUnloadHandler
 

Additional Inherited Members

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

Detailed Description

XRootD transport handler.

Constructor & Destructor Documentation

◆ XRootDTransport()

XrdCl::XRootDTransport::XRootDTransport ( )

Constructor.

◆ ~XRootDTransport()

XrdCl::XRootDTransport::~XRootDTransport ( )

Destructor.

Member Function Documentation

◆ CleanUpAuthentication()

Status XrdCl::XRootDTransport::CleanUpAuthentication ( XRootDChannelInfo *  info)
private

◆ CleanUpProtection()

Status XrdCl::XRootDTransport::CleanUpProtection ( XRootDChannelInfo *  info)
private

◆ DecFileInstCnt()

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

Decrement file object instance count bound to this channel.

Implements XrdCl::TransportHandler.

◆ Disconnect()

virtual void XrdCl::XRootDTransport::Disconnect ( AnyObject channelData,
uint16_t  subStreamId 
)
virtual

The stream has been disconnected, do the cleanups.

Implements XrdCl::TransportHandler.

◆ DoAuthentication()

XRootDStatus XrdCl::XRootDTransport::DoAuthentication ( HandShakeData hsData,
XRootDChannelInfo *  info 
)
private

◆ FileHandleToStr()

static std::string XrdCl::XRootDTransport::FileHandleToStr ( const unsigned char  handle[4])
staticprivate

◆ FinalizeChannel()

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

Finalize channel.

Implements XrdCl::TransportHandler.

◆ GenerateBind()

Message * XrdCl::XRootDTransport::GenerateBind ( HandShakeData hsData,
XRootDChannelInfo *  info 
)
private

◆ GenerateDescription()

static void XrdCl::XRootDTransport::GenerateDescription ( char *  msg,
std::ostringstream &  o 
)
static

Get the description of a message.

Referenced by SetDescription().

◆ GenerateEndSession()

Message * XrdCl::XRootDTransport::GenerateEndSession ( HandShakeData hsData,
XRootDChannelInfo *  info 
)
private

◆ GenerateInitialHSProtocol()

Message * XrdCl::XRootDTransport::GenerateInitialHSProtocol ( HandShakeData hsData,
XRootDChannelInfo *  info,
kXR_char  expect 
)
private

◆ GenerateLogIn()

Message * XrdCl::XRootDTransport::GenerateLogIn ( HandShakeData hsData,
XRootDChannelInfo *  info 
)
private

◆ GenerateProtocol()

Message * XrdCl::XRootDTransport::GenerateProtocol ( HandShakeData hsData,
XRootDChannelInfo *  info,
kXR_char  expect 
)
private

◆ GetAuthHandler()

XrdSecGetProt_t XrdCl::XRootDTransport::GetAuthHandler ( )
private

◆ GetBindPreference()

virtual URL XrdCl::XRootDTransport::GetBindPreference ( const URL url,
AnyObject channelData 
)
virtual

Get bind preference for the next data stream.

Implements XrdCl::TransportHandler.

◆ GetBody()

virtual XRootDStatus XrdCl::XRootDTransport::GetBody ( Message message,
Socket 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.

◆ GetCredentials()

XRootDStatus XrdCl::XRootDTransport::GetCredentials ( XrdSecCredentials *&  credentials,
HandShakeData hsData,
XRootDChannelInfo *  info 
)
private

◆ GetHeader()

virtual XRootDStatus XrdCl::XRootDTransport::GetHeader ( Message message,
Socket 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 suRetry 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.

◆ GetMore()

virtual XRootDStatus XrdCl::XRootDTransport::GetMore ( Message message,
Socket socket 
)
virtual

Read more of 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.

◆ GetSignature() [1/2]

virtual Status XrdCl::XRootDTransport::GetSignature ( Message toSign,
Message *&  sign,
AnyObject channelData 
)
virtual

Get signature for given message.

Implements XrdCl::TransportHandler.

◆ GetSignature() [2/2]

virtual Status XrdCl::XRootDTransport::GetSignature ( Message toSign,
Message *&  sign,
XRootDChannelInfo *  info 
)
virtual

Get signature for given message.

◆ HandShake()

virtual XRootDStatus XrdCl::XRootDTransport::HandShake ( HandShakeData handShakeData,
AnyObject channelData 
)
virtual

HandShake.

Implements XrdCl::TransportHandler.

◆ HandShakeDone()

virtual bool XrdCl::XRootDTransport::HandShakeDone ( HandShakeData handShakeData,
AnyObject channelData 
)
virtual

◆ HandShakeMain()

XRootDStatus XrdCl::XRootDTransport::HandShakeMain ( HandShakeData handShakeData,
AnyObject channelData 
)
private

◆ HandShakeParallel()

XRootDStatus XrdCl::XRootDTransport::HandShakeParallel ( HandShakeData handShakeData,
AnyObject channelData 
)
private

◆ InitializeChannel()

virtual void XrdCl::XRootDTransport::InitializeChannel ( const URL url,
AnyObject channelData 
)
virtual

Initialize channel.

Implements XrdCl::TransportHandler.

◆ InitProtocolReq()

void XrdCl::XRootDTransport::InitProtocolReq ( ClientProtocolRequest request,
XRootDChannelInfo *  info,
kXR_char  expect 
)
private

◆ IsStreamBroken()

virtual Status XrdCl::XRootDTransport::IsStreamBroken ( time_t  inactiveTime,
AnyObject channelData 
)
virtual

Check the stream is broken - ie. TCP connection got broken and went undetected by the TCP stack

Implements XrdCl::TransportHandler.

◆ IsStreamTTLElapsed()

virtual bool XrdCl::XRootDTransport::IsStreamTTLElapsed ( time_t  time,
AnyObject channelData 
)
virtual

Check if the stream should be disconnected.

Implements XrdCl::TransportHandler.

◆ LogErrorResponse()

static void XrdCl::XRootDTransport::LogErrorResponse ( const Message msg)
static

Log server error response.

◆ MarshallRequest() [1/2]

static XRootDStatus XrdCl::XRootDTransport::MarshallRequest ( char *  msg)
static

Marshal the outgoing message.

◆ MarshallRequest() [2/2]

static XRootDStatus XrdCl::XRootDTransport::MarshallRequest ( Message msg)
inlinestatic

Marshal the outgoing message.

References XrdCl::Buffer::GetBuffer(), MarshallRequest(), and XrdCl::Message::SetIsMarshalled().

Referenced by MarshallRequest().

◆ MessageReceived()

virtual uint32_t XrdCl::XRootDTransport::MessageReceived ( Message msg,
uint16_t  subStream,
AnyObject channelData 
)
virtual

Check if the message invokes a stream action.

Implements XrdCl::TransportHandler.

◆ MessageSent()

virtual void XrdCl::XRootDTransport::MessageSent ( Message msg,
uint16_t  subStream,
uint32_t  bytesSent,
AnyObject channelData 
)
virtual

Notify the transport about a message having been sent.

Implements XrdCl::TransportHandler.

◆ Multiplex()

virtual 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.

◆ MultiplexSubStream()

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

Return the ID for the up substream this message should be sent by and the down substream 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.

◆ NbConnectedStrm()

static uint16_t XrdCl::XRootDTransport::NbConnectedStrm ( AnyObject channelData)
static

Number of currently connected data streams.

◆ NeedControlConnection()

virtual bool XrdCl::XRootDTransport::NeedControlConnection ( )
inlinevirtual

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

◆ NeedEncryption()

virtual bool XrdCl::XRootDTransport::NeedEncryption ( HandShakeData handShakeData,
AnyObject channelData 
)
virtual
Returns
: true if encryption should be turned on, false otherwise

Implements XrdCl::TransportHandler.

◆ ProcessBindResp()

XRootDStatus XrdCl::XRootDTransport::ProcessBindResp ( HandShakeData hsData,
XRootDChannelInfo *  info 
)
private

◆ ProcessEndSessionResp()

Status XrdCl::XRootDTransport::ProcessEndSessionResp ( HandShakeData hsData,
XRootDChannelInfo *  info 
)
private

◆ ProcessLogInResp()

XRootDStatus XrdCl::XRootDTransport::ProcessLogInResp ( HandShakeData hsData,
XRootDChannelInfo *  info 
)
private

◆ ProcessProtocolBody()

XRootDStatus XrdCl::XRootDTransport::ProcessProtocolBody ( char *  bodybuff,
size_t  bodysize,
XRootDChannelInfo *  info 
)
private

◆ ProcessProtocolResp()

XRootDStatus XrdCl::XRootDTransport::ProcessProtocolResp ( HandShakeData hsData,
XRootDChannelInfo *  info 
)
private

◆ ProcessServerHS()

XRootDStatus XrdCl::XRootDTransport::ProcessServerHS ( HandShakeData hsData,
XRootDChannelInfo *  info 
)
private

◆ Query()

virtual Status XrdCl::XRootDTransport::Query ( uint16_t  query,
AnyObject result,
AnyObject channelData 
)
virtual

Query the channel.

Implements XrdCl::TransportHandler.

◆ ServerFlagsToStr()

static std::string XrdCl::XRootDTransport::ServerFlagsToStr ( uint32_t  flags)
staticprivate

◆ SetDescription()

static void XrdCl::XRootDTransport::SetDescription ( Message msg)
inlinestatic

Get the description of a message.

References GenerateDescription(), XrdCl::Buffer::GetBuffer(), and XrdCl::Message::SetDescription().

◆ SubStreamNumber()

virtual uint16_t XrdCl::XRootDTransport::SubStreamNumber ( AnyObject channelData)
virtual

Return a number of substreams per stream that should be created.

Implements XrdCl::TransportHandler.

◆ UnMarchalStatusMore()

static XRootDStatus XrdCl::XRootDTransport::UnMarchalStatusMore ( Message msg)
static

Unmarshall the correction-segment of the status response for pgwrite.

◆ UnMarshallBody()

static XRootDStatus XrdCl::XRootDTransport::UnMarshallBody ( Message msg,
uint16_t  reqType 
)
static

Unmarshall the body of the incoming message.

◆ UnMarshallHeader()

static void XrdCl::XRootDTransport::UnMarshallHeader ( Message msg)
static

Unmarshall the header incoming message.

◆ UnMarshallRequest()

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

Unmarshall the request - sometimes the requests need to be rewritten, so we need to unmarshall them

◆ UnMarshalStatusBody()

static XRootDStatus XrdCl::XRootDTransport::UnMarshalStatusBody ( Message msg,
uint16_t  reqType 
)
static

Unmarshall the body of the status response.

◆ WaitBeforeExit()

virtual void XrdCl::XRootDTransport::WaitBeforeExit ( )
virtual

Wait until the program can safely exit.

Implements XrdCl::TransportHandler.

Friends And Related Symbol Documentation

◆ PluginUnloadHandler

friend struct PluginUnloadHandler
friend

Member Data Documentation

◆ pSecUnloadHandler

PluginUnloadHandler* XrdCl::XRootDTransport::pSecUnloadHandler
private

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