aboutsummaryrefslogtreecommitdiffstats
path: root/packet-dcerpc-dnsserver.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-dnsserver.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-dnsserver.c')
-rw-r--r--packet-dcerpc-dnsserver.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/packet-dcerpc-dnsserver.c b/packet-dcerpc-dnsserver.c
index 673b3d4fdd..07321c39ac 100644
--- a/packet-dcerpc-dnsserver.c
+++ b/packet-dcerpc-dnsserver.c
@@ -2,7 +2,7 @@
* Routines for SMB \PIPE\DNSSERVER packet disassembly
* Copyright 2001, 2002 Tim Potter <tpot@samba.org>
*
- * $Id: packet-dcerpc-dnsserver.c,v 1.1 2002/09/11 23:59:13 tpot Exp $
+ * $Id: packet-dcerpc-dnsserver.c,v 1.2 2003/06/26 04:30:27 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -59,14 +59,6 @@ static dcerpc_sub_dissector dcerpc_dnsserver_dissectors[] = {
{ 0, NULL, NULL, NULL }
};
-static const value_string dnsserver_opnum_vals[] = {
- { UNKNOWN_00, "Unknown 0x00" },
- { UNKNOWN_01, "Unknown 0x01" },
- { UNKNOWN_02, "Unknown 0x02" },
- { UNKNOWN_03, "Unknown 0x03" },
- { 0, NULL }
-};
-
void
proto_register_dcerpc_dnsserver(void)
{
@@ -80,7 +72,7 @@ proto_register_dcerpc_dnsserver(void)
{ &hf_opnum,
{ "Operation", "dnsserver.opnum", FT_UINT16, BASE_DEC,
- VALS(dnsserver_opnum_vals), 0x0, "Operation", HFILL }},
+ NULL, 0x0, "Operation", HFILL }},
};
static gint *ett[] = {
@@ -98,9 +90,17 @@ proto_register_dcerpc_dnsserver(void)
void
proto_reg_handoff_dcerpc_dnsserver(void)
{
+ header_field_info *hf_info;
+
/* Register protocol as dcerpc */
dcerpc_init_uuid(
proto_dcerpc_dnsserver, ett_dnsserver, &uuid_dcerpc_dnsserver,
ver_dcerpc_dnsserver, dcerpc_dnsserver_dissectors, hf_opnum);
+
+ /* Set opnum strings from subdissector list */
+
+ hf_info = proto_registrar_get_nth(hf_opnum);
+ hf_info->strings = value_string_from_subdissectors(
+ dcerpc_dnsserver_dissectors, array_length(dcerpc_dnsserver_dissectors));
}