Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
XProofProtocol.h
Go to the documentation of this file.
1// @(#)root/proofd:$Id$
2// Author: G. Ganis June 2005
3
4#ifndef ROOT_XProofProtocol
5#define ROOT_XProofProtocol
6
7#include "XProtocol/XProtocol.hh"
8
9#define XPD_DEF_PORT 1093
10
11// KINDS of SERVERS
12//
13//
14#define kXP_MasterServer 1
15#define kXR_SlaveServer 0
16
17//______________________________________________
18// XPROOFD PROTOCOL DEFINITION: CLIENT'S REQUESTS TYPES
19//
20// These are used by TXProofMgr to interact with its image on
21// the server side and the sessions
22// Changes should be propagated to the related strings
23// for notification in XrdProofdAux::ProofRequestTypes(...) and
24// in XProofProtUtils.cxx
25//______________________________________________
26//
28 kXP_login = 3101, // client login
29 kXP_auth = 3102, // credentials to login
30 kXP_create = 3103, // create a new session-ctx
31 kXP_destroy = 3104, // destroy a session-ctx
32 kXP_attach = 3105, // attach to an existing session-ctx
33 kXP_detach = 3106, // detach from an existing session-ctx
34 kXP_urgent = 3111, // urgent msg for a processing session (e.g. stop/abort)
35 kXP_sendmsg = 3112, // send a msg to a session-ctx
36 kXP_admin = 3113, // admin request handled by the coordinator (not forwarded)
37 kXP_interrupt = 3114, // urgent message
38 kXP_ping = 3115, // ping request
39 kXP_cleanup = 3116, // clean-up a session-ctx or a client section
40 kXP_readbuf = 3117, // read a buffer from a file
41 kXP_touch = 3118, // touch the client admin path
42 kXP_ctrlc = 3119, // propagate a Ctrl-C issued by the client
43 kXP_direct = 3120, // direct data connection
44//
45 kXP_Undef = 3121 // This should always be last: just increment
46};
47
48// XPROOFD VERSION (0xMMmmpp : MM major, mm minor, pp patch)
49#define XPD_VERSION 0x010600
50
51// KINDS of connections (modes)
52#define kXPD_Admin 4
53#define kXPD_Internal 3
54#define kXPD_ClientMaster 2
55#define kXPD_MasterMaster 1
56#define kXPD_MasterWorker 0
57#define kXPD_AnyConnect -1
58
59// KINDS of servers
60#define kXPD_TopMaster 2
61#define kXPD_Master 1
62#define kXPD_Worker 0
63#define kXPD_AnyServer -1
64
65// Operations modes
66#define kXPD_OpModeOpen 0
67#define kXPD_OpModeControlled 1
68
69// Type of resources
71 kRTNone = -1,
73 kRTDynamic = 1
74};
75
76// Worker selection options
81};
82
83// Message types used in SendCoordinator(...)
84// Must be consistent with the names in XrdProofdAux.cxx
99 kExec = 1013,
100 kGetFile = 1014,
101 kPutFile = 1015,
102 kCpFile = 1016,
104//
105 kUndef = 1018 // This should always be last: do not touch it
107
108// Exec types
110 kRm = 0,
111 kLs = 1,
112 kMore = 2,
113 kGrep = 3,
114 kTail = 4,
116 kStat = 6,
117 kFind = 7
119
120// XPROOFD Worker CPU load sharing options
123 kXPD_sched_local = 1, // Priorities defined in a local file on the worker
124 kXPD_sched_central = 2 // Priorities communicated by the master
126
127// XPROOFD SERVER STATUS
133 kXPD_unknown = 4
135
136// XPROOFD MESSAGE TYPE
137#define kXPD_internal 0x1
138#define kXPD_async 0x2
139#define kXPD_startprocess 0x4
140#define kXPD_setidle 0x8
141#define kXPD_fb_prog 0x10
142#define kXPD_logmsg 0x20
143#define kXPD_querynum 0x40
144#define kXPD_process 0x80
145
146// Special GetWorkers reply tags
147const char* const XPD_GW_Failed = "|failed|";
148const char* const XPD_GW_QueryEnqueued = "|enqueued|";
149const char* const XPD_GW_Static = "static:";
150
151//_______________________________________________
152// PROTOCOL DEFINITION: SERVER'S RESPONSES TYPES
153//_______________________________________________
154//
158 kXP_attn, // 4101
160 kXP_error, // 4103
161 kXP_wait // 4104
163
164//_______________________________________________
165// PROTOCOL DEFINITION: SERVER"S ATTN CODES
166//_______________________________________________
168 kXPD_msg = 5100, // Generic message from server
169 kXPD_ping, // 5101 // Ping request
170 kXPD_interrupt, // 5102 // Interrupt request
171 kXPD_feedback, // 5103 // Feedback message
172 kXPD_srvmsg, // 5104 // Log string from server
173 kXPD_msgsid, // 5105 // Generic message from server with ID
174 kXPD_errmsg, // 5106 // Error message from server with log string
175 kXPD_timer, // 5107 // Server request to start a timer for delayed termination
176 kXPD_urgent, // 5108 // Urgent message to be processed in the reader thread
177 kXPD_flush, // 5109 // Server request to flush stdout (before retrieving logs)
178 kXPD_inflate, // 5110 // Server request to inflate processing times
179 kXPD_priority, // 5111 // Server request to propagate a group priority
180 kXPD_wrkmortem, // 5112 // A worker just died or terminated
181 kXPD_touch, // 5113 // Touch the connection and schedule an asynchronous remote touch
182 kXPD_resume, // 5114 // process the next query (to be sent to TXSocket in TXProofServ)
183 kXPD_clusterinfo // 5115 // Information about running sessions
185
186//_______________________________________________
187// PROTOCOL DEFINITION: QUERY STATUS
188//_______________________________________________
189//
194 kXP_aborted // 3
196
197//_______________________________________________
198// PROTOCOL DEFINITION: SERVER'S ERROR CODES
199//_______________________________________________
200//
206 kXP_IOError, // 3104
208 kXP_NoSpace, // 3106
217 kXP_TooManySess // 3115
219
220
221//______________________________________________
222// PROTOCOL DEFINITION: CLIENT'S REQUESTS STRUCTS
223//______________________________________________
224//
225// We need to pack structures sent all over the net!
226// __attribute__((packed)) assures no padding bytes.
227//
228// Nice bodies of the headers for the client requests.
229// Note that the protocol specifies these values to be in network
230// byte order when sent
231//
232// G.Ganis: use of flat structures to avoid packing options
233
235 kXR_char streamid[2];
236 kXR_unt16 requestid;
237 kXR_int32 sid;
238 kXR_int32 int1;
239 kXR_int32 int2;
240 kXR_int32 int3;
241 kXR_int32 dlen;
242};
243
245 kXR_char streamid[2];
246 kXR_unt16 requestid;
247 kXR_int32 len;
248 kXR_int64 ofs;
249 kXR_int32 int1;
250 kXR_int32 dlen;
251};
252
254 kXR_char streamid[2];
255 kXR_unt16 requestid;
256 kXR_int32 sid;
257 kXR_int32 opt;
258 kXR_int32 cid;
259 kXR_char reserved[4];
260 kXR_int32 dlen;
261};
262
264 kXR_char streamid[2];
265 kXR_unt16 requestid;
266 kXR_int32 sid;
267 kXR_int32 opt;
268 kXR_char reserved[8];
269 kXR_int32 dlen;
270};
271
273 kXR_char streamid[2];
274 kXR_unt16 requestid;
275 kXR_int32 sid;
276 kXR_int32 type;
277 kXR_char reserved[8];
278 kXR_int32 dlen;
279};
280
282 kXR_char streamid[2];
283 kXR_unt16 requestid;
284 kXR_int32 pid;
285 kXR_char username[8];
286 kXR_char reserved[2];
287 kXR_char capver[1];
288 kXR_char role[1];
289 kXR_int32 dlen;
290};
291
292typedef union {
294 struct ClientAuthRequest auth;
299 struct XPClientInterruptRequest interrupt;
300 struct ClientRequestHdr header;
302
303// Server structures and codes are identical to the one in XProtocol.hh, for
304// the time being
305
306#endif
XProofRequestTypes
@ kXP_create
@ kXP_destroy
@ kXP_cleanup
@ kXP_sendmsg
@ kXP_ping
@ kXP_urgent
@ kXP_touch
@ kXP_direct
@ kXP_detach
@ kXP_attach
@ kXP_interrupt
@ kXP_Undef
@ kXP_readbuf
@ kXP_auth
@ kXP_login
@ kXP_admin
@ kXP_ctrlc
XProofSchedOpts
@ kXPD_sched_central
@ kXPD_sched_off
@ kXPD_sched_local
EStaticSelOpt
@ kSSORandom
@ kSSOLoadBased
@ kSSORoundRobin
XProofSessionStatus
@ kXPD_shutdown
@ kXPD_running
@ kXPD_idle
@ kXPD_unknown
@ kXPD_enqueued
EAdminExecType
@ kTail
@ kFind
@ kMore
@ kMd5sum
@ kGrep
@ kStat
@ kRm
@ kLs
EResourceType
@ kRTStatic
@ kRTNone
@ kRTDynamic
XProofResponseType
@ kXP_wait
@ kXP_ok
@ kXP_authmore
@ kXP_error
@ kXP_oksofar
@ kXP_attn
XPErrorCode
@ kXP_Unsupported
@ kXP_TooManySess
@ kXP_nosession
@ kXP_noserver
@ kXP_ArgTooLong
@ kXP_reconnecting
@ kXP_InvalidRequest
@ kXP_NotAuthorized
@ kXP_ArgInvalid
@ kXP_ArgMissing
@ kXP_NotFound
@ kXP_NoMemory
@ kXP_nomanager
@ kXP_IOError
@ kXP_NoSpace
@ kXP_ServerError
EAdminMsgType
@ kCleanupSessions
@ kPutFile
@ kGroupProperties
@ kExec
@ kQueryLogPaths
@ kCpFile
@ kQuerySessions
@ kSendMsgToUser
@ kROOTVersion
@ kReleaseWorker
@ kSessionAlias
@ kQueryWorkers
@ kGetFile
@ kGetWorkers
@ kQueryMssUrl
@ kQueryROOTVersions
@ kUndef
@ kReadBuffer
@ kSessionTag
const char *const XPD_GW_QueryEnqueued
XProofQueryStatus
@ kXP_processing
@ kXP_pending
@ kXP_aborted
@ kXP_done
XProofActionCode
@ kXPD_flush
@ kXPD_msgsid
@ kXPD_msg
@ kXPD_urgent
@ kXPD_wrkmortem
@ kXPD_feedback
@ kXPD_resume
@ kXPD_clusterinfo
@ kXPD_interrupt
@ kXPD_ping
@ kXPD_touch
@ kXPD_inflate
@ kXPD_timer
@ kXPD_priority
@ kXPD_errmsg
@ kXPD_srvmsg
const char *const XPD_GW_Failed
const char *const XPD_GW_Static