-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[XrdCl] Refactor XRootDChannelInfo out of XRootDTransport.
- Loading branch information
1 parent
0b0f806
commit c8b3067
Showing
1 changed file
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <vector> | ||
#include <string> | ||
#include <set> | ||
#include <stdint.h> | ||
|
||
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<XRootDStreamInfo> 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<uint16_t> sentOpens; | ||
std::set<uint16_t> sentCloses; | ||
uint32_t openFiles; | ||
time_t waitBarrier; | ||
XrdSecProtect *protection; | ||
XrdSecProtocol *signprot; | ||
XrdSysMutex mutex; | ||
}; | ||
|
||
}; | ||
|
||
#endif /* SRC_XRDCL_XRDCLXROOTDCHANNELINFO_HH_ */ |