XProofProtocol.h

Go to the documentation of this file.
00001 // @(#)root/proofd:$Id: XProofProtocol.h 30858 2009-10-24 14:19:05Z ganis $
00002 // Author: G. Ganis  June 2005
00003 
00004 #ifndef ROOT_XProofProtocol
00005 #define ROOT_XProofProtocol
00006 
00007 #ifdef __CINT__
00008 #define __attribute__(x)
00009 #endif
00010 
00011 #include "XProtocol/XProtocol.hh"
00012 
00013 #define XPD_DEF_PORT 1093
00014 
00015 // KINDS of SERVERS
00016 //
00017 //
00018 #define kXP_MasterServer 1
00019 #define kXR_SlaveServer 0
00020 
00021 //______________________________________________
00022 // XPROOFD PROTOCOL DEFINITION: CLIENT'S REQUESTS TYPES
00023 //
00024 // These are used by TXProofMgr to interact with its image on
00025 // the server side and the sessions
00026 // Changes should be propagated to the related strings
00027 // for notification in XrdProofdAux::ProofRequestTypes(...) and
00028 // in XProofProtUtils.cxx
00029 //______________________________________________
00030 //
00031 enum XProofRequestTypes {
00032    kXP_login        = 3101,    // client login
00033    kXP_auth         = 3102,    // credentials to login
00034    kXP_create       = 3103,    // create a new session-ctx
00035    kXP_destroy      = 3104,    // destroy a session-ctx
00036    kXP_attach       = 3105,    // attach to an existing session-ctx
00037    kXP_detach       = 3106,    // detach from an existing session-ctx
00038    kXP_urgent       = 3111,    // urgent msg for a processing session (e.g. stop/abort)
00039    kXP_sendmsg      = 3112,    // send a msg to a session-ctx
00040    kXP_admin        = 3113,    // admin request handled by the coordinator (not forwarded)
00041    kXP_interrupt    = 3114,    // urgent message
00042    kXP_ping         = 3115,    // ping request
00043    kXP_cleanup      = 3116,    // clean-up a session-ctx or a client section
00044    kXP_readbuf      = 3117,    // read a buffer from a file
00045    kXP_touch        = 3118,    // touch the client admin path
00046    kXP_ctrlc        = 3119,    // propagate a Ctrl-C issued by the client 
00047 //
00048    kXP_Undef        = 3120     // This should always be last: do not touch it
00049 };
00050 
00051 // XPROOFD VERSION  (0xMMmmpp : MM major, mm minor, pp patch)
00052 #define XPD_VERSION  0x010600
00053 
00054 // KINDS of connections (modes)
00055 #define kXPD_Admin        4
00056 #define kXPD_Internal     3
00057 #define kXPD_ClientMaster 2
00058 #define kXPD_MasterMaster 1
00059 #define kXPD_MasterWorker 0
00060 #define kXPD_AnyConnect  -1
00061 
00062 // KINDS of servers
00063 #define kXPD_TopMaster    2
00064 #define kXPD_Master       1
00065 #define kXPD_Worker       0
00066 #define kXPD_AnyServer   -1
00067 
00068 // Operations modes
00069 #define kXPD_OpModeOpen       0
00070 #define kXPD_OpModeControlled 1
00071 
00072 // Type of resources
00073 enum EResourceType {
00074    kRTNone    = -1,
00075    kRTStatic  = 0,
00076    kRTDynamic = 1
00077 };
00078 
00079 // Worker selection options
00080 enum EStaticSelOpt {
00081    kSSORoundRobin = 0,
00082    kSSORandom     = 1,
00083    kSSOLoadBased  = 2
00084 };
00085 
00086 // Message types used in SendCoordinator(...)
00087 // Must be consistent with the names in XrdProofdAux.cxx
00088 enum EAdminMsgType {
00089    kQuerySessions     = 1000,
00090    kSessionTag        = 1001,
00091    kSessionAlias      = 1002,
00092    kGetWorkers        = 1003,
00093    kQueryWorkers      = 1004,
00094    kCleanupSessions   = 1005,
00095    kQueryLogPaths     = 1006,
00096    kReadBuffer        = 1007,
00097    kQueryROOTVersions = 1008,
00098    kROOTVersion       = 1009,
00099    kGroupProperties   = 1010,
00100    kSendMsgToUser     = 1011,
00101    kReleaseWorker     = 1012,
00102    kExec              = 1013,
00103    kGetFile           = 1014,
00104    kPutFile           = 1015,
00105    kCpFile            = 1016,
00106 //
00107    kUndef             = 1017    // This should always be last: do not touch it
00108 };
00109 
00110 // Exec types
00111 enum EAdminExecType {
00112    kRm                = 0,
00113    kLs                = 1,
00114    kMore              = 2,
00115    kGrep              = 3,
00116    kTail              = 4,
00117    kMd5sum            = 5,
00118    kStat              = 6,
00119    kFind              = 7
00120 };
00121 
00122 // XPROOFD Worker CPU load sharing options
00123 enum XProofSchedOpts {
00124    kXPD_sched_off = 0,
00125    kXPD_sched_local = 1,     // Priorities defined in a local file on the worker
00126    kXPD_sched_central = 2    // Priorities communicated by the master
00127 };
00128 
00129 // XPROOFD SERVER STATUS
00130 enum XProofSessionStatus {
00131    kXPD_idle            = 0,
00132    kXPD_running         = 1,
00133    kXPD_shutdown        = 2,
00134    kXPD_enqueued        = 3,
00135    kXPD_unknown         = 4
00136 };
00137 
00138 // XPROOFD MESSAGE TYPE
00139 #define kXPD_internal     0x1
00140 #define kXPD_async        0x2
00141 #define kXPD_startprocess 0x4
00142 #define kXPD_setidle      0x8
00143 #define kXPD_fb_prog      0x10
00144 #define kXPD_logmsg       0x20
00145 #define kXPD_querynum     0x40
00146 #define kXPD_process      0x80
00147 
00148 // Special GetWorkers reply tags
00149 const char* const XPD_GW_Failed        = "|failed|";
00150 const char* const XPD_GW_QueryEnqueued = "|enqueued|";
00151 const char* const XPD_GW_Static        = "static:";
00152 
00153 //_______________________________________________
00154 // PROTOCOL DEFINITION: SERVER'S RESPONSES TYPES
00155 //_______________________________________________
00156 //
00157 enum XProofResponseType {
00158    kXP_ok            = 0,
00159    kXP_oksofar       = 4100,
00160    kXP_attn,        // 4101
00161    kXP_authmore,    // 4102
00162    kXP_error,       // 4103
00163    kXP_wait         // 4104
00164 };
00165 
00166 //_______________________________________________
00167 // PROTOCOL DEFINITION: SERVER"S ATTN CODES
00168 //_______________________________________________
00169 enum XProofActionCode {
00170    kXPD_msg         = 5100,    // Generic message from server
00171    kXPD_ping,      // 5101     // Ping request
00172    kXPD_interrupt, // 5102     // Interrupt request
00173    kXPD_feedback,  // 5103     // Feedback message
00174    kXPD_srvmsg,    // 5104     // Log string from server
00175    kXPD_msgsid,    // 5105     // Generic message from server with ID
00176    kXPD_errmsg,    // 5106     // Error message from server with log string
00177    kXPD_timer,     // 5107     // Server request to start a timer for delayed termination
00178    kXPD_urgent,    // 5108     // Urgent message to be processed in the reader thread
00179    kXPD_flush,     // 5109     // Server request to flush stdout (before retrieving logs)
00180    kXPD_inflate,   // 5110     // Server request to inflate processing times
00181    kXPD_priority,  // 5111     // Server request to propagate a group priority
00182    kXPD_wrkmortem, // 5112     // A worker just died or terminated
00183    kXPD_touch,     // 5113     // Touch the connection and schedule an asynchronous remote touch
00184    kXPD_resume,     // 5114    // process the next query (to be sent to TXSocket in TXProofServ)
00185    kXPD_clusterinfo // 5115    // Information about running sessions
00186 };
00187 
00188 //_______________________________________________
00189 // PROTOCOL DEFINITION: QUERY STATUS
00190 //_______________________________________________
00191 //
00192 enum XProofQueryStatus {
00193    kXP_pending       = 0,
00194    kXP_done,        // 1
00195    kXP_processing,  // 2
00196    kXP_aborted      // 3
00197 };
00198 
00199 //_______________________________________________
00200 // PROTOCOL DEFINITION: SERVER'S ERROR CODES
00201 //_______________________________________________
00202 //
00203 enum XPErrorCode {
00204    kXP_ArgInvalid         = 3100,
00205    kXP_ArgMissing,       // 3101
00206    kXP_ArgTooLong,       // 3102
00207    kXP_InvalidRequest,   // 3103
00208    kXP_IOError,          // 3104
00209    kXP_NoMemory,         // 3105
00210    kXP_NoSpace,          // 3106
00211    kXP_NotAuthorized,    // 3107
00212    kXP_NotFound,         // 3108
00213    kXP_ServerError,      // 3109
00214    kXP_Unsupported,      // 3110
00215    kXP_noserver,         // 3111
00216    kXP_nosession,        // 3112
00217    kXP_nomanager,        // 3113
00218    kXP_reconnecting,     // 3114
00219    kXP_TooManySess       // 3115
00220 };
00221 
00222 
00223 //______________________________________________
00224 // PROTOCOL DEFINITION: CLIENT'S REQUESTS STRUCTS
00225 //______________________________________________
00226 //
00227 // We need to pack structures sent all over the net!
00228 // __attribute__((packed)) assures no padding bytes.
00229 //
00230 // Nice bodies of the headers for the client requests.
00231 // Note that the protocol specifies these values to be in network
00232 //  byte order when sent
00233 //
00234 // G.Ganis: use of flat structures to avoid packing options
00235 
00236 struct XPClientProofRequest {
00237    kXR_char  streamid[2];
00238    kXR_unt16 requestid;
00239    kXR_int32 sid;
00240    kXR_int32 int1;
00241    kXR_int32 int2;
00242    kXR_int32 int3;
00243    kXR_int32 dlen;
00244 };
00245 
00246 struct XPClientReadbufRequest {
00247    kXR_char  streamid[2];
00248    kXR_unt16 requestid;
00249    kXR_int32 len;
00250    kXR_int64 ofs;
00251    kXR_int32 int1;
00252    kXR_int32 dlen;
00253 };
00254 
00255 struct XPClientSendRcvRequest {
00256    kXR_char  streamid[2];
00257    kXR_unt16 requestid;
00258    kXR_int32 sid;
00259    kXR_int32 opt;
00260    kXR_int32 cid;
00261    kXR_char  reserved[4];
00262    kXR_int32 dlen;
00263 };
00264 
00265 struct XPClientArchiveRequest {
00266    kXR_char  streamid[2];
00267    kXR_unt16 requestid;
00268    kXR_int32 sid;
00269    kXR_int32 opt;
00270    kXR_char  reserved[8];
00271    kXR_int32 dlen;
00272 };
00273 
00274 struct XPClientInterruptRequest {
00275    kXR_char  streamid[2];
00276    kXR_unt16 requestid;
00277    kXR_int32 sid;
00278    kXR_int32 type;
00279    kXR_char  reserved[8];
00280    kXR_int32 dlen;
00281 };
00282 
00283 typedef union {
00284    struct ClientLoginRequest login;
00285    struct ClientAuthRequest auth;
00286    struct XPClientProofRequest proof;
00287    struct XPClientReadbufRequest readbuf;
00288    struct XPClientSendRcvRequest sendrcv;
00289    struct XPClientArchiveRequest archive;
00290    struct XPClientInterruptRequest interrupt;
00291    struct ClientRequestHdr header;
00292 } XPClientRequest;
00293 
00294 // Server structures and codes are identical to the one in XProtocol.hh, for
00295 // the time being
00296 
00297 #endif

Generated on Tue Jul 5 14:51:42 2011 for ROOT_528-00b_version by  doxygen 1.5.1