diff options
-rw-r--r-- | packet-clnp.c | 11 | ||||
-rw-r--r-- | packet-clnp.h | 4 | ||||
-rw-r--r-- | packet-esis.c | 10 | ||||
-rw-r--r-- | packet-esis.h | 5 | ||||
-rw-r--r-- | packet-isis.c | 10 | ||||
-rw-r--r-- | packet-isis.h | 5 | ||||
-rw-r--r-- | packet-osi.c | 27 |
7 files changed, 44 insertions, 28 deletions
diff --git a/packet-clnp.c b/packet-clnp.c index a28cce5ece..c8a54ad083 100644 --- a/packet-clnp.c +++ b/packet-clnp.c @@ -1,7 +1,7 @@ /* packet-clnp.c * Routines for ISO/OSI network and transport protocol packet disassembly * - * $Id: packet-clnp.c,v 1.2 2000/04/16 09:10:53 deniel Exp $ + * $Id: packet-clnp.c,v 1.3 2000/04/17 01:36:29 guy Exp $ * Laurent Deniel <deniel@worldnet.fr> * Ralf Schneider <Ralf.Schneider@t-online.de> * @@ -1478,7 +1478,7 @@ void dissect_cotp(const u_char *pd, int offset, frame_data *fd, * CLNP part / main entry point */ -void dissect_clnp(const u_char *pd, int offset, frame_data *fd, +static void dissect_clnp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { @@ -1768,3 +1768,10 @@ void proto_register_cotp(void) /* proto_register_field_array(proto_cotp, hf, array_length(hf));*/ proto_register_subtree_array(ett, array_length(ett)); } + +void +proto_reg_handoff_clnp(void) +{ + dissector_add("osinl", NLPID_ISO8473_CLNP, dissect_clnp); + dissector_add("osinl", NLPID_NULL, dissect_clnp); /* Inactive subset */ +} diff --git a/packet-clnp.h b/packet-clnp.h index 9d76fd0ff3..9adfe8aca2 100644 --- a/packet-clnp.h +++ b/packet-clnp.h @@ -1,7 +1,7 @@ /* packet-clnp.h * Defines and such for CLNP (and COTP) protocol decode. * - * $Id: packet-clnp.h,v 1.1 2000/04/15 22:11:08 guy Exp $ + * $Id: packet-clnp.h,v 1.2 2000/04/17 01:36:30 guy Exp $ * Ralf Schneider <Ralf.Schneider@t-online.de> * * Ethereal - Network traffic analyzer @@ -34,8 +34,6 @@ */ extern -void dissect_clnp( const u_char *, int, frame_data *, proto_tree * ); -extern void dissect_cotp(const u_char *, int, frame_data *, proto_tree *); #endif /* _PACKET_CLNP_H */ diff --git a/packet-esis.c b/packet-esis.c index 8186990714..52ff9d9c0e 100644 --- a/packet-esis.c +++ b/packet-esis.c @@ -2,7 +2,7 @@ * Routines for ISO/OSI End System to Intermediate System * Routeing Exchange Protocol ISO 9542. * - * $Id: packet-esis.c,v 1.1 2000/04/15 22:11:08 guy Exp $ + * $Id: packet-esis.c,v 1.2 2000/04/17 01:36:30 guy Exp $ * Ralf Schneider <Ralf.Schneider@t-online.de> * * Ethereal - Network traffic analyzer @@ -289,7 +289,7 @@ esis_dissect_redirect_pdu( u_char len, const u_char *pd, int offset, * Output: * void, but we will add to the proto_tree if it is not NULL. */ -void +static void dissect_esis(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { char *pdu_type_string = NULL; char *pdu_type_format_string = "PDU Type : %s (R:%s%s%s)"; @@ -436,3 +436,9 @@ proto_register_esis(void) { proto_register_field_array(proto_esis, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); }; + +void +proto_reg_handoff_esis(void) +{ + dissector_add("osinl", NLPID_ISO9542_ESIS, dissect_esis); +} diff --git a/packet-esis.h b/packet-esis.h index c6e49b24a7..cc145b7d7b 100644 --- a/packet-esis.h +++ b/packet-esis.h @@ -1,7 +1,7 @@ /* packet-esis.h * Defines and such for ESIS protocol decode. * - * $Id: packet-esis.h,v 1.1 2000/04/15 22:11:09 guy Exp $ + * $Id: packet-esis.h,v 1.2 2000/04/17 01:36:30 guy Exp $ * Ralf Schneider <Ralf.Schneider@t-online.de> * * Ethereal - Network traffic analyzer @@ -60,9 +60,6 @@ typedef struct { /* * published API functions */ -extern void dissect_esis(const u_char *pd, int offset, frame_data *fd, - proto_tree *tree); -extern void proto_register_esis(void); extern void esis_dissect_unknown(int offset,guint length, proto_tree *tree, frame_data *fd, char *fmat, ...); diff --git a/packet-isis.c b/packet-isis.c index ef764fbeb2..81fd5b80ac 100644 --- a/packet-isis.c +++ b/packet-isis.c @@ -2,7 +2,7 @@ * Routines for ISO/OSI network and transport protocol packet disassembly, core * bits. * - * $Id: packet-isis.c,v 1.7 2000/04/15 22:11:11 guy Exp $ + * $Id: packet-isis.c,v 1.8 2000/04/17 01:36:31 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -131,7 +131,7 @@ isis_dissect_unknown(int offset,guint length,proto_tree *tree,frame_data *fd, * Output: * void, but we will add to the proto_tree if it is not NULL. */ -void +static void dissect_isis(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { isis_hdr_t *ihdr; @@ -309,3 +309,9 @@ proto_register_isis(void) { proto_register_field_array(proto_isis, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } + +void +proto_reg_handoff_isis(void) +{ + dissector_add("osinl", NLPID_ISO10589_ISIS, dissect_isis); +} diff --git a/packet-isis.h b/packet-isis.h index 1c49542a9c..34ec6a0f23 100644 --- a/packet-isis.h +++ b/packet-isis.h @@ -1,7 +1,7 @@ /* packet-isis.h * Defines and such for core isis protcol decode. * - * $Id: packet-isis.h,v 1.3 2000/04/15 22:11:11 guy Exp $ + * $Id: packet-isis.h,v 1.4 2000/04/17 01:36:31 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -77,9 +77,6 @@ typedef struct { */ extern char *isis_address_to_string ( const u_char *pd, int offset, int len ); -extern void dissect_isis( const u_char *pd, int offset, frame_data *fd, - proto_tree *tree); -extern void proto_register_isis(void); extern void isis_dissect_unknown( int offset, guint length, proto_tree *tree, frame_data *fd, char *fmat, ...); diff --git a/packet-osi.c b/packet-osi.c index 29c55544f3..3bca500086 100644 --- a/packet-osi.c +++ b/packet-osi.c @@ -2,7 +2,7 @@ * Routines for ISO/OSI network and transport protocol packet disassembly * Main entrance point and common functions * - * $Id: packet-osi.c,v 1.32 2000/04/17 00:32:41 guy Exp $ + * $Id: packet-osi.c,v 1.33 2000/04/17 01:36:31 guy Exp $ * Laurent Deniel <deniel@worldnet.fr> * Ralf Schneider <Ralf.Schneider@t-online.de> * @@ -219,29 +219,25 @@ const value_string nlpid_vals[] = { { 0, NULL }, }; +static dissector_table_t subdissector_table; + void dissect_osi(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + /* do lookup with the subdissector table */ + if (dissector_try_port(subdissector_table, pd[offset], pd, offset, fd, tree)) + return; + switch (pd[offset]) { /* ESIS (X.25) is not currently decoded */ - case NLPID_ISO8473_CLNP: - case NLPID_NULL: /* "Inactive Subset" of ISO 8473 CLNP */ - dissect_clnp(pd, offset, fd, tree); - break; - case NLPID_ISO9542_ESIS: - dissect_esis(pd, offset, fd, tree); - break; case NLPID_ISO9542X25_ESIS: if (check_col(fd, COL_PROTOCOL)) { col_add_str(fd, COL_PROTOCOL, "ESIS (X.25)"); } dissect_data(pd, offset, fd, tree); break; - case NLPID_ISO10589_ISIS: - dissect_isis(pd, offset, fd, tree); - break; case NLPID_ISO10747_IDRP: if (check_col(fd, COL_PROTOCOL)) { col_add_str(fd, COL_PROTOCOL, "IDRP"); @@ -261,6 +257,15 @@ void dissect_osi(const u_char *pd, int offset, frame_data *fd, } /* dissect_osi */ void +proto_register_osi(void) +{ + /* There's no "OSI" protocol *per se*, but we do register a + dissector table so various protocols running at the + network layer can register themselves. */ + subdissector_table = register_dissector_table("osinl"); +} + +void proto_reg_handoff_osi(void) { dissector_add("llc.dsap", SAP_OSINL, dissect_osi); |