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-conv.c | |
parent | 599a7bfd3968aefe1f38b52f7cded11a6367b2f9 (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-conv.c')
-rw-r--r-- | packet-dcerpc-conv.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/packet-dcerpc-conv.c b/packet-dcerpc-conv.c index 5dd68faacf..c189966290 100644 --- a/packet-dcerpc-conv.c +++ b/packet-dcerpc-conv.c @@ -2,7 +2,7 @@ * Routines for dcerpc conv dissection * Copyright 2001, Todd Sabin <tas@webspan.net> * - * $Id: packet-dcerpc-conv.c,v 1.6 2002/09/26 06:13:07 sahlberg Exp $ + * $Id: packet-dcerpc-conv.c,v 1.7 2003/06/26 04:30:26 tpot Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -171,22 +171,12 @@ static dcerpc_sub_dissector conv_dissectors[] = { { 0, NULL, NULL, NULL } }; -static const value_string conv_opnum_vals[] = { - { 0, "who_are_you" }, - { 1, "who_are_you2" }, - { 2, "are_you_there" }, - { 3, "who_are_you_auth" }, - { 4, "who_are_you_auth_more" }, - { 0, NULL } -}; - - void proto_register_conv (void) { static hf_register_info hf[] = { { &hf_conv_opnum, - { "Operation", "conv.opnum", FT_UINT16, BASE_DEC, VALS(conv_opnum_vals), 0x0, "Operation", HFILL }}, + { "Operation", "conv.opnum", FT_UINT16, BASE_DEC, NULL, 0x0, "Operation", HFILL }}, { &hf_conv_who_are_you_resp_seq, {"hf_conv_who_are_you_resp_seq", "conv.who_are_you_resp_seq", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}, { &hf_conv_rc, @@ -216,7 +206,15 @@ proto_register_conv (void) void proto_reg_handoff_conv (void) { + header_field_info *hf_info; + /* Register the protocol as dcerpc */ dcerpc_init_uuid (proto_conv, ett_conv, &uuid_conv, ver_conv, conv_dissectors, hf_conv_opnum); + + /* Set opnum strings from subdissector list */ + + hf_info = proto_registrar_get_nth(hf_conv_opnum); + hf_info->strings = value_string_from_subdissectors( + conv_dissectors, array_length(conv_dissectors)); } |