aboutsummaryrefslogtreecommitdiffstats
path: root/packet-dcerpc-mapi.c
diff options
context:
space:
mode:
authortpot <tpot@f5534014-38df-0310-8fa8-9805f1628bb7>2003-06-26 04:30:31 +0000
committertpot <tpot@f5534014-38df-0310-8fa8-9805f1628bb7>2003-06-26 04:30:31 +0000
commite1a47e463398aaddbd9ee89b415e1eb2002fcb48 (patch)
tree6693a34e2ad66d7b8e9a1c29a3cb6ef9d391dd18 /packet-dcerpc-mapi.c
parent3f51a019690b8e28cc1822725eb30be5acab25b6 (diff)
Dynamically create DCERPC opnum value_strings from the subdissector
list rather than duplicating this information in the dissector. Some of the opnum strings were starting to get out of date as developers forgot to update the information in both places. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7936 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-dcerpc-mapi.c')
-rw-r--r--packet-dcerpc-mapi.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/packet-dcerpc-mapi.c b/packet-dcerpc-mapi.c
index 834ec209a3..f1e894259a 100644
--- a/packet-dcerpc-mapi.c
+++ b/packet-dcerpc-mapi.c
@@ -2,7 +2,7 @@
* Routines for MS Exchange MAPI
* Copyright 2002, Ronnie Sahlberg
*
- * $Id: packet-dcerpc-mapi.c,v 1.22 2003/06/05 04:22:03 guy Exp $
+ * $Id: packet-dcerpc-mapi.c,v 1.23 2003/06/26 04:30:28 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -36,6 +36,7 @@
#include "prefs.h"
static int proto_dcerpc_mapi = -1;
+static int hf_mapi_opnum = -1;
static int hf_mapi_unknown_string = -1;
static int hf_mapi_unknown_short = -1;
static int hf_mapi_unknown_long = -1;
@@ -374,6 +375,10 @@ proto_register_dcerpc_mapi(void)
{
static hf_register_info hf[] = {
+ { &hf_mapi_opnum,
+ { "Operation", "mapi.opnum", FT_UINT16, BASE_DEC,
+ NULL, 0x0, "", HFILL }},
+
{ &hf_mapi_hnd,
{ "Context Handle", "mapi.hnd", FT_BYTES, BASE_NONE,
NULL, 0x0, "", HFILL }},
@@ -455,9 +460,17 @@ static hf_register_info hf[] = {
void
proto_reg_handoff_dcerpc_mapi(void)
{
+ header_field_info *hf_info;
+
/* Register protocol as dcerpc */
dcerpc_init_uuid(proto_dcerpc_mapi, ett_dcerpc_mapi,
&uuid_dcerpc_mapi, ver_dcerpc_mapi,
- dcerpc_mapi_dissectors, -1);
+ dcerpc_mapi_dissectors, hf_mapi_opnum);
+
+ /* Set opnum strings from subdissector list */
+
+ hf_info = proto_registrar_get_nth(hf_mapi_opnum);
+ hf_info->strings = value_string_from_subdissectors(
+ dcerpc_mapi_dissectors, array_length(dcerpc_mapi_dissectors));
}