diff options
author | Tim Potter <tpot@samba.org> | 2003-06-26 04:30:31 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2003-06-26 04:30:31 +0000 |
commit | 623f5b865d67fbdd54811628579feac4226c5a0b (patch) | |
tree | 6693a34e2ad66d7b8e9a1c29a3cb6ef9d391dd18 /packet-dcerpc-mgmt.c | |
parent | 599a7bfd3968aefe1f38b52f7cded11a6367b2f9 (diff) | |
download | wireshark-623f5b865d67fbdd54811628579feac4226c5a0b.tar.gz wireshark-623f5b865d67fbdd54811628579feac4226c5a0b.tar.bz2 wireshark-623f5b865d67fbdd54811628579feac4226c5a0b.zip |
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-mgmt.c')
-rw-r--r-- | packet-dcerpc-mgmt.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/packet-dcerpc-mgmt.c b/packet-dcerpc-mgmt.c index 372001c9c8..3562fb5802 100644 --- a/packet-dcerpc-mgmt.c +++ b/packet-dcerpc-mgmt.c @@ -2,7 +2,7 @@ * Routines for dcerpc mgmt dissection * Copyright 2001, Todd Sabin <tas@webspan.net> * - * $Id: packet-dcerpc-mgmt.c,v 1.5 2002/08/02 23:35:48 jmayer Exp $ + * $Id: packet-dcerpc-mgmt.c,v 1.6 2003/06/26 04:30:28 tpot Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -36,6 +36,7 @@ static int proto_mgmt = -1; +static int hf_opnum = -1; static gint ett_mgmt = -1; @@ -57,24 +58,31 @@ static dcerpc_sub_dissector mgmt_dissectors[] = { void proto_register_mgmt (void) { -#if 0 static hf_register_info hf[] = { + { &hf_opnum, + { "Operation", "mgmt.opnum", FT_UINT16, BASE_DEC, + NULL, 0x0, "", HFILL }}, }; -#endif static gint *ett[] = { &ett_mgmt }; proto_mgmt = proto_register_protocol ("DCE/RPC Remote Management", "MGMT", "mgmt"); -#if 0 proto_register_field_array (proto_mgmt, hf, array_length (hf)); -#endif proto_register_subtree_array (ett, array_length (ett)); } void proto_reg_handoff_mgmt (void) { + header_field_info *hf_info; + /* Register the protocol as dcerpc */ - dcerpc_init_uuid (proto_mgmt, ett_mgmt, &uuid_mgmt, ver_mgmt, mgmt_dissectors, -1); + dcerpc_init_uuid (proto_mgmt, ett_mgmt, &uuid_mgmt, ver_mgmt, mgmt_dissectors, hf_opnum); + + /* Set opnum strings from subdissector list */ + + hf_info = proto_registrar_get_nth(hf_opnum); + hf_info->strings = value_string_from_subdissectors( + mgmt_dissectors, array_length(mgmt_dissectors)); } |