From 7e817aeb3a3cee7c3eb3e7685ab0ccf98a00411b Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 18 Jul 2015 23:23:32 -0700 Subject: Require dissectors for all ONC RPC calls and replies. Either there's a known body for the call or reply, in which case we already have a dissector for it, or the body is empty, in which case we now have dissect_rpc_void() to dissect it, or the body is unknown or nobody's bothered writing it, in which case we use dissect_rpc_unknown() for now. This means that an attempt to look up the dissector for a known procedure will always succeed, so we can label it with the name rather than with "proc-N". It also means that we distinguish between "it's void" and "it's unknown", so that unknown values will get flagged as such. Change-Id: I748580c1dca61d1f0972396db1a3b0885fc0a541 Reviewed-on: https://code.wireshark.org/review/9699 Reviewed-by: Guy Harris --- epan/dissectors/packet-glusterfs_hndsk.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'epan/dissectors/packet-glusterfs_hndsk.c') diff --git a/epan/dissectors/packet-glusterfs_hndsk.c b/epan/dissectors/packet-glusterfs_hndsk.c index a0f5b64a14..b077f1ea6b 100644 --- a/epan/dissectors/packet-glusterfs_hndsk.c +++ b/epan/dissectors/packet-glusterfs_hndsk.c @@ -184,18 +184,27 @@ gluster_hndsk_dissect_common_reply(tvbuff_t *tvb, } static const vsff gluster_hndsk_proc[] = { - { GF_HNDSK_NULL, "NULL", NULL, NULL }, + { + GF_HNDSK_NULL, "NULL", + dissect_rpc_void, dissect_rpc_void + }, { GF_HNDSK_SETVOLUME, "SETVOLUME", gluster_hndsk_setvolume_call, gluster_hndsk_setvolume_reply }, - { GF_HNDSK_GETSPEC, "GETSPEC", NULL, NULL }, - { GF_HNDSK_PING, "PING", NULL, gluster_hndsk_dissect_common_reply }, + { GF_HNDSK_GETSPEC, "GETSPEC", dissect_rpc_unknown, dissect_rpc_unknown }, + { + GF_HNDSK_PING, "PING", + dissect_rpc_void, gluster_hndsk_dissect_common_reply + }, { 0, NULL, NULL, NULL } }; static const vsff gluster_hndsk_2_proc[] = { - { GF_HNDSK_NULL, "NULL", NULL, NULL }, + { + GF_HNDSK_NULL, "NULL", + dissect_rpc_void, dissect_rpc_void + }, { GF_HNDSK_SETVOLUME, "SETVOLUME", gluster_hndsk_2_setvolume_call, gluster_hndsk_2_setvolume_reply @@ -204,7 +213,10 @@ static const vsff gluster_hndsk_2_proc[] = { GF_HNDSK_GETSPEC, "GETSPEC", gluster_hndsk_2_getspec_call, gluster_hndsk_2_getspec_reply }, - { GF_HNDSK_PING, "PING", NULL, glusterfs_gfs3_3_op_common_reply }, + { + GF_HNDSK_PING, "PING", + dissect_rpc_void, glusterfs_gfs3_3_op_common_reply + }, { GF_HNDSK_SET_LK_VER,"LOCK VERSION", gluster_hndsk_2_set_lk_ver_call, gluster_hndsk_2_set_lk_ver_reply @@ -298,9 +310,9 @@ proto_reg_handoff_gluster_hndsk(void) /* Legacy GlusterFS Callback procedures, they don't contain any data. */ static const vsff gluster_cbk_proc[] = { - { GF_CBK_NULL, "NULL", NULL, NULL }, - { GF_CBK_FETCHSPEC, "FETCHSPEC", NULL, NULL }, - { GF_CBK_INO_FLUSH, "INO_FLUSH", NULL, NULL }, + { GF_CBK_NULL, "NULL", dissect_rpc_void, dissect_rpc_void }, + { GF_CBK_FETCHSPEC, "FETCHSPEC", dissect_rpc_unknown, dissect_rpc_unknown }, + { GF_CBK_INO_FLUSH, "INO_FLUSH", dissect_rpc_unknown, dissect_rpc_unknown }, { 0, NULL, NULL, NULL } }; static const value_string gluster_cbk_proc_vals[] = { -- cgit v1.2.3