diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-03-13 16:36:31 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-03-13 16:36:31 +0000 |
commit | fae651652098b2566cdbe6e48ceaf745111b6238 (patch) | |
tree | 3a65c4266b797b96b02583396bb09964fe8d9881 /packet-mpls.c | |
parent | 87b9925370b30b3a5b89e4c9295f172adbd4a3f4 (diff) |
Remove the proto_tree_add_text() and proto_tree_add_item_hidden() calls
for mpls.label and replace them with proto_tree_add_uint_format() and
proto_tree_add_item(). In the mpls proto_registration, associated
the val_string with mpls.label.
svn path=/trunk/; revision=1715
Diffstat (limited to 'packet-mpls.c')
-rw-r--r-- | packet-mpls.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/packet-mpls.c b/packet-mpls.c index 88825cdcfc..aa5e3d458f 100644 --- a/packet-mpls.c +++ b/packet-mpls.c @@ -3,7 +3,7 @@ * * (c) Copyright Ashok Narayanan <ashokn@cisco.com> * - * $Id: packet-mpls.c,v 1.1 2000/03/09 18:31:50 ashokn Exp $ + * $Id: packet-mpls.c,v 1.2 2000/03/13 16:36:31 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -92,19 +92,19 @@ static hf_register_info mplsf_info[] = { "" }}, {&mpls_filter[MPLSF_LABEL], - {"MPLS Label", "mpls.label", FT_UINT32, BASE_NONE, NULL, 0x0, + {"MPLS Label", "mpls.label", FT_UINT32, BASE_DEC, VALS(special_labels), 0x0, "" }}, {&mpls_filter[MPLSF_EXP], - {"MPLS Experimental Bits", "mpls.exp", FT_UINT8, BASE_NONE, NULL, 0x0, + {"MPLS Experimental Bits", "mpls.exp", FT_UINT8, BASE_DEC, NULL, 0x0, "" }}, {&mpls_filter[MPLSF_BOTTOM_OF_STACK], - {"MPLS Bottom Of Label Stack", "mpls.bottom", FT_UINT8, BASE_NONE, NULL, 0x0, + {"MPLS Bottom Of Label Stack", "mpls.bottom", FT_UINT8, BASE_DEC, NULL, 0x0, "" }}, {&mpls_filter[MPLSF_TTL], - {"MPLS TTL", "mpls.ttl", FT_UINT8, BASE_NONE, NULL, 0x0, + {"MPLS TTL", "mpls.ttl", FT_UINT8, BASE_DEC, NULL, 0x0, "" }}, }; @@ -157,15 +157,14 @@ dissect_mpls(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) mpls_tree = proto_item_add_subtree(ti, ett_mpls); if (label <= MAX_RESERVED) - proto_tree_add_text(mpls_tree, offset, 3, - "Label: %d (%s)", + proto_tree_add_uint_format(mpls_tree, mpls_filter[MPLSF_LABEL], + offset, 3, label, "Label: %d (%s)", label, val_to_str(label, special_labels, "Reserved - Unknown")); else - proto_tree_add_text(mpls_tree, offset, 3, - "Label: %d", label); - proto_tree_add_item_hidden(mpls_tree, mpls_filter[MPLSF_LABEL], - offset,3, label); + proto_tree_add_item(mpls_tree, mpls_filter[MPLSF_LABEL], + offset, 3, label); + proto_tree_add_item(mpls_tree,mpls_filter[MPLSF_EXP], offset+2,1, exp); proto_tree_add_item(mpls_tree,mpls_filter[MPLSF_BOTTOM_OF_STACK], |