]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use nd_ types for ONC RPC.
authorGuy Harris <[email protected]>
Fri, 15 Dec 2017 20:21:29 +0000 (12:21 -0800)
committerGuy Harris <[email protected]>
Fri, 15 Dec 2017 20:21:50 +0000 (12:21 -0800)
We don't do this for NFS; that'd require more work.  The NFS dissector
is already using EXTRACT_ calls for the NFS message.

nfs.h
rpc_auth.h
rpc_msg.h

diff --git a/nfs.h b/nfs.h
index da7bc508db854d33b24eb83ec5b7c1ff2997e680..2e55569d687ba00a103c9c7353835739777462ac 100644 (file)
--- a/nfs.h
+++ b/nfs.h
 typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5,
        NFSOCK=6, NFFIFO=7 } nfs_type;
 
-/* Structs for common parts of the rpc's */
+/*
+ * Structs for common parts of the rpc's
+ *
+ * NOTE: these structures are not always overlaid directly on the
+ * packet data - sometimes we declare a local variable of that type,
+ * and fill it up with fields extracted using byte pointers - so we
+ * don't use nd_ types for their members.
+ */
+
 /*
  * File Handle (32 bytes for version 2), variable up to 64 for version 3.
  * File Handles of up to NFS_SMALLFH in size are stored directly in the
index 3cc9b30c7bb5bb1a211b41ac417384c159213ca5..3385ab9d42ec29b65b1cce9bca11e5a4eb552459 100644 (file)
@@ -65,8 +65,8 @@ enum sunrpc_auth_stat {
  * Authentication info.  Opaque to client.
  */
 struct sunrpc_opaque_auth {
-       uint32_t oa_flavor;             /* flavor of auth */
-       uint32_t oa_len;                /* length of opaque body */
+       nd_uint32_t oa_flavor;          /* flavor of auth */
+       nd_uint32_t oa_len;             /* length of opaque body */
        /* zero or more bytes of body */
 };
 
index 88e7319b16c417d8158581879290a91d6a156f4d..e49474ea37a0266c8be8b49efa783739854816ea 100644 (file)
--- a/rpc_msg.h
+++ b/rpc_msg.h
@@ -78,13 +78,13 @@ enum sunrpc_reject_stat {
  * Reply to an rpc request that was rejected by the server.
  */
 struct sunrpc_rejected_reply {
-       uint32_t                 rj_stat;       /* enum reject_stat */
+       nd_uint32_t              rj_stat;       /* enum reject_stat */
        union {
                struct {
-                       uint32_t low;
-                       uint32_t high;
+                       nd_uint32_t low;
+                       nd_uint32_t high;
                } RJ_versions;
-               uint32_t RJ_why;  /* enum auth_stat - why authentication did not work */
+               nd_uint32_t RJ_why;  /* enum auth_stat - why authentication did not work */
        } ru;
 #define        rj_vers ru.RJ_versions
 #define        rj_why  ru.RJ_why
@@ -94,7 +94,7 @@ struct sunrpc_rejected_reply {
  * Body of a reply to an rpc request.
  */
 struct sunrpc_reply_body {
-       uint32_t        rp_stat;                /* enum reply_stat */
+       nd_uint32_t     rp_stat;                /* enum reply_stat */
        struct sunrpc_rejected_reply rp_reject; /* if rejected */
 };
 
@@ -102,10 +102,10 @@ struct sunrpc_reply_body {
  * Body of an rpc request call.
  */
 struct sunrpc_call_body {
-       uint32_t cb_rpcvers;    /* must be equal to two */
-       uint32_t cb_prog;
-       uint32_t cb_vers;
-       uint32_t cb_proc;
+       nd_uint32_t cb_rpcvers; /* must be equal to two */
+       nd_uint32_t cb_prog;
+       nd_uint32_t cb_vers;
+       nd_uint32_t cb_proc;
        struct sunrpc_opaque_auth cb_cred;
        /* followed by opaque verifier */
 };
@@ -114,8 +114,8 @@ struct sunrpc_call_body {
  * The rpc message
  */
 struct sunrpc_msg {
-       uint32_t                rm_xid;
-       uint32_t                rm_direction;   /* enum msg_type */
+       nd_uint32_t             rm_xid;
+       nd_uint32_t             rm_direction;   /* enum msg_type */
        union {
                struct sunrpc_call_body RM_cmb;
                struct sunrpc_reply_body RM_rmb;