aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders <anders.broman@ericsson.com>2017-11-14 15:41:32 +0100
committerMichael Mann <mmann78@netscape.net>2017-11-15 03:40:10 +0000
commit1810801a688eb5d15fb4a6bdaeb03a497abfdc47 (patch)
tree9e765927e539c2d05c05aa5ea67c794828be7a71
parent88d8fa7440f923905849338ee1bd70d238e799cd (diff)
Handle LINKTYPE_JUNIPER_ST 200.
Bug: 14195 Change-Id: Ic6be8e1f8169968c48376984c0d1a1a69c67f32a Reviewed-on: https://code.wireshark.org/review/24415 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-juniper.c41
-rw-r--r--wiretap/pcap-common.c2
-rw-r--r--wiretap/wtap.h1
3 files changed, 39 insertions, 5 deletions
diff --git a/epan/dissectors/packet-juniper.c b/epan/dissectors/packet-juniper.c
index 45830f7..8d6e60b 100644
--- a/epan/dissectors/packet-juniper.c
+++ b/epan/dissectors/packet-juniper.c
@@ -514,7 +514,7 @@ static int
dissect_juniper_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *juniper_subtree, guint8 *flags)
{
proto_item *tisub, *magic_item;
- guint8 l2hdr_presence,proto,ext_type,ext_len;
+ guint8 proto,ext_type,ext_len;
guint16 ext_total_len,ext_offset=6,hdr_len;
guint32 magic_number,ext_val;
@@ -522,7 +522,6 @@ dissect_juniper_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, prot
magic_number = tvb_get_ntoh24(tvb, 0);
*flags = tvb_get_guint8(tvb, 3);
- l2hdr_presence = *flags & JUNIPER_FLAG_NO_L2;
magic_item = proto_tree_add_item(juniper_subtree, hf_juniper_magic, tvb, 0, 3, ENC_BIG_ENDIAN);
@@ -536,7 +535,7 @@ dissect_juniper_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, prot
proto_tree_add_item(juniper_subtree, hf_juniper_direction, tvb, 3, 1, ENC_NA);
- proto_tree_add_uint(juniper_subtree, hf_juniper_l2hdr_presence, tvb, 3, 1, l2hdr_presence);
+ proto_tree_add_item(juniper_subtree, hf_juniper_l2hdr_presence, tvb, 3, 1, ENC_NA);
/* calculate hdr_len before cookie, payload */
@@ -1277,6 +1276,35 @@ static int dissect_juniper_vn(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tre
return tvb_captured_length(tvb);
}
+static int dissect_juniper_st(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_)
+{
+ proto_item *ti;
+ proto_tree* juniper_subtree;
+ guint offset = 0;
+ guint8 flags;
+
+ col_set_str(pinfo->cinfo, COL_PROTOCOL,
+ "Juniper Secure Tunnel Information");
+ col_clear(pinfo->cinfo, COL_INFO);
+
+ juniper_subtree = proto_tree_add_subtree(tree, tvb, offset, 70,
+ ett_juniper, &ti, "Juniper Secure Tunnel Information");
+
+ /* bytes_processed = */ dissect_juniper_header(tvb, pinfo, tree, juniper_subtree, &flags);
+
+ /*offset += bytes_processed;*/
+
+ /* Skip the meta data
+ * XXX dissect_juniper_payload_proto(tvb, pinfo, tree, juniper_subtree, JUNIPER_PROTO_ETHER, offset);
+ * There seems to be ethernet,ip and part of ESP header in the meta data but next header is "wrong"
+ * Skip for now
+ */
+ dissect_juniper_payload_proto(tvb, pinfo, tree, juniper_subtree, JUNIPER_PROTO_IP, 70);
+
+ return tvb_captured_length(tvb);
+
+}
+
/* list of Juniper supported PPP proto IDs */
static gboolean
@@ -1432,10 +1460,10 @@ proto_register_juniper(void)
NULL, 0x0, NULL, HFILL }},
{ &hf_juniper_direction,
{ "Direction", "juniper.direction", FT_UINT8, BASE_HEX,
- VALS(juniper_direction_vals), 0x0, NULL, HFILL }},
+ VALS(juniper_direction_vals), 0x01, NULL, HFILL }},
{ &hf_juniper_l2hdr_presence,
{ "L2 header presence", "juniper.l2hdr", FT_UINT8, BASE_HEX,
- VALS(juniper_l2hdr_presence_vals), 0x0, NULL, HFILL }},
+ VALS(juniper_l2hdr_presence_vals), 0x02, NULL, HFILL }},
{ &hf_juniper_ext_total_len,
{ "Extension(s) Total length", "juniper.ext_total_len", FT_UINT16, BASE_DEC,
NULL, 0x0, NULL, HFILL }},
@@ -1570,6 +1598,7 @@ proto_reg_handoff_juniper(void)
dissector_handle_t juniper_vp_handle;
dissector_handle_t juniper_svcs_handle;
dissector_handle_t juniper_vn_handle;
+ dissector_handle_t juniper_st_handle;
ipv4_handle = find_dissector_add_dependency("ip", proto_juniper);
@@ -1586,6 +1615,7 @@ proto_reg_handoff_juniper(void)
juniper_vp_handle = create_dissector_handle(dissect_juniper_vp, proto_juniper);
juniper_svcs_handle = create_dissector_handle(dissect_juniper_svcs, proto_juniper);
juniper_vn_handle = create_dissector_handle(dissect_juniper_vn, proto_juniper);
+ juniper_st_handle = create_dissector_handle(dissect_juniper_st, proto_juniper);
dissector_add_uint("wtap_encap", WTAP_ENCAP_JUNIPER_ATM2, juniper_atm2_handle);
dissector_add_uint("wtap_encap", WTAP_ENCAP_JUNIPER_ATM1, juniper_atm1_handle);
@@ -1600,6 +1630,7 @@ proto_reg_handoff_juniper(void)
dissector_add_uint("wtap_encap", WTAP_ENCAP_JUNIPER_VP, juniper_vp_handle);
dissector_add_uint("wtap_encap", WTAP_ENCAP_JUNIPER_SVCS, juniper_svcs_handle);
dissector_add_uint("wtap_encap", WTAP_ENCAP_JUNIPER_VN, juniper_vn_handle);
+ dissector_add_uint("wtap_encap", WTAP_ENCAP_JUNIPER_ST, juniper_st_handle);
dissector_add_for_decode_as_with_preference("udp.port", juniper_vn_handle);
}
diff --git a/wiretap/pcap-common.c b/wiretap/pcap-common.c
index dc42883..a37703c 100644
--- a/wiretap/pcap-common.c
+++ b/wiretap/pcap-common.c
@@ -361,6 +361,8 @@ static const struct {
{ 197, WTAP_ENCAP_ERF },
/* IPMB */
{ 199, WTAP_ENCAP_IPMB },
+ /* Juniper-private data link type, used for capturing data on a secure tunnel interface. */
+ { 200, WTAP_ENCAP_JUNIPER_ST },
/* Bluetooth HCI UART transport (part H:4) frames, like hcidump */
{ 201, WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR },
/* AX.25 packet with a 1-byte KISS header */
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index 52fb726..567c961 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -286,6 +286,7 @@ extern "C" {
#define WTAP_ENCAP_MA_WFP_CAPTURE_2V6 194
#define WTAP_ENCAP_MA_WFP_CAPTURE_AUTH_V4 195
#define WTAP_ENCAP_MA_WFP_CAPTURE_AUTH_V6 196
+#define WTAP_ENCAP_JUNIPER_ST 197
/* After adding new item here, please also add new item to encap_table_base array */