diff --git a/src/XrdCl/XrdClXRootDChannelInfo.hh b/src/XrdCl/XrdClXRootDChannelInfo.hh new file mode 100644 index 00000000000..d455f3b8dd9 --- /dev/null +++ b/src/XrdCl/XrdClXRootDChannelInfo.hh @@ -0,0 +1,123 @@ +/* + * XrdClXRootDChannelInfo.hh + * + * Created on: Oct 5, 2016 + * Author: simonm + */ + +#ifndef SRC_XRDCL_XRDCLXROOTDCHANNELINFO_HH_ +#define SRC_XRDCL_XRDCLXROOTDCHANNELINFO_HH_ + +#include "XrdCl/XrdClSIDManager.hh" +#include "XrdSec/XrdSecInterface.hh" +#include "XrdSec/XrdSecProtect.hh" +#include "XrdOuc/XrdOucEnv.hh" +#include "XrdSys/XrdSysPthread.hh" + +#include +#include +#include +#include + +namespace XrdCl +{ + //---------------------------------------------------------------------------- + //! Information holder for XRootDStreams + //---------------------------------------------------------------------------- + struct XRootDStreamInfo + { + //-------------------------------------------------------------------------- + // Define the stream status for the link negotiation purposes + //-------------------------------------------------------------------------- + enum StreamStatus + { + Disconnected, + Broken, + HandShakeSent, + HandShakeReceived, + LoginSent, + AuthSent, + BindSent, + EndSessionSent, + Connected + }; + + //-------------------------------------------------------------------------- + // Constructor + //-------------------------------------------------------------------------- + XRootDStreamInfo(): status( Disconnected ), pathId( 0 ) + { + } + + StreamStatus status; + uint8_t pathId; + }; + + //---------------------------------------------------------------------------- + //! Information holder for xrootd channels + //---------------------------------------------------------------------------- + struct XRootDChannelInfo + { + //-------------------------------------------------------------------------- + // Constructor + //-------------------------------------------------------------------------- + XRootDChannelInfo(): + serverFlags(0), + protocolVersion(0), + firstLogIn(true), + sidManager(0), + authBuffer(0), + authProtocol(0), + authParams(0), + authEnv(0), + openFiles(0), + waitBarrier(0), + protection(0), + signprot(0) + { + sidManager = new SIDManager(); + memset( sessionId, 0, 16 ); + memset( oldSessionId, 0, 16 ); + + // TODO cleanup protection and signprot + } + + //-------------------------------------------------------------------------- + // Destructor + //-------------------------------------------------------------------------- + ~XRootDChannelInfo() + { + delete sidManager; + delete [] authBuffer; + } + + typedef std::vector StreamInfoVector; + + //-------------------------------------------------------------------------- + // Data + //-------------------------------------------------------------------------- + uint32_t serverFlags; + uint32_t protocolVersion; + uint8_t sessionId[16]; + uint8_t oldSessionId[16]; + bool firstLogIn; + SIDManager *sidManager; + char *authBuffer; + XrdSecProtocol *authProtocol; + XrdSecParameters *authParams; + XrdOucEnv *authEnv; + StreamInfoVector stream; + std::string streamName; + std::string authProtocolName; + std::set sentOpens; + std::set sentCloses; + uint32_t openFiles; + time_t waitBarrier; + XrdSecProtect *protection; + XrdSecProtocol *signprot; + XrdSysMutex mutex; + }; + +}; + +#endif /* SRC_XRDCL_XRDCLXROOTDCHANNELINFO_HH_ */