Whamcloud - gitweb
LUDOC-296 protocol: Rearrange presentation to be more top-down
[doc/protocol.git] / struct_ptlrpc_body.txt
similarity index 99%
rename from ptlrpc_body.txt
rename to struct_ptlrpc_body.txt
index f8585f5..e1146ad 100644 (file)
@@ -9,6 +9,8 @@ relevant to every RPC type. In particular, the RPC type is itself
 encoded in the 'pb_opc' Lustre operation number. The value of that
 opcode, as well as whether it is an RPC 'request' or 'reply',
 determines what else will be in the message following the preamble.
+
+[source,c]
 ----
 #define PTLRPC_NUM_VERSIONS     4
 #define JOBSTATS_JOBID_SIZE     32
@@ -35,6 +37,8 @@ struct ptlrpc_body {
 };
 ----
 
+include::struct_lustre_handle.txt[]
+
 In a connection request, sent by a client to a server and regarding a
 specific target, the 'pb_handle' is 0. In the reply to a connection
 request, sent by the target, the handle is a value uniquely
@@ -49,6 +53,8 @@ initiated, it is PTL_RPC_MSG_REPLY in a reply, and it is
 PTL_RPC_MSG_ERR in a reply to convey that a message was received that
 could not be interpreted, that is, if it was corrupt or
 incomplete. The encoding of those type values is given by:
+
+[source,c]
 ----
 #define PTL_RPC_MSG_REQUEST 4711
 #define PTL_RPC_MSG_ERR     4712
@@ -136,6 +142,8 @@ derived from the following constants. The lower two bytes give the
 version of PtlRPC being employed in the message, and the upper two
 bytes encode the role of the host for the service being
 requested. That role is one of OBD, MDS, OST, DLM, LOG, or MGS.
+
+[source,c]
 ----
 #define PTLRPC_MSG_VERSION  0x00000003
 #define LUSTRE_VERSION_MASK 0xffff0000
@@ -151,6 +159,8 @@ The 'pb_opc' value (operation code) gives the actual Lustre operation
 that is the subject of this message. For example, MDS_CONNECT is a
 Lustre operation (number 38). The following list gives the name used
 and the value for each operation.
+
+[source,c]
 ----
 typedef enum {
     OST_REPLY                       =  0,
@@ -298,6 +308,8 @@ The 'pb_flags' value governs the client state machine. Fixme: document
 what the states and transitions are of this state machine. Currently,
 only the bottom two bytes are used, and they encode state according to
 the following values:
+
+[source,c]
 ----
 #define MSG_GEN_FLAG_MASK     0x0000ffff
 #define MSG_LAST_REPLAY           0x0001
@@ -335,6 +347,7 @@ are currently only used by the *_CONNECT RPCs.The 'pb_op_flags' value
 for connect operations governs the client connection status state
 machine.
 
+[source,c]
 ----
 #define MSG_CONNECT_RECOVERING  0x00000001
 #define MSG_CONNECT_RECONNECT   0x00000002