diff --git a/AUTHORS b/AUTHORS index a9c47eee96..64f206ada5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3356,6 +3356,10 @@ Ivan Lawrow { Kari Vatjus-Anttila { kNet (KristalliNet) dissector } +Shobhank Sharma { + MPLS Enhancement - Generic Associated Channel, as per RFC 5586 +} + and by: diff --git a/epan/dissectors/packet-ldp.c b/epan/dissectors/packet-ldp.c index f4c383c91f..627054905f 100644 --- a/epan/dissectors/packet-ldp.c +++ b/epan/dissectors/packet-ldp.c @@ -8,6 +8,10 @@ * CRLDP (RFC3212) is now supported * - (c) 2002 Michael Rozhavsky * + * (c) Copyright 2011, Shobhank Sharma + * - update the VCCV bitmaps as per RFC 5885 + * + * * Wireshark - Network traffic analyzer * By Gerald Combs * Copyright 1999 Gerald Combs @@ -176,7 +180,10 @@ static int hf_ldp_tlv_fec_vc_intparam_vccv_cctype_mplsra = -1; static int hf_ldp_tlv_fec_vc_intparam_vccv_cctype_ttl1 = -1; static int hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_icmpping = -1; static int hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_lspping = -1; -static int hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd = -1; +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_lspid_act_flg = -1; static int hf_ldp_tlv_lspid_cr_lsp = -1; static int hf_ldp_tlv_lspid_ldpid = -1; @@ -867,7 +874,10 @@ dissect_tlv_fec(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem) &hf_ldp_tlv_fec_vc_intparam_vccv_cctype_ttl1 , &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_icmpping , &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_lspping , - &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd + &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 }; proto_tree *ti, *val_tree, *fec_tree=NULL; @@ -2747,7 +2757,10 @@ dissect_subtlv_interface_parameters(tvbuff_t *tvb, guint offset, proto_tree *tre 29 - hf_ldp_tlv_fec_vc_intparam_vccv_cctype_ttl1 , 30 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_icmpping , 31 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_lspping , - 32 - hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd + 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 }; #endif proto_tree *ti = proto_tree_add_text(tree, tvb, offset, rem, "Interface Parameter"); @@ -3532,9 +3545,21 @@ proto_register_ldp(void) { "LSP Ping", "ldp.msg.tlv.fec.vc.intparam.vccv.cvtype_lspping", FT_BOOLEAN, 8, NULL, 0x02, "VC FEC Interface Param VCCV CV Type LSP Ping", HFILL }}, - { &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd, - { "BFD", "ldp.msg.tlv.fec.vc.intparam.vccv.cvtype_bfd", FT_BOOLEAN, 8, - NULL, 0x04, "VC FEC Interface Param VCCV CV Type BFD", HFILL }}, + { &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd1, + { "BFD IP/UDP-encapsulated, for PW Fault Detection only", "ldp.msg.tlv.fec.vc.intparam.vccv.cvtype_bfd1", FT_BOOLEAN, 8, + NULL, 0x04, "VC FEC Interface Param VCCV CV Type BFD IP/UDP-encapsulated, for PW Fault Detection only", HFILL }}, + + { &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd2, + { "BFD IP/UDP-encapsulated, for PW Fault Detection and AC/PW Fault Status Signaling", "ldp.msg.tlv.fec.vc.intparam.vccv.cvtype_bfd2", FT_BOOLEAN, 8, + NULL, 0x08, "VC FEC Interface Param VCCV CV Type BFD IP/UDP-encapsulated, for PW Fault Detection and AC/PW Fault Status Signaling", HFILL }}, + + { &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd3, + { "BFD BFD PW-ACH-encapsulated, for PW Fault Detection only", "ldp.msg.tlv.fec.vc.intparam.vccv.cvtype_bfd3", FT_BOOLEAN, 8, + NULL, 0x10, "VC FEC Interface Param VCCV CV Type BFD PW-ACH-encapsulated, for PW Fault Detection only", HFILL }}, + + { &hf_ldp_tlv_fec_vc_intparam_vccv_cvtype_bfd4, + { "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_lspid_act_flg, { "Action Indicator Flag", "ldp.msg.tlv.lspid.actflg", FT_UINT16, BASE_HEX, diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c index e78e244df8..f7cf91685d 100644 --- a/epan/dissectors/packet-mpls.c +++ b/epan/dissectors/packet-mpls.c @@ -11,6 +11,13 @@ * - mpls subdissector table indexed by label value * - enhanced "what's past last mpls label?" heuristic * + * (c) Copyright 2011, Shobhank Sharma + * - Removed some mpls preferences which are no longer relevant/needed like + * decode PWAC payloads as PPP traffic and assume all channel types except + * 0x21 are raw BFD. + * - MPLS extension from PW-ACH to MPLS Generic Associated Channel as per RFC 5586 + * - Updated Pseudowire Associated Channel Types as per http://www.iana.org/assignments/pwe3-parameters + * * $Id$ * * Wireshark - Network traffic analyzer @@ -59,6 +66,7 @@ #include "packet-ppp.h" #include "packet-mpls.h" #include "packet-pw-common.h" +#include static gint proto_mpls = -1; static gint proto_pw_ach = -1; @@ -68,6 +76,7 @@ static gint ett_mpls = -1; static gint ett_mpls_pw_ach = -1; static gint ett_mpls_pw_mcw = -1; static gint ett_mpls_oam = -1; +static char PW_ACH[50]="PW Associated Channel Header"; const value_string special_labels[] = { {LABEL_IP4_EXPLICIT_NULL, "IPv4 Explicit-Null"}, @@ -75,6 +84,7 @@ const value_string special_labels[] = { {LABEL_IP6_EXPLICIT_NULL, "IPv6 Explicit-Null"}, {LABEL_IMPLICIT_NULL, "Implicit-Null"}, {LABEL_OAM_ALERT, "OAM Alert"}, + {LABEL_GACH, "Generic Associated Channel Label (GAL)"}, {0, NULL } }; @@ -209,9 +219,6 @@ static enum_val_t mpls_default_payload_defs[] = { static int mpls_filter[MPLSF_MAX]; static gint mpls_default_payload = 0; -static gboolean mpls_pref_pwac_all_as_bfd_xipv4 = FALSE; -static gboolean mpls_pref_pwac_0x0_as_bfd = FALSE; -static gboolean mpls_pref_pwac_try_ppp = TRUE; static int hf_mpls_1st_nibble = -1; @@ -314,14 +321,35 @@ static const value_string mpls_pw_types[] = { * and http://tools.ietf.org/html/draft-ietf-pwe3-vccv-bfd-05 clause 3.2 */ static const value_string mpls_pwac_types[] = { + { 0x0000, "Reserved"}, + { 0x0001, "Management Communication Channel (MCC)"}, + { 0x0002, "Signaling Communication Channel (SCC)"}, { 0x0007, "BFD Control, PW-ACH-encapsulated (BFD Without IP/UDP Headers)" }, + { 0x000A, "MPLS Direct Loss Measurement (DLM)"}, + { 0x000B, "MPLS Inferred Loss Measurement (ILM)"}, + { 0x000C, "MPLS Delay Measurement (DM)"}, + { 0x000D, "MPLS Direct Loss and Delay Measurement (DLM+DM)"}, + { 0x000E, "MPLS Inferred Loss and Delay Measurement (ILM+DM)"}, { 0x0021, "IPv4 packet" }, - { 0x0057, "IPv6 packet" }, + { 0x0022, "MPLS-TP CC message"}, + { 0x0023, "MPLS-TP CV message"}, + { 0x0024, "Protection State Coordination Protocol - Channel Type (PSC-CT)"}, + { 0x0025, "On-Demand CV"}, + { 0x0026, "LI"}, + { 0x0057, "IPv6 packet" }, + { 0x0058, "Fault OAM"}, + { 0x7FF8, "Reserved for Experimental Use"}, + { 0x7FF9, "Reserved for Experimental Use"}, + { 0x7FFA, "Reserved for Experimental Use"}, + { 0x7FFB, "Reserved for Experimental Use"}, + { 0x7FFC, "Reserved for Experimental Use"}, + { 0x7FFD, "Reserved for Experimental Use"}, + { 0x7FFE, "Reserved for Experimental Use"}, + { 0x7FFF, "Reserved for Experimental Use"}, { 0, NULL } }; -static dissector_table_t ppp_subdissector_table; static dissector_table_t mpls_subdissector_table; /* @@ -391,8 +419,7 @@ dissect_pw_ach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { call_dissector(dissector_ip, next_tvb, pinfo, tree); } - else if (0x7 == channel_type /*PWACH-encapsulated BFD, draft-ietf-pwe3-vccv-bfd-05 3.2*/ - || mpls_pref_pwac_all_as_bfd_xipv4) + else if (0x7 == channel_type /*PWACH-encapsulated BFD, RFC 5885*/) { call_dissector(dissector_bfd, next_tvb, pinfo, tree); } @@ -400,20 +427,6 @@ dissect_pw_ach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { call_dissector(dissector_ipv6, next_tvb, pinfo, tree); } - else if (0x0 == channel_type && mpls_pref_pwac_0x0_as_bfd) - { - call_dissector(dissector_bfd, next_tvb, pinfo, tree); - } - else if (mpls_pref_pwac_try_ppp) - { - /* XXX perhaps this code should be reconsidered */ - /* non-standard extension, therefore controlled by option*/ - /* appeared in revision 10862 from Carlos M. Pignataro */ - if (!dissector_try_uint(ppp_subdissector_table, channel_type, - next_tvb, pinfo, tree)) { - call_dissector(dissector_data, next_tvb, pinfo, tree); - } - } else { call_dissector(dissector_data, next_tvb, pinfo, tree); @@ -757,6 +770,21 @@ dissect_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } offset += 4; + + if (label == LABEL_GACH && !bos) + { + proto_tree_add_text(tree, tvb, 0, -1, "Invalid Label"); + } + + if (label == LABEL_GACH && bos) { + strcpy(PW_ACH,"Generic Associated Channel Header"); + next_tvb = tvb_new_subset_remaining(tvb, offset); + dissect_pw_ach( next_tvb, pinfo, tree ); + return; + } + else + strcpy(PW_ACH,"PW Associated Channel Header"); + if (bos) break; } @@ -782,7 +810,7 @@ dissect_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) call_dissector(dissector_pw_hdlc_nocw_fr, next_tvb, pinfo, tree); break; case MDD_MPLS_PW_HDLC_NOCW_HDLC_PPP: - call_dissector(dissector_pw_hdlc_nocw_hdlc_ppp, next_tvb, pinfo, tree); + call_dissector(dissector_pw_hdlc_nocw_hdlc_ppp,next_tvb, pinfo, tree); break; case MDD_MPLS_PW_ETH_CW: call_dissector(dissector_pw_eth_cw, next_tvb, pinfo, tree); @@ -909,7 +937,7 @@ proto_register_mpls(void) FT_UINT32, BASE_DEC); proto_mpls = proto_register_protocol("MultiProtocol Label Switching Header", "MPLS", "mpls"); - proto_pw_ach = proto_register_protocol("PW Associated Channel Header", + proto_pw_ach = proto_register_protocol(PW_ACH, "PW Associated Channel", "pwach"); proto_pw_mcw = proto_register_protocol("PW MPLS Control Word (generic/preferred)", "Generic PW (with CW)", "pwmcw"); @@ -928,49 +956,16 @@ proto_register_mpls(void) &mpls_default_payload, mpls_default_payload_defs, FALSE ); - prefs_register_bool_preference(module_mpls - ,"mplspref.pwac_0x0_as_bfd" - ,"Assume PWAC Channel Type 0x0 is raw BFD" - ,"draft-ietf-pwe3-vccv-bfd-05 states that PWAC Channel Type 0x07 must be used" - " when VCCV carries PW-ACH-encapsulated BFD (i.e., BFD without IP/UDP Headers, or \"raw\" BFD)" - "\n\n" - "Legacy or buggy devices may not comply to this and use Channel Type 0x0 for BFD." - " Enable this preference to decode such BFD traffic." - " Disable for standard behavior of PWAC dissector (default)." - ,&mpls_pref_pwac_0x0_as_bfd); - prefs_register_bool_preference(module_mpls - ,"mplspref.pwac_all_as_bfd_xip" - ,"Assume that all PWAC Channel Types (except 0x21) are raw BFD" - ,"draft-ietf-pwe3-vccv-bfd-05 states that PWAC Channel Type 0x07 must be used" - " when VCCV carries PW-ACH-encapsulated BFD (i.e., \"raw\" BFD)" - "\n\n" - "Legacy or buggy devices may not comply to this and use voluntary Channel Type for BFD." - " Enable this preference to decode all PWAC Channel Types as raw BFD," - " except Channel Type 0x21 (IPv4)." - " Disable for standard behavior of PWAC dissector (default)." - ,&mpls_pref_pwac_all_as_bfd_xipv4); - prefs_register_bool_preference(module_mpls - ,"mplspref.pwac_try_ppp" - ,"As a last resort, try to decode PWAC payloads as PPP traffic" - ,"Legacy devices may use MPLS PW Associated Channel for PPP traffic." - "\n\n" - "Enable this preference to allow PWAC dissector to try PPP," - " if no other suitable dissector found (default)." - ,&mpls_pref_pwac_try_ppp); -} + } void proto_reg_handoff_mpls(void) { dissector_handle_t mpls_handle; - ppp_subdissector_table = find_dissector_table("ppp.protocol"); - mpls_handle = find_dissector("mpls"); dissector_add_uint("ethertype", ETHERTYPE_MPLS, mpls_handle); dissector_add_uint("ethertype", ETHERTYPE_MPLS_MULTI, mpls_handle); - dissector_add_uint("ppp.protocol", PPP_MPLS_UNI, mpls_handle); - dissector_add_uint("ppp.protocol", PPP_MPLS_MULTI, mpls_handle); dissector_add_uint("chdlctype", ETHERTYPE_MPLS, mpls_handle); dissector_add_uint("chdlctype", ETHERTYPE_MPLS_MULTI, mpls_handle); dissector_add_uint("gre.proto", ETHERTYPE_MPLS, mpls_handle); @@ -987,7 +982,6 @@ proto_reg_handoff_mpls(void) dissector_pw_eth_heuristic = find_dissector("pw_eth_heuristic"); dissector_pw_fr = find_dissector("pw_fr"); dissector_pw_hdlc_nocw_fr = find_dissector("pw_hdlc_nocw_fr"); - dissector_pw_hdlc_nocw_hdlc_ppp = find_dissector("pw_hdlc_nocw_hdlc_ppp"); dissector_pw_eth_cw = find_dissector("pw_eth_cw"); dissector_pw_eth_nocw = find_dissector("pw_eth_nocw"); dissector_pw_satop = find_dissector("pw_satop_mpls"); diff --git a/epan/dissectors/packet-mpls.h b/epan/dissectors/packet-mpls.h index 238599dbc1..46e330a313 100644 --- a/epan/dissectors/packet-mpls.h +++ b/epan/dissectors/packet-mpls.h @@ -5,6 +5,8 @@ * * (c) Copyright 2006, _FF_ Francesco Fondelli * added MPLS OAM support, ITU-T Y.1711 + * (c) Copyright 2011, Shobhank Sharma + * added MPLS Generic Associated Channel as per RFC 5586 * * $Id$ * @@ -38,7 +40,8 @@ enum { LABEL_IMPLICIT_NULL, LABEL_OAM_ALERT = 14, LABEL_MAX_RESERVED = 15, - LABEL_INVALID = 0xffffffff + LABEL_GACH = 13, + LABEL_INVALID = 0xffffffff }; extern const value_string special_labels[];