aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-juniper.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2006-08-17 20:24:05 +0000
committerAnders Broman <anders.broman@ericsson.com>2006-08-17 20:24:05 +0000
commitd221d6f2fc4d778e4b250aba4c39a5156cc521a2 (patch)
tree182a457d2a3e78bc1de13d6f1915d302737f9505 /epan/dissectors/packet-juniper.c
parent7d040193881dc431ec20e471189f99d16a4cbbf8 (diff)
From Hannes Gredler:
A patch that adds support for dissection of libpcap DLT_JUNIPER_VP frames. In addition i have fixed also the indent for DLT_JUNIPER_GGSN. svn path=/trunk/; revision=18940
Diffstat (limited to 'epan/dissectors/packet-juniper.c')
-rw-r--r--epan/dissectors/packet-juniper.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/epan/dissectors/packet-juniper.c b/epan/dissectors/packet-juniper.c
index ed089645b4..50576af102 100644
--- a/epan/dissectors/packet-juniper.c
+++ b/epan/dissectors/packet-juniper.c
@@ -1217,6 +1217,37 @@ static void dissect_juniper_ggsn(tvbuff_t* tvb, packet_info* pinfo, proto_tree*
}
+static void dissect_juniper_vp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
+
+ proto_item *ti;
+ guint offset = 0;
+ int bytes_processed;
+ guint8 flags;
+
+ if (check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "Juniper Voice PIC");
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_clear(pinfo->cinfo, COL_INFO);
+
+ ti = proto_tree_add_text (tree, tvb, offset, 4, "Juniper Voice PIC");
+
+ /* parse header, match mgc, extract flags and build first tree */
+ bytes_processed = dissect_juniper_header(tvb, pinfo, tree, ti, &flags);
+
+ if(bytes_processed == -1)
+ return;
+ else
+ offset+=bytes_processed;
+
+ /*
+ * Right know IPv4 is the only protocol we may encounter.
+ * For the future there should be sufficient space in the 18-byte
+ * empty header before payload starts.
+ */
+ dissect_juniper_payload_proto(tvb, pinfo, tree, ti, PROTO_IP, offset+18);
+}
+
+
/* list of Juniper supported PPP proto IDs */
static gboolean
ppp_heuristic_guess(guint16 proto) {
@@ -1450,6 +1481,7 @@ proto_reg_handoff_juniper(void)
dissector_handle_t juniper_frelay_handle;
dissector_handle_t juniper_chdlc_handle;
dissector_handle_t juniper_ggsn_handle;
+ dissector_handle_t juniper_vp_handle;
osinl_subdissector_table = find_dissector_table("osinl");
osinl_excl_subdissector_table = find_dissector_table("osinl.excl");
@@ -1474,6 +1506,7 @@ proto_reg_handoff_juniper(void)
juniper_frelay_handle = create_dissector_handle(dissect_juniper_frelay, proto_juniper);
juniper_chdlc_handle = create_dissector_handle(dissect_juniper_chdlc, proto_juniper);
juniper_ggsn_handle = create_dissector_handle(dissect_juniper_ggsn, proto_juniper);
+ juniper_vp_handle = create_dissector_handle(dissect_juniper_vp, proto_juniper);
dissector_add("wtap_encap", WTAP_ENCAP_JUNIPER_ATM2, juniper_atm2_handle);
dissector_add("wtap_encap", WTAP_ENCAP_JUNIPER_ATM1, juniper_atm1_handle);
@@ -1485,6 +1518,7 @@ proto_reg_handoff_juniper(void)
dissector_add("wtap_encap", WTAP_ENCAP_JUNIPER_FRELAY, juniper_frelay_handle);
dissector_add("wtap_encap", WTAP_ENCAP_JUNIPER_CHDLC, juniper_chdlc_handle);
dissector_add("wtap_encap", WTAP_ENCAP_JUNIPER_GGSN, juniper_ggsn_handle);
+ dissector_add("wtap_encap", WTAP_ENCAP_JUNIPER_VP, juniper_vp_handle);
}