aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ospf.c
diff options
context:
space:
mode:
authorStephen Fisher <steve@stephen-fisher.com>2006-12-07 20:34:21 +0000
committerStephen Fisher <steve@stephen-fisher.com>2006-12-07 20:34:21 +0000
commite1ebcca66af98b48e04ff4091f1f72997072d241 (patch)
tree7c0a08012db9fb198956096c590f67eb5d0e259a /epan/dissectors/packet-ospf.c
parentd61e373bb49307253210cb19f7996ef1cce1e815 (diff)
From Francesco Fondelli: Update/addition to Bandwidth Constraints Model code
in OSPF. svn path=/trunk/; revision=20063
Diffstat (limited to 'epan/dissectors/packet-ospf.c')
-rw-r--r--epan/dissectors/packet-ospf.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ospf.c b/epan/dissectors/packet-ospf.c
index 6b63eceb61..b96d48b2db 100644
--- a/epan/dissectors/packet-ospf.c
+++ b/epan/dissectors/packet-ospf.c
@@ -202,6 +202,16 @@ static const value_string mpls_link_stlv_ltype_str[] = {
{0, NULL},
};
+/* FF: from www.iana.org/assignments/bandwidth-constraints-model-ids */
+static const range_string mpls_link_stlv_bcmodel_rvals[] = {
+ { 0, 0, "(Russian Dolls Model - RDM)" },
+ { 1, 1, "(Maximum Allocation Model - MAM)" },
+ { 2, 2, "(Maximum Allocation with Reservation Model - MAR)" },
+ { 3, 239, "(Unassigned, Specification Required)" },
+ { 240, 255, "(Reserved, Private Use)" },
+ { 0, 0, NULL }
+};
+
#define OSPF_V2_ROUTER_LSA_FLAG_B 0x01
#define OSPF_V2_ROUTER_LSA_FLAG_E 0x02
#define OSPF_V2_ROUTER_LSA_FLAG_V 0x04
@@ -585,7 +595,7 @@ static hf_register_info ospff_info[] = {
BASE_HEX, NULL, 0x0, "MPLS/TE Link Resource Class/Color", HFILL }},
{&ospf_filter[OSPFF_LS_MPLS_BC_MODEL_ID],
{ "MPLS/DSTE Bandwidth Constraints Model Id", "ospf.mpls.bc", FT_UINT8,
- BASE_HEX, NULL, 0x0, "MPLS/DSTE Bandwidth Constraints Model Id", HFILL }},
+ BASE_DEC, NULL, 0x0, "MPLS/DSTE Bandwidth Constraints Model Id", HFILL }},
{&ospf_filter[OSPFF_V2_OPTIONS],
{ "Options", "ospf.v2.options", FT_UINT8, BASE_HEX,
@@ -1752,10 +1762,16 @@ dissect_ospf_lsa_mpls(tvbuff_t *tvb, int offset, proto_tree *tree,
proto_tree_add_text(stlv_tree, tvb, stlv_offset+2, 2, "TLV Length: %u",
stlv_len);
- proto_tree_add_item(stlv_tree,
- ospf_filter[OSPFF_LS_MPLS_BC_MODEL_ID],
- tvb, stlv_offset+4, 1, FALSE);
-
+ proto_tree_add_uint_format(stlv_tree,
+ ospf_filter[OSPFF_LS_MPLS_BC_MODEL_ID],
+ tvb, stlv_offset+4, 1,
+ tvb_get_guint8(tvb, stlv_offset+4),
+ "MPLS/DSTE Bandwidth Constraints Model Id: %u %s",
+ tvb_get_guint8(tvb, stlv_offset+4),
+ rval_to_str(tvb_get_guint8(tvb, stlv_offset+4),
+ mpls_link_stlv_bcmodel_rvals,
+ "Unknown"));
+
/* 3 octets reserved +5, +6 and +7 (all 0x00) */
if(tvb_memeql(tvb, stlv_offset+5, allzero, 3) == -1) {
proto_tree_add_text(stlv_tree, tvb, stlv_offset+5, 3,