aboutsummaryrefslogtreecommitdiffstats
path: root/packet-dcerpc-browser.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-06-26 04:30:31 +0000
committerTim Potter <tpot@samba.org>2003-06-26 04:30:31 +0000
commit623f5b865d67fbdd54811628579feac4226c5a0b (patch)
tree6693a34e2ad66d7b8e9a1c29a3cb6ef9d391dd18 /packet-dcerpc-browser.c
parent599a7bfd3968aefe1f38b52f7cded11a6367b2f9 (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. svn path=/trunk/; revision=7936
Diffstat (limited to 'packet-dcerpc-browser.c')
-rw-r--r--packet-dcerpc-browser.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/packet-dcerpc-browser.c b/packet-dcerpc-browser.c
index a6d8c75f77..3153fc09c8 100644
--- a/packet-dcerpc-browser.c
+++ b/packet-dcerpc-browser.c
@@ -2,7 +2,7 @@
* Routines for DCERPC Browser packet disassembly
* Copyright 2001, Ronnie Sahlberg
*
- * $Id: packet-dcerpc-browser.c,v 1.10 2003/01/30 08:19:37 guy Exp $
+ * $Id: packet-dcerpc-browser.c,v 1.11 2003/06/26 04:30:26 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -39,6 +39,7 @@
#include "smb.h"
static int proto_dcerpc_browser = -1;
+static int hf_browser_opnum = -1;
static int hf_browser_rc = -1;
static int hf_browser_unknown_long = -1;
static int hf_browser_unknown_hyper = -1;
@@ -1121,6 +1122,11 @@ void
proto_register_dcerpc_browser(void)
{
static hf_register_info hf[] = {
+
+ { &hf_browser_opnum, {
+ "Operation", "rpc_browser.opnum", FT_UINT16, BASE_DEC,
+ NULL, 0x0, "Operation", HFILL }},
+
{ &hf_browser_rc, {
"Return code", "rpc_browser.rc", FT_UINT32, BASE_HEX,
VALS(NT_errors), 0x0, "Browser return code", HFILL }},
@@ -1157,9 +1163,17 @@ static hf_register_info hf[] = {
void
proto_reg_handoff_dcerpc_browser(void)
{
+ header_field_info *hf_info;
+
/* Register protocol as dcerpc */
dcerpc_init_uuid(proto_dcerpc_browser, ett_dcerpc_browser,
&uuid_dcerpc_browser, ver_dcerpc_browser,
- dcerpc_browser_dissectors, -1);
+ dcerpc_browser_dissectors, hf_browser_opnum);
+
+ /* Set opnum strings from subdissector list */
+
+ hf_info = proto_registrar_get_nth(hf_browser_opnum);
+ hf_info->strings = value_string_from_subdissectors(
+ dcerpc_browser_dissectors, array_length(dcerpc_browser_dissectors));
}