Logo ROOT   6.12/07
Reference Guide
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 #ifdef __CINT__
8 #define __attribute__(x)
9 #endif
10 
11 #include "XProtocol/XProtocol.hh"
12 
13 #define XPD_DEF_PORT 1093
14 
15 // KINDS of SERVERS
16 //
17 //
18 #define kXP_MasterServer 1
19 #define kXR_SlaveServer 0
20 
21 //______________________________________________
22 // XPROOFD PROTOCOL DEFINITION: CLIENT'S REQUESTS TYPES
23 //
24 // These are used by TXProofMgr to interact with its image on
25 // the server side and the sessions
26 // Changes should be propagated to the related strings
27 // for notification in XrdProofdAux::ProofRequestTypes(...) and
28 // in XProofProtUtils.cxx
29 //______________________________________________
30 //
32  kXP_login = 3101, // client login
33  kXP_auth = 3102, // credentials to login
34  kXP_create = 3103, // create a new session-ctx
35  kXP_destroy = 3104, // destroy a session-ctx
36  kXP_attach = 3105, // attach to an existing session-ctx
37  kXP_detach = 3106, // detach from an existing session-ctx
38  kXP_urgent = 3111, // urgent msg for a processing session (e.g. stop/abort)
39  kXP_sendmsg = 3112, // send a msg to a session-ctx
40  kXP_admin = 3113, // admin request handled by the coordinator (not forwarded)
41  kXP_interrupt = 3114, // urgent message
42  kXP_ping = 3115, // ping request
43  kXP_cleanup = 3116, // clean-up a session-ctx or a client section
44  kXP_readbuf = 3117, // read a buffer from a file
45  kXP_touch = 3118, // touch the client admin path
46  kXP_ctrlc = 3119, // propagate a Ctrl-C issued by the client
47  kXP_direct = 3120, // direct data connection
48 //
49  kXP_Undef = 3121 // This should always be last: just increment
50 };
51 
52 // XPROOFD VERSION (0xMMmmpp : MM major, mm minor, pp patch)
53 #define XPD_VERSION 0x010600
54 
55 // KINDS of connections (modes)
56 #define kXPD_Admin 4
57 #define kXPD_Internal 3
58 #define kXPD_ClientMaster 2
59 #define kXPD_MasterMaster 1
60 #define kXPD_MasterWorker 0
61 #define kXPD_AnyConnect -1
62 
63 // KINDS of servers
64 #define kXPD_TopMaster 2
65 #define kXPD_Master 1
66 #define kXPD_Worker 0
67 #define kXPD_AnyServer -1
68 
69 // Operations modes
70 #define kXPD_OpModeOpen 0
71 #define kXPD_OpModeControlled 1
72 
73 // Type of resources
75  kRTNone = -1,
76  kRTStatic = 0,
78 };
79 
80 // Worker selection options
85 };
86 
87 // Message types used in SendCoordinator(...)
88 // Must be consistent with the names in XrdProofdAux.cxx
91  kSessionTag = 1001,
92  kSessionAlias = 1002,
93  kGetWorkers = 1003,
94  kQueryWorkers = 1004,
97  kReadBuffer = 1007,
99  kROOTVersion = 1009,
103  kExec = 1013,
104  kGetFile = 1014,
105  kPutFile = 1015,
106  kCpFile = 1016,
107  kQueryMssUrl = 1017,
108 //
109  kUndef = 1018 // This should always be last: do not touch it
110 };
111 
112 // Exec types
114  kRm = 0,
115  kLs = 1,
116  kMore = 2,
117  kGrep = 3,
118  kTail = 4,
119  kMd5sum = 5,
120  kStat = 6,
121  kFind = 7
122 };
123 
124 // XPROOFD Worker CPU load sharing options
127  kXPD_sched_local = 1, // Priorities defined in a local file on the worker
128  kXPD_sched_central = 2 // Priorities communicated by the master
129 };
130 
131 // XPROOFD SERVER STATUS
138 };
139 
140 // XPROOFD MESSAGE TYPE
141 #define kXPD_internal 0x1
142 #define kXPD_async 0x2
143 #define kXPD_startprocess 0x4
144 #define kXPD_setidle 0x8
145 #define kXPD_fb_prog 0x10
146 #define kXPD_logmsg 0x20
147 #define kXPD_querynum 0x40
148 #define kXPD_process 0x80
149 
150 // Special GetWorkers reply tags
151 const char* const XPD_GW_Failed = "|failed|";
152 const char* const XPD_GW_QueryEnqueued = "|enqueued|";
153 const char* const XPD_GW_Static = "static:";
154 
155 //_______________________________________________
156 // PROTOCOL DEFINITION: SERVER'S RESPONSES TYPES
157 //_______________________________________________
158 //
160  kXP_ok = 0,
161  kXP_oksofar = 4100,
162  kXP_attn, // 4101
163  kXP_authmore, // 4102
164  kXP_error, // 4103
165  kXP_wait // 4104
166 };
167 
168 //_______________________________________________
169 // PROTOCOL DEFINITION: SERVER"S ATTN CODES
170 //_______________________________________________
172  kXPD_msg = 5100, // Generic message from server
173  kXPD_ping, // 5101 // Ping request
174  kXPD_interrupt, // 5102 // Interrupt request
175  kXPD_feedback, // 5103 // Feedback message
176  kXPD_srvmsg, // 5104 // Log string from server
177  kXPD_msgsid, // 5105 // Generic message from server with ID
178  kXPD_errmsg, // 5106 // Error message from server with log string
179  kXPD_timer, // 5107 // Server request to start a timer for delayed termination
180  kXPD_urgent, // 5108 // Urgent message to be processed in the reader thread
181  kXPD_flush, // 5109 // Server request to flush stdout (before retrieving logs)
182  kXPD_inflate, // 5110 // Server request to inflate processing times
183  kXPD_priority, // 5111 // Server request to propagate a group priority
184  kXPD_wrkmortem, // 5112 // A worker just died or terminated
185  kXPD_touch, // 5113 // Touch the connection and schedule an asynchronous remote touch
186  kXPD_resume, // 5114 // process the next query (to be sent to TXSocket in TXProofServ)
187  kXPD_clusterinfo // 5115 // Information about running sessions
188 };
189 
190 //_______________________________________________
191 // PROTOCOL DEFINITION: QUERY STATUS
192 //_______________________________________________
193 //
196  kXP_done, // 1
199 };
200 
201 //_______________________________________________
202 // PROTOCOL DEFINITION: SERVER'S ERROR CODES
203 //_______________________________________________
204 //
207  kXP_ArgMissing, // 3101
208  kXP_ArgTooLong, // 3102
210  kXP_IOError, // 3104
211  kXP_NoMemory, // 3105
212  kXP_NoSpace, // 3106
214  kXP_NotFound, // 3108
217  kXP_noserver, // 3111
218  kXP_nosession, // 3112
219  kXP_nomanager, // 3113
222 };
223 
224 
225 //______________________________________________
226 // PROTOCOL DEFINITION: CLIENT'S REQUESTS STRUCTS
227 //______________________________________________
228 //
229 // We need to pack structures sent all over the net!
230 // __attribute__((packed)) assures no padding bytes.
231 //
232 // Nice bodies of the headers for the client requests.
233 // Note that the protocol specifies these values to be in network
234 // byte order when sent
235 //
236 // G.Ganis: use of flat structures to avoid packing options
237 
239  kXR_char streamid[2];
240  kXR_unt16 requestid;
241  kXR_int32 sid;
242  kXR_int32 int1;
243  kXR_int32 int2;
244  kXR_int32 int3;
245  kXR_int32 dlen;
246 };
247 
249  kXR_char streamid[2];
250  kXR_unt16 requestid;
251  kXR_int32 len;
252  kXR_int64 ofs;
253  kXR_int32 int1;
254  kXR_int32 dlen;
255 };
256 
258  kXR_char streamid[2];
259  kXR_unt16 requestid;
260  kXR_int32 sid;
261  kXR_int32 opt;
262  kXR_int32 cid;
263  kXR_char reserved[4];
264  kXR_int32 dlen;
265 };
266 
268  kXR_char streamid[2];
269  kXR_unt16 requestid;
270  kXR_int32 sid;
271  kXR_int32 opt;
272  kXR_char reserved[8];
273  kXR_int32 dlen;
274 };
275 
277  kXR_char streamid[2];
278  kXR_unt16 requestid;
279  kXR_int32 sid;
280  kXR_int32 type;
281  kXR_char reserved[8];
282  kXR_int32 dlen;
283 };
284 
286  kXR_char streamid[2];
287  kXR_unt16 requestid;
288  kXR_int32 pid;
289  kXR_char username[8];
290  kXR_char reserved[2];
291  kXR_char capver[1];
292  kXR_char role[1];
293  kXR_int32 dlen;
294 };
295 
296 typedef union {
297  struct XPClientLoginRequest login;
298  struct ClientAuthRequest auth;
299  struct XPClientProofRequest proof;
300  struct XPClientReadbufRequest readbuf;
301  struct XPClientSendRcvRequest sendrcv;
302  struct XPClientArchiveRequest archive;
303  struct XPClientInterruptRequest interrupt;
304  struct ClientRequestHdr header;
306 
307 // Server structures and codes are identical to the one in XProtocol.hh, for
308 // the time being
309 
310 #endif
XProofRequestTypes
EAdminExecType
const char *const XPD_GW_QueryEnqueued
XProofResponseType
EAdminMsgType
XProofSchedOpts
EResourceType
XProofSessionStatus
XProofQueryStatus
EStaticSelOpt
XProofActionCode
const char *const XPD_GW_Failed
const char *const XPD_GW_Static
XPErrorCode