diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-10-06 20:46:52 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-10-06 20:46:52 +0000 |
commit | af5b47a0c288d02deb584772501f455b42f1581a (patch) | |
tree | b4e06d0ffcec8e4e517a4e3aa5774fe630c0b105 /packet-lmi.c | |
parent | 7183be72b27ed25d381c312dba5c29a81049f629 (diff) |
When registering a field, make sure its ID is -1 or 0 - if it's not,
that probably means you've registered two fields with the same field ID
variable, which is an error.
Fix the bugs doing so found.
svn path=/trunk/; revision=8629
Diffstat (limited to 'packet-lmi.c')
-rw-r--r-- | packet-lmi.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/packet-lmi.c b/packet-lmi.c index 0ac6ab8b17..9e8b143be8 100644 --- a/packet-lmi.c +++ b/packet-lmi.c @@ -2,7 +2,7 @@ * Routines for Frame Relay Local Management Interface (LMI) disassembly * Copyright 2001, Jeffrey C. Foster <jfoste@woodward.com> * - * $Id: packet-lmi.c,v 1.13 2003/10/06 07:26:10 guy Exp $ + * $Id: packet-lmi.c,v 1.14 2003/10/06 20:46:51 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -169,15 +169,15 @@ dissect_lmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ele_id = tvb_get_guint8( tvb, offset); len = tvb_get_guint8( tvb, offset + 1); - ti = proto_tree_add_uint(lmi_tree, hf_lmi_inf_ele, tvb, offset, len + 2, - tvb_get_guint8( tvb, offset)); + ti = proto_tree_add_text(lmi_tree, tvb, offset, len + 2, + "Information Element: %s", + val_to_str(ele_id, element_type_str, "Unknown (%u)")); lmi_subtree = proto_item_add_subtree(ti, ett_lmi_ele); proto_tree_add_uint(lmi_subtree, hf_lmi_inf_ele, tvb, offset, 1, - tvb_get_guint8( tvb, offset)); + ele_id); ++offset; - len = tvb_get_guint8( tvb, offset); proto_tree_add_uint(lmi_subtree, hf_lmi_inf_len, tvb, offset, 1, len); ++offset; if (( ele_id == 1) || (ele_id == 51)) @@ -208,9 +208,6 @@ proto_register_lmi(void) "Message Type", HFILL }}, { &hf_lmi_inf_ele, - { "Information Element", "lmi.inf_ele", FT_UINT8, BASE_DEC, VALS(element_type_str), 0, - "Information Element", HFILL }}, - { &hf_lmi_inf_ele, { "Type", "lmi.inf_ele_type", FT_UINT8, BASE_DEC, VALS(element_type_str), 0, "Information Element Type", HFILL }}, { &hf_lmi_inf_len, |