aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-07-17 16:22:19 +0200
committerHarald Welte <laforge@gnumonks.org>2017-01-07 13:29:52 +0100
commit2ca1a84b3cab61b2c205de412214f2181664f899 (patch)
tree8ee2011b2d2a2d7c4cafb0c73636e9c23e515b64
parent8dde9224b808caf813c8749b82f8919c9a12b779 (diff)
l2tp: Introduce preference for default pseudowire
In some cases, the establishment of the L2TP session is not captured in the pcap file, and thus wireshark cannot determine the l2tp pseudowire to be used for decode. So rather than using a ocmpile-time hard-coded default of cisco hdlc, let's introduce a prference where the user can select the default pseudowire in such cases. Change-Id: I44a6373d4812c9ab5a919514273a41a2ab57142c
-rw-r--r--epan/dissectors/packet-l2tp.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/epan/dissectors/packet-l2tp.c b/epan/dissectors/packet-l2tp.c
index a37b9fc0a9..ca32f4df1e 100644
--- a/epan/dissectors/packet-l2tp.c
+++ b/epan/dissectors/packet-l2tp.c
@@ -318,7 +318,6 @@ static const enum_val_t l2tpv3_cookies[] = {
};
#define L2TPv3_COOKIE_DEFAULT 0
-#define L2TPv3_PROTOCOL_DEFAULT L2TPv3_PROTOCOL_CHDLC
#define L2TPv3_L2_SPECIFIC_NONE 0
#define L2TPv3_L2_SPECIFIC_DEFAULT 1
@@ -337,7 +336,22 @@ static const enum_val_t l2tpv3_l2_specifics[] = {
{NULL, NULL, 0}
};
+static const enum_val_t pseudowire_enumvals[] = {
+ {"ETH", "Ethernet", L2TPv3_PROTOCOL_ETH},
+ {"CHDLC", "Cisco HDLC", L2TPv3_PROTOCOL_CHDLC},
+ {"FR", "Frame Relay", L2TPv3_PROTOCOL_FR},
+ {"PPP", "PPP", L2TPv3_PROTOCOL_PPP},
+ {"IP", "Internet Protocol", L2TPv3_PROTOCOL_IP},
+ {"MPLS", "Multi Protocol Label Switching", L2TPv3_PROTOCOL_MPLS},
+ {"AAL5", "ATM Adaptation Layer 5", L2TPv3_PROTOCOL_AAL5},
+ {"LAPD", "Link Access Protocol D", L2TPv3_PROTOCOL_LAPD},
+ {"DMPT", "DOCSIS DMPT", L2TPv3_PROTOCOL_DOCSIS_DMPT},
+ {"EHDLC", "Ericsson HDLC/BP", L2TPv3_PROTOCOL_ERICSSON},
+ {NULL, NULL, 0}
+};
+
static gint l2tpv3_hdlc_ericsson = -1;
+static gint l2tpv3_default_pw = L2TPv3_PROTOCOL_CHDLC;
static gint l2tpv3_cookie = -1;
static gint l2tpv3_l2_specific = -1;
@@ -2581,7 +2595,7 @@ process_l2tpv3_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
l2_spec = L2TPv3_L2_SPECIFIC_NONE;
if (pw_type == -1)
- pw_type = L2TPv3_PROTOCOL_DEFAULT;
+ pw_type = l2tpv3_default_pw;
if (cookie_len == -1)
cookie_len = L2TPv3_COOKIE_DEFAULT;
@@ -3785,6 +3799,11 @@ proto_register_l2tp(void)
"Use Ericsson HDLC Flavor",
&l2tpv3_hdlc_ericsson);
+ prefs_register_enum_preference(l2tp_module, "default_pw",
+ "Default Pseudowire",
+ "Which pseudowire to assume in case session setup is not part of capture",
+ &l2tpv3_default_pw, pseudowire_enumvals, TRUE);
+
prefs_register_obsolete_preference(l2tp_module, "protocol");
prefs_register_string_preference(l2tp_module,"shared_secret","Shared Secret",