Register an "osinl" dissector table for ISO/IEC TR 9577 NLPID values,

and have dissectors for protocols that run at the OSI network layer
register themselves with it using "dissector_add()".

Make various dissectors static if they can be, and remove from header
files declarations of those dissectors.

svn path=/trunk/; revision=1873
This commit is contained in:
Guy Harris 2000-04-17 01:36:31 +00:00
parent 0ba3e2b233
commit 27ca639e86
7 changed files with 44 additions and 28 deletions

View File

@ -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 */
}

View File

@ -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
@ -33,8 +33,6 @@
* published API functions
*/
extern
void dissect_clnp( const u_char *, int, frame_data *, proto_tree * );
extern
void dissect_cotp(const u_char *, int, frame_data *, proto_tree *);

View File

@ -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);
}

View File

@ -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, ...);

View File

@ -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);
}

View File

@ -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, ...);

View File

@ -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");
@ -260,6 +256,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)
{