X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=nfs3%2Fnfs3_prot.h;h=7f759281f4299ed12b3fc4904f65c7080b5b0447;hb=3ec75fa45814e987f77224887350a9f736ed5b92;hp=d5152a119d142134758ffb8e30a1e7acf9f8cfe4;hpb=75cfdd01b043196a7d32c93a84fb540b31c93327;p=bluesky.git diff --git a/nfs3/nfs3_prot.h b/nfs3/nfs3_prot.h index d5152a1..7f75928 100644 --- a/nfs3/nfs3_prot.h +++ b/nfs3/nfs3_prot.h @@ -10,7 +10,6 @@ extern "C" { #endif - typedef u_quad_t uint64; typedef quad_t int64; @@ -639,6 +638,51 @@ struct commit3res { }; typedef struct commit3res commit3res; +/* Structure for tracking a single incoming TCP connection for RPCs. For now, + * used for NFS only. */ +typedef struct { + GIOChannel *channel; + + /* The reassembled message, thus far. */ + GString *msgbuf; + + /* Remaining number of bytes in this message fragment; 0 if we next expect + * another fragment header. */ + uint32_t frag_len; + + /* If frag_len is zero: the number of bytes of the fragment header that + * have been read so far. */ + int frag_hdr_bytes; +} RPCConnection; + +/* Used to track a single outstanding RPC request. Not all of the fields are + * initially filled in, but more are filled in as the request is processed. */ +typedef struct { + /* The corresponding connection on which the request was made. */ + RPCConnection *connection; + + /* Transaction ID of the request, in host byte order. */ + uint32_t xid; + + /* Raw XDR arguments for the call, including headers (everything except the + * fragment headers). Also, the offset to the actual arguments (number of + * bytes making up the headers). */ + GString *raw_args; + size_t raw_args_header_bytes; + + /* Decoded header information. */ + int req_proc; + + /* The XDR-decoded argument of the call, and the procedure to use for + * freeing these arguments. The actual freeing is done automatically when + * the response is sent. */ + void *args; + xdrproc_t xdr_args_free; + + /* Procedure to be used for encoding the eventual return value into XDR. */ + xdrproc_t xdr_result; +} RPCRequest; + #define NFS_PROGRAM 100003 #define NFS_V3 3