ROOT
6.12/07
Reference Guide
proof
proofd
inc
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
//
31
enum
XProofRequestTypes
{
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
74
enum
EResourceType
{
75
kRTNone
= -1,
76
kRTStatic
= 0,
77
kRTDynamic
= 1
78
};
79
80
// Worker selection options
81
enum
EStaticSelOpt
{
82
kSSORoundRobin
= 0,
83
kSSORandom
= 1,
84
kSSOLoadBased
= 2
85
};
86
87
// Message types used in SendCoordinator(...)
88
// Must be consistent with the names in XrdProofdAux.cxx
89
enum
EAdminMsgType
{
90
kQuerySessions
= 1000,
91
kSessionTag
= 1001,
92
kSessionAlias
= 1002,
93
kGetWorkers
= 1003,
94
kQueryWorkers
= 1004,
95
kCleanupSessions
= 1005,
96
kQueryLogPaths
= 1006,
97
kReadBuffer
= 1007,
98
kQueryROOTVersions
= 1008,
99
kROOTVersion
= 1009,
100
kGroupProperties
= 1010,
101
kSendMsgToUser
= 1011,
102
kReleaseWorker
= 1012,
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
113
enum
EAdminExecType
{
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
125
enum
XProofSchedOpts
{
126
kXPD_sched_off
= 0,
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
132
enum
XProofSessionStatus
{
133
kXPD_idle
= 0,
134
kXPD_running
= 1,
135
kXPD_shutdown
= 2,
136
kXPD_enqueued
= 3,
137
kXPD_unknown
= 4
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
//
159
enum
XProofResponseType
{
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
//_______________________________________________
171
enum
XProofActionCode
{
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
//
194
enum
XProofQueryStatus
{
195
kXP_pending
= 0,
196
kXP_done
,
// 1
197
kXP_processing
,
// 2
198
kXP_aborted
// 3
199
};
200
201
//_______________________________________________
202
// PROTOCOL DEFINITION: SERVER'S ERROR CODES
203
//_______________________________________________
204
//
205
enum
XPErrorCode
{
206
kXP_ArgInvalid
= 3100,
207
kXP_ArgMissing
,
// 3101
208
kXP_ArgTooLong
,
// 3102
209
kXP_InvalidRequest
,
// 3103
210
kXP_IOError
,
// 3104
211
kXP_NoMemory
,
// 3105
212
kXP_NoSpace
,
// 3106
213
kXP_NotAuthorized
,
// 3107
214
kXP_NotFound
,
// 3108
215
kXP_ServerError
,
// 3109
216
kXP_Unsupported
,
// 3110
217
kXP_noserver
,
// 3111
218
kXP_nosession
,
// 3112
219
kXP_nomanager
,
// 3113
220
kXP_reconnecting
,
// 3114
221
kXP_TooManySess
// 3115
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
238
struct
XPClientProofRequest
{
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
248
struct
XPClientReadbufRequest
{
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
257
struct
XPClientSendRcvRequest
{
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
267
struct
XPClientArchiveRequest
{
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
276
struct
XPClientInterruptRequest
{
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
285
struct
XPClientLoginRequest
{
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;
305
}
XPClientRequest
;
306
307
// Server structures and codes are identical to the one in XProtocol.hh, for
308
// the time being
309
310
#endif
kXPD_sched_central
Definition:
XProofProtocol.h:128
kXP_nosession
Definition:
XProofProtocol.h:218
kReleaseWorker
Definition:
XProofProtocol.h:102
kXPD_errmsg
Definition:
XProofProtocol.h:178
XPClientProofRequest::int2
kXR_int32 int2
Definition:
XProofProtocol.h:243
kXP_nomanager
Definition:
XProofProtocol.h:219
kXP_detach
Definition:
XProofProtocol.h:37
kXPD_running
Definition:
XProofProtocol.h:134
kXP_urgent
Definition:
XProofProtocol.h:38
XPClientSendRcvRequest::dlen
kXR_int32 dlen
Definition:
XProofProtocol.h:264
kGrep
Definition:
XProofProtocol.h:117
XProofRequestTypes
XProofRequestTypes
Definition:
XProofProtocol.h:31
kXP_interrupt
Definition:
XProofProtocol.h:41
kSendMsgToUser
Definition:
XProofProtocol.h:101
kXP_attach
Definition:
XProofProtocol.h:36
kXP_create
Definition:
XProofProtocol.h:34
kXPD_interrupt
Definition:
XProofProtocol.h:174
kXP_TooManySess
Definition:
XProofProtocol.h:221
XPClientProofRequest::int3
kXR_int32 int3
Definition:
XProofProtocol.h:244
kXP_InvalidRequest
Definition:
XProofProtocol.h:209
XPClientLoginRequest::pid
kXR_int32 pid
Definition:
XProofProtocol.h:288
kXPD_ping
Definition:
XProofProtocol.h:173
XPClientReadbufRequest::len
kXR_int32 len
Definition:
XProofProtocol.h:251
kStat
Definition:
XProofProtocol.h:120
kXP_reconnecting
Definition:
XProofProtocol.h:220
kXPD_enqueued
Definition:
XProofProtocol.h:136
EAdminExecType
EAdminExecType
Definition:
XProofProtocol.h:113
kXP_pending
Definition:
XProofProtocol.h:195
kXPD_priority
Definition:
XProofProtocol.h:183
kXPD_feedback
Definition:
XProofProtocol.h:175
XPD_GW_QueryEnqueued
const char *const XPD_GW_QueryEnqueued
Definition:
XProofProtocol.h:152
kXPD_timer
Definition:
XProofProtocol.h:179
XPClientProofRequest::requestid
kXR_unt16 requestid
Definition:
XProofProtocol.h:240
XProofResponseType
XProofResponseType
Definition:
XProofProtocol.h:159
XPClientRequest
Definition:
XProofProtocol.h:296
kXPD_clusterinfo
Definition:
XProofProtocol.h:187
kExec
Definition:
XProofProtocol.h:103
XPClientReadbufRequest::ofs
kXR_int64 ofs
Definition:
XProofProtocol.h:252
kXPD_wrkmortem
Definition:
XProofProtocol.h:184
XPClientProofRequest
Definition:
XProofProtocol.h:238
XPClientLoginRequest::dlen
kXR_int32 dlen
Definition:
XProofProtocol.h:293
XPClientSendRcvRequest
Definition:
XProofProtocol.h:257
kGetWorkers
Definition:
XProofProtocol.h:93
kPutFile
Definition:
XProofProtocol.h:105
kXP_authmore
Definition:
XProofProtocol.h:163
kXP_error
Definition:
XProofProtocol.h:164
XPClientArchiveRequest
Definition:
XProofProtocol.h:267
kLs
Definition:
XProofProtocol.h:115
kXP_ArgMissing
Definition:
XProofProtocol.h:207
kXP_NoSpace
Definition:
XProofProtocol.h:212
XPClientReadbufRequest
Definition:
XProofProtocol.h:248
XPClientInterruptRequest::sid
kXR_int32 sid
Definition:
XProofProtocol.h:279
kXPD_urgent
Definition:
XProofProtocol.h:180
XPClientSendRcvRequest::cid
kXR_int32 cid
Definition:
XProofProtocol.h:262
kXP_ping
Definition:
XProofProtocol.h:42
kXPD_shutdown
Definition:
XProofProtocol.h:135
kXP_Unsupported
Definition:
XProofProtocol.h:216
XPClientSendRcvRequest::opt
kXR_int32 opt
Definition:
XProofProtocol.h:261
kRTNone
Definition:
XProofProtocol.h:75
kRTStatic
Definition:
XProofProtocol.h:76
kXP_Undef
Definition:
XProofProtocol.h:49
EAdminMsgType
EAdminMsgType
Definition:
XProofProtocol.h:89
kSSORandom
Definition:
XProofProtocol.h:83
XPClientArchiveRequest::dlen
kXR_int32 dlen
Definition:
XProofProtocol.h:273
kXPD_resume
Definition:
XProofProtocol.h:186
kXP_readbuf
Definition:
XProofProtocol.h:44
kXPD_msg
Definition:
XProofProtocol.h:172
kXP_touch
Definition:
XProofProtocol.h:45
kXP_noserver
Definition:
XProofProtocol.h:217
XProofSchedOpts
XProofSchedOpts
Definition:
XProofProtocol.h:125
XPClientInterruptRequest::dlen
kXR_int32 dlen
Definition:
XProofProtocol.h:282
XPClientReadbufRequest::requestid
kXR_unt16 requestid
Definition:
XProofProtocol.h:250
XPClientInterruptRequest::requestid
kXR_unt16 requestid
Definition:
XProofProtocol.h:278
kXP_destroy
Definition:
XProofProtocol.h:35
XPClientReadbufRequest::int1
kXR_int32 int1
Definition:
XProofProtocol.h:253
kGetFile
Definition:
XProofProtocol.h:104
XPClientSendRcvRequest::requestid
kXR_unt16 requestid
Definition:
XProofProtocol.h:259
EResourceType
EResourceType
Definition:
XProofProtocol.h:74
kQueryLogPaths
Definition:
XProofProtocol.h:96
XPClientProofRequest::int1
kXR_int32 int1
Definition:
XProofProtocol.h:242
kQueryROOTVersions
Definition:
XProofProtocol.h:98
kXP_ArgInvalid
Definition:
XProofProtocol.h:206
kXP_wait
Definition:
XProofProtocol.h:165
XProofSessionStatus
XProofSessionStatus
Definition:
XProofProtocol.h:132
kXP_auth
Definition:
XProofProtocol.h:33
kXPD_inflate
Definition:
XProofProtocol.h:182
kXP_done
Definition:
XProofProtocol.h:196
kXPD_srvmsg
Definition:
XProofProtocol.h:176
kXPD_flush
Definition:
XProofProtocol.h:181
XPClientArchiveRequest::sid
kXR_int32 sid
Definition:
XProofProtocol.h:270
XPClientSendRcvRequest::sid
kXR_int32 sid
Definition:
XProofProtocol.h:260
XPClientLoginRequest::requestid
kXR_unt16 requestid
Definition:
XProofProtocol.h:287
XProofQueryStatus
XProofQueryStatus
Definition:
XProofProtocol.h:194
XPClientArchiveRequest::requestid
kXR_unt16 requestid
Definition:
XProofProtocol.h:269
kXP_sendmsg
Definition:
XProofProtocol.h:39
kXP_aborted
Definition:
XProofProtocol.h:198
kXPD_touch
Definition:
XProofProtocol.h:185
kFind
Definition:
XProofProtocol.h:121
kQueryMssUrl
Definition:
XProofProtocol.h:107
kXPD_sched_off
Definition:
XProofProtocol.h:126
EStaticSelOpt
EStaticSelOpt
Definition:
XProofProtocol.h:81
XPClientProofRequest::dlen
kXR_int32 dlen
Definition:
XProofProtocol.h:245
kRm
Definition:
XProofProtocol.h:114
kSessionTag
Definition:
XProofProtocol.h:91
kTail
Definition:
XProofProtocol.h:118
kQueryWorkers
Definition:
XProofProtocol.h:94
XPClientProofRequest::sid
kXR_int32 sid
Definition:
XProofProtocol.h:241
XPClientArchiveRequest::opt
kXR_int32 opt
Definition:
XProofProtocol.h:271
XProofActionCode
XProofActionCode
Definition:
XProofProtocol.h:171
XPD_GW_Failed
const char *const XPD_GW_Failed
Definition:
XProofProtocol.h:151
kROOTVersion
Definition:
XProofProtocol.h:99
kMore
Definition:
XProofProtocol.h:116
kMd5sum
Definition:
XProofProtocol.h:119
kXP_ArgTooLong
Definition:
XProofProtocol.h:208
kXP_cleanup
Definition:
XProofProtocol.h:43
kXP_direct
Definition:
XProofProtocol.h:47
XPClientReadbufRequest::dlen
kXR_int32 dlen
Definition:
XProofProtocol.h:254
kSessionAlias
Definition:
XProofProtocol.h:92
XPClientLoginRequest
Definition:
XProofProtocol.h:285
kXPD_idle
Definition:
XProofProtocol.h:133
kXP_ok
Definition:
XProofProtocol.h:160
kUndef
Definition:
XProofProtocol.h:109
kXP_admin
Definition:
XProofProtocol.h:40
kXP_oksofar
Definition:
XProofProtocol.h:161
XPD_GW_Static
const char *const XPD_GW_Static
Definition:
XProofProtocol.h:153
XPClientProofRequest::streamid
kXR_char streamid[2]
Definition:
XProofProtocol.h:239
kCpFile
Definition:
XProofProtocol.h:106
XPClientInterruptRequest::type
kXR_int32 type
Definition:
XProofProtocol.h:280
kXP_login
Definition:
XProofProtocol.h:32
kReadBuffer
Definition:
XProofProtocol.h:97
kCleanupSessions
Definition:
XProofProtocol.h:95
XPClientInterruptRequest
Definition:
XProofProtocol.h:276
kXP_NotFound
Definition:
XProofProtocol.h:214
kXP_attn
Definition:
XProofProtocol.h:162
kRTDynamic
Definition:
XProofProtocol.h:77
kXP_NotAuthorized
Definition:
XProofProtocol.h:213
kQuerySessions
Definition:
XProofProtocol.h:90
kSSOLoadBased
Definition:
XProofProtocol.h:84
kXP_NoMemory
Definition:
XProofProtocol.h:211
kXP_ctrlc
Definition:
XProofProtocol.h:46
kXPD_sched_local
Definition:
XProofProtocol.h:127
kXPD_msgsid
Definition:
XProofProtocol.h:177
kXP_ServerError
Definition:
XProofProtocol.h:215
kXP_IOError
Definition:
XProofProtocol.h:210
kSSORoundRobin
Definition:
XProofProtocol.h:82
kXPD_unknown
Definition:
XProofProtocol.h:137
kXP_processing
Definition:
XProofProtocol.h:197
kGroupProperties
Definition:
XProofProtocol.h:100
XPErrorCode
XPErrorCode
Definition:
XProofProtocol.h:205