aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-osi.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-11-08 21:08:52 -0500
committerEvan Huus <eapache@gmail.com>2014-11-09 13:56:37 +0000
commitf7ac077630689d917e61aa7972f708fd45ce267b (patch)
tree530eece6fe465428ab8f9c7cbc25f9db356242ff /epan/dissectors/packet-osi.c
parent8153cbc56e0206f48c910c79b739e435a38e2b47 (diff)
Create a subdissector table for juniper payload protocols.
Change-Id: I60fd9c6c486b9b3b90e32fb9ccce3973569cc2ee Reviewed-on: https://code.wireshark.org/review/5204 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-osi.c')
-rw-r--r--epan/dissectors/packet-osi.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/epan/dissectors/packet-osi.c b/epan/dissectors/packet-osi.c
index 9abb99b628..b9ab88a209 100644
--- a/epan/dissectors/packet-osi.c
+++ b/epan/dissectors/packet-osi.c
@@ -38,6 +38,7 @@
#include <epan/ipproto.h>
#include "packet-osi.h"
#include "packet-tpkt.h"
+#include "packet-juniper.h"
void proto_reg_handoff_osi(void);
void proto_register_osi(void);
@@ -456,6 +457,19 @@ dissect_osi_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_tpkt_encap(tvb, pinfo, tree, tpkt_desegment, osi_handle);
}
+static void dissect_osi_juniper(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ guint8 nlpid;
+ tvbuff_t *next_tvb;
+
+ nlpid = tvb_get_guint8(tvb, 0);
+ if(dissector_try_uint(osinl_incl_subdissector_table, nlpid, tvb, pinfo, tree))
+ return;
+
+ next_tvb = tvb_new_subset_remaining(tvb, 1);
+ dissector_try_uint(osinl_excl_subdissector_table, nlpid, next_tvb, pinfo, tree);
+}
+
static void dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint8 nlpid;
@@ -498,7 +512,7 @@ void
proto_reg_handoff_osi(void)
{
static gboolean osi_prefs_initialized = FALSE;
- static dissector_handle_t osi_tpkt_handle;
+ static dissector_handle_t osi_tpkt_handle, osi_juniper_handle;
static guint tcp_port_osi_over_tpkt;
if (!osi_prefs_initialized) {
@@ -513,6 +527,12 @@ proto_reg_handoff_osi(void)
dissector_add_uint("null.type", BSD_AF_ISO, osi_handle);
dissector_add_uint("gre.proto", SAP_OSINL5, osi_handle);
dissector_add_uint("ip.proto", IP_PROTO_ISOIP, osi_handle); /* ISO-TP4 ISO Transport Protocol Class 4 [RFC905,RC77] */
+
+ osi_juniper_handle = create_dissector_handle(dissect_osi_juniper, proto_osi);
+ dissector_add_uint("juniper.proto", JUNIPER_PROTO_ISO, osi_juniper_handle);
+ dissector_add_uint("juniper.proto", JUNIPER_PROTO_CLNP, osi_juniper_handle);
+ dissector_add_uint("juniper.proto", JUNIPER_PROTO_MPLS_CLNP, osi_juniper_handle);
+
data_handle = find_dissector("data");
ppp_handle = find_dissector("ppp");