aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-05-29 07:45:40 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-05-29 07:45:40 +0000
commit7aa5527274b1128be732ea8eb49e48ef89afb5f3 (patch)
tree7f7d0464ba0f2011e15f86ca9bed52f027b524e6 /epan/dissectors
parent859f794544c10e89932c9c8644e6831a63fbd377 (diff)
From Aditya Ambadkar and Diana Chris:
Enhancement to LDP dissector to support changes proposed in RFC6391 - flow aware transport of PW over an MPLS PSN. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7046 svn path=/trunk/; revision=42894
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-ldp.c40
-rw-r--r--epan/dissectors/packet-mpls.c19
2 files changed, 52 insertions, 7 deletions
diff --git a/epan/dissectors/packet-ldp.c b/epan/dissectors/packet-ldp.c
index 198c2d2814..5f494eb3dc 100644
--- a/epan/dissectors/packet-ldp.c
+++ b/epan/dissectors/packet-ldp.c
@@ -11,6 +11,8 @@
* (c) Copyright 2011, Shobhank Sharma <ssharma5@ncsu.edu>
* - update the VCCV bitmaps as per RFC 5885
*
+ * (c) Copyright 2012, Aditya Ambadkar and Diana Chris <arambadk,dvchris@ncsu.edu>
+ * - support for the flowlabel sub-tlv as per RFC 6391
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
@@ -184,6 +186,9 @@ static int hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd1 = -1;
static int hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd2 = -1;
static int hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd3 = -1;
static int hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd4 = -1;
+static int hf_ldp_tlv_fec_vc_intparam_flowlabel_t = -1; /* Flow label interface parameter RFC6391 */
+static int hf_ldp_tlv_fec_vc_intparam_flowlabel_r = -1; /* Flow label interface parameter RFC6391 */
+static int hf_ldp_tlv_fec_vc_intparam_flowlabel_res = -1; /* Flow label interface parameter RFC6391 */
static int hf_ldp_tlv_lspid_act_flg = -1;
static int hf_ldp_tlv_lspid_cr_lsp = -1;
static int hf_ldp_tlv_lspid_ldpid = -1;
@@ -275,7 +280,6 @@ static int hf_ldp_tlv_intparam_vccv_cvtype_icmpping = -1;
static int hf_ldp_tlv_intparam_vccv_cvtype_lspping = -1;
static int hf_ldp_tlv_intparam_vccv_cvtype_bfd = -1;
-
static int ett_ldp = -1;
static int ett_ldp_header = -1;
static int ett_ldp_ldpid = -1;
@@ -587,8 +591,7 @@ static const true_false_string fec_vc_tdmopt_f = {
#define FEC_VC_INTERFACEPARAM_FCSRETENT 0x0A
#define FEC_VC_INTERFACEPARAM_TDMOPTION 0x0B
#define FEC_VC_INTERFACEPARAM_VCCV 0x0C
-
-
+#define FEC_VC_INTERFACEPARAM_FLOWLABEL 0x17
static const value_string fec_vc_interfaceparm[] = {
{FEC_VC_INTERFACEPARAM_MTU, "MTU"},
@@ -603,6 +606,7 @@ static const value_string fec_vc_interfaceparm[] = {
{FEC_VC_INTERFACEPARAM_FCSRETENT, "FCS retention indicator"},
{FEC_VC_INTERFACEPARAM_TDMOPTION, "TDM options"},
{FEC_VC_INTERFACEPARAM_VCCV, "VCCV"},
+ {FEC_VC_INTERFACEPARAM_FLOWLABEL, "Flow Label"},
{0, NULL},
};
@@ -611,7 +615,10 @@ static const true_false_string fec_vc_cbit = {
"Control Word NOT Present"
};
-
+static const true_false_string fec_vc_ = {
+ "Control Word Present",
+ "Control Word NOT Present"
+};
static const value_string tlv_atm_merge_vals[] = {
{0, "Merge not supported"},
@@ -877,7 +884,10 @@ dissect_tlv_fec(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
&hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd1,
&hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd2,
&hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd3,
- &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd4
+ &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd4,
+ &hf_ldp_tlv_fec_vc_intparam_flowlabel_t,
+ &hf_ldp_tlv_fec_vc_intparam_flowlabel_r,
+ &hf_ldp_tlv_fec_vc_intparam_flowlabel_res,
};
proto_tree *ti, *val_tree, *fec_tree=NULL;
@@ -2760,7 +2770,10 @@ dissect_subtlv_interface_parameters(tvbuff_t *tvb, guint offset, proto_tree *tre
32 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd1,
33 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd2,
34 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd3,
- 35 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd4
+ 35 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd4,
+ 36 - hf_ldp_tlv_fec_vc_intparam_flowlabel_t,
+ 37 - hf_ldp_tlv_fec_vc_intparam_flowlabel_r,
+ 38 - hf_ldp_tlv_fec_vc_intparam_flowlabel_res
};
#endif
proto_tree *ti = proto_tree_add_text(tree, tvb, offset, rem, "Interface Parameter");
@@ -2855,6 +2868,12 @@ dissect_subtlv_interface_parameters(tvbuff_t *tvb, guint offset, proto_tree *tre
proto_tree_add_item(vccvtype_tree, *interface_parameters_hf[31], tvb, offset+3, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(vccvtype_tree, *interface_parameters_hf[32], tvb, offset+3, 1, ENC_BIG_ENDIAN);
break;
+ case FEC_VC_INTERFACEPARAM_FLOWLABEL:
+ proto_item_append_text(ti,": Flow Label for Pseudowire");
+ proto_tree_add_item(vcintparam_tree, *interface_parameters_hf[36], tvb, offset+2, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(vcintparam_tree, *interface_parameters_hf[37], tvb, offset+2, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(vcintparam_tree, *interface_parameters_hf[38], tvb, offset+2, 2, ENC_BIG_ENDIAN);
+ break;
default: /* unknown */
proto_item_append_text(ti," unknown");
proto_tree_add_text(vcintparam_tree,tvb, offset+2, (intparam_len -2), "Unknown data");
@@ -3561,6 +3580,15 @@ proto_register_ldp(void)
{ "BFD BFD PW-ACH-encapsulated, for PW Fault Detection and AC/PW Fault Status Signaling", "ldp.msg.tlv.fec.vc.intparam.vccv.cvtype_bfd4", FT_BOOLEAN, 8,
NULL, 0x20, "VC FEC Interface Param VCCV CV Type BFD PW-ACH-encapsulated, for PW Fault Detection and AC/PW Fault Status Signaling", HFILL }},
+ { &hf_ldp_tlv_fec_vc_intparam_flowlabel_t,
+ { "Flow Label Transmit bit", "ldp.msg.tlv.fec.vc.intparam.flowlabel.t", FT_UINT8, BASE_DEC, NULL, 0x80, NULL, HFILL}},
+
+ { &hf_ldp_tlv_fec_vc_intparam_flowlabel_r,
+ { "Flow Label Receive bit", "ldp.msg.tlv.fec.vc.intparam.flowlabel.r", FT_UINT8, BASE_DEC, NULL, 0x40, NULL, HFILL}},
+
+ { &hf_ldp_tlv_fec_vc_intparam_flowlabel_res,
+ { "Flow Label Reserved", "ldp.msg.tlv.fec.vc.intparam.flowlabel.res", FT_UINT16, BASE_HEX, NULL, 0x3FFF, NULL, HFILL}},
+
{ &hf_ldp_tlv_lspid_act_flg,
{ "Action Indicator Flag", "ldp.msg.tlv.lspid.actflg", FT_UINT16, BASE_HEX,
VALS(ldp_act_flg_vals), 0x000F, NULL, HFILL}},
diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c
index 5edff67354..94357498a0 100644
--- a/epan/dissectors/packet-mpls.c
+++ b/epan/dissectors/packet-mpls.c
@@ -24,6 +24,9 @@
* - Identification of BFD CC, BFD CV and ON-Demand CV ACH types as per RFC 6428, RFC 6426
* respectively and the corresponding decoding of messages
*
+ * (c) Copyright 2012, Aditya Ambadkar and Diana Chris <arambadk,dvchris@ncsu.edu>
+ * - Added preference to select BOS label as flowlabel as per RFC 6391
+ *
* $Id$
*
* Wireshark - Network traffic analyzer
@@ -211,6 +214,9 @@ static enum_val_t mpls_default_payload_defs[] = {
}
};
+/* For RFC6391 - Flow aware transport of pseudowire over a mpls PSN*/
+static gboolean mpls_bos_flowlabel = FALSE;
+
static int hf_mpls_label;
static int hf_mpls_label_special;
static int hf_mpls_exp;
@@ -565,7 +571,11 @@ dissect_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_mpls, tvb, offset, 4, ENC_NA);
mpls_tree = proto_item_add_subtree(ti, ett_mpls);
- proto_item_append_text(ti, ", Label: %u", label);
+ if (mpls_bos_flowlabel) {
+ proto_item_append_text(ti, ", Label: %u (Flow Label)", label);
+ } else {
+ proto_item_append_text(ti, ", Label: %u", label);
+ }
if (label <= LABEL_MAX_RESERVED){
proto_tree_add_item(mpls_tree, hf_mpls_label_special, tvb,
offset, 4, ENC_BIG_ENDIAN);
@@ -773,6 +783,13 @@ proto_register_mpls(void)
&mpls_default_payload,
mpls_default_payload_defs,
FALSE );
+
+ /* RFC6391: Flow aware transport of pseudowire*/
+ prefs_register_bool_preference(module_mpls,
+ "flowlabel_in_mpls_header",
+ "Assume bottom of stack label as Flow label",
+ "Lowest label is used to segregate flows inside a pseudowire",
+ &mpls_bos_flowlabel);
}
void