From f7114879611a673db763a2ee9782572a79cb0b86 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 22 Sep 2004 16:28:39 +0000 Subject: From Carlos Pignataro: append MPLS fields and values to the MPLS Header subtree; correct the string displayed for MPLS Label; don't show non-reserved MPLS label values as "Unknown". svn path=/trunk/; revision=12065 --- epan/dissectors/packet-mpls.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c index fcbd63c895..72f1fb6c66 100644 --- a/epan/dissectors/packet-mpls.c +++ b/epan/dissectors/packet-mpls.c @@ -216,19 +216,25 @@ dissect_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (label <= MAX_RESERVED) proto_tree_add_uint_format(mpls_tree, mpls_filter[MPLSF_LABEL], tvb, - offset, 3, label, "Label: %u (%s)", + offset, 3, label, "MPLS Label: %u (%s)", label, val_to_str(label, special_labels, "Reserved - Unknown")); else - proto_tree_add_uint(mpls_tree, mpls_filter[MPLSF_LABEL], tvb, - offset, 3, label); + proto_tree_add_uint_format(mpls_tree, mpls_filter[MPLSF_LABEL], tvb, + offset, 3, label, "MPLS Label: %u", label); + proto_item_append_text(ti, ", Label: %u", label); proto_tree_add_uint(mpls_tree,mpls_filter[MPLSF_EXP], tvb, offset+2,1, exp); + proto_item_append_text(ti, ", Exp: %u", exp); + proto_tree_add_uint(mpls_tree,mpls_filter[MPLSF_BOTTOM_OF_STACK], tvb, offset+2,1, bos); + proto_item_append_text(ti, ", S: %u", bos); + proto_tree_add_uint(mpls_tree,mpls_filter[MPLSF_TTL], tvb, offset+3,1, ttl); + proto_item_append_text(ti, ", TTL: %u", ttl); } offset += 4; if (bos) break; -- cgit v1.2.3