12#ifndef ROOT_XrdProofdProtocol
13#define ROOT_XrdProofdProtocol
35#define XPROOFD_VERSBIN 0x000003EF
36#define XPROOFD_VERSION "0.7"
40#include "Xrd/XrdLink.hh"
41#include "Xrd/XrdProtocol.hh"
42#include "XrdOuc/XrdOucString.hh"
43#include "XrdSec/XrdSecInterface.hh"
63 void Recycle(XrdLink *lp,
int x,
const char *
y);
64 int Stats(
char *buff,
int blen,
int do_sync);
66 static int Configure(
char *parms, XrdProtocol_Config *
pi);
69 int GetData(
const char *dtype,
char *buff,
int blen);
70 static XrdBuffer *
GetBuff(
int quantum, XrdBuffer *argp = 0);
75 inline kXR_int32
CID()
const {
return fCID; }
193 static void PostSession(
int on,
const char *u,
const char *
g,
197#define XPD_SETRESP(p, x) \
199 memcpy((void *)&rid, (const void *)&(p->Request()->header.streamid[0]), 2); \
200 XrdProofdResponse *response = p->Response(rid); \
202 TRACEP(p, XERR, x << ": could not get Response instance for requid:"<< rid); \
206#define XPD_SETRESPV(p, x) \
208 memcpy((void *)&rid, (const void *)&(p->Request()->header.streamid[0]), 2); \
209 XrdProofdResponse *response = p->Response(rid); \
211 TRACEP(p, XERR, x << ": could not get Response instance for requid:"<< rid); \
215#define XPD_CLNT_VERSION_OK(p,v) (v < 0 || (p && p->ProofProtocol() >= v))
#define XrdSysMutexHelper
static int Configure(char *parms, XrdProtocol_Config *pi)
Protocol configuration tool Function: Establish configuration at load time.
void Recycle(XrdLink *lp, int x, const char *y)
Recycle call. Release the instance and give it back to the stack.
int SendMsg()
Handle a request to forward a message to another process.
const char * GroupIn() const
int SendData(XrdProofdProofServ *xps, kXR_int32 sid=-1, XrdSrvBuffer **buf=0, bool sb=0)
Send data over the open link. Segmentation is done here, if required.
XrdProofdResponse * Response(kXR_unt16 rid)
Get response instance corresponding to stream ID 'sid'.
XrdProofdResponse * GetNewResponse(kXR_unt16 rid)
Create new response instance for stream ID 'sid'.
static XrdSysRecMutex fgBMutex
static void PostSession(int on, const char *u, const char *g, XrdProofdProofServ *xps)
Post change of session status.
static XrdSysError fgEDest
short int ProofProtocol() const
XrdProofdClient * fPClient
void SetSuperUser(bool su=1)
void SetUserIn(const char *uin)
int SendDataN(XrdProofdProofServ *xps, XrdSrvBuffer **buf=0, bool sb=0)
Send data over the open client links of session 'xps'.
static int EUidAtStartup()
static XpdObjectQ fgProtStack
XrdProtocol * Match(XrdLink *lp)
Check whether the request matches this protocol.
XrdProofdProtocol(XrdProtocol_Config *pi=0)
Protocol constructor.
static XrdProofdManager * fgMgr
XrdProofdClient * Client() const
void SetClient(XrdProofdClient *c)
int Process2()
Local processing method: here the request is dispatched to the appropriate method.
void SetGroupIn(const char *gin)
int CtrlC()
Set and propagate a Ctrl-C request.
void SetAuthProt(XrdSecProtocol *p)
int Stats(char *buff, int blen, int do_sync)
Return statistics info about the protocol.
XrdSecProtocol * AuthProt() const
static XrdBuffManager * fgBPool
void SetProofProtocol(short int pp)
const char * UserIn() const
std::vector< XrdProofdResponse * > fResponses
XrdSysRecMutex fCtrlcMutex
static XrdProofdManager * Mgr()
XrdSecProtocol * fAuthProt
void Reset()
Reset static and local vars.
int Process(XrdLink *lp)
Process the information received on the active link.
virtual ~XrdProofdProtocol()
static XrdSysLogger * fgLogger
int Interrupt()
Handle an interrupt request.
static XrdBuffer * GetBuff(int quantum, XrdBuffer *argp=0)
Allocate a buffer to handle quantum bytes; if argp points to an existing buffer, its size is checked ...
XPClientRequest * Request() const
void TouchAdminPath()
Recording time of the last request on this instance.
int Urgent()
Handle generic request of a urgent message to be forwarded to the server.
static int fgEUidAtStartup
const char * TraceID() const
XrdSecEntity * fSecClient
void SetAuthEntity(XrdSecEntity *se=0)
void SetAdminPath(const char *p)
unsigned char fClntCapVer
void SetClntCapVer(unsigned char c)
void SetCID(kXR_int32 cid)
int GetData(const char *dtype, char *buff, int blen)
Get data from the open link.
static void ReleaseBuff(XrdBuffer *argp)
Release a buffer previously allocated via GetBuff.
int Ping()
Handle a ping request.
static constexpr double s
static constexpr double pi