diff options
-rw-r--r-- | packet-isis-hello.c | 55 | ||||
-rw-r--r-- | packet-isis-hello.h | 6 | ||||
-rw-r--r-- | packet-isis-lsp.c | 51 | ||||
-rw-r--r-- | packet-isis-lsp.h | 5 | ||||
-rw-r--r-- | packet-isis-snp.c | 69 | ||||
-rw-r--r-- | packet-isis-snp.h | 9 | ||||
-rw-r--r-- | packet-isis.c | 11 |
7 files changed, 81 insertions, 125 deletions
diff --git a/packet-isis-hello.c b/packet-isis-hello.c index 1f42efa3c9..061ff9db27 100644 --- a/packet-isis-hello.c +++ b/packet-isis-hello.c @@ -1,7 +1,7 @@ /* packet-isis-hello.c * Routines for decoding isis hello packets and their CLVs * - * $Id: packet-isis-hello.c,v 1.22 2001/11/26 04:52:50 hagbard Exp $ + * $Id: packet-isis-hello.c,v 1.23 2001/12/20 07:33:21 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -21,8 +21,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * */ #ifdef HAVE_CONFIG_H @@ -43,7 +41,6 @@ #include "packet-isis-hello.h" /* hello packets */ -static int proto_isis_hello = -1; static int hf_isis_hello_circuit_reserved = -1; static int hf_isis_hello_source_id = -1; static int hf_isis_hello_holding_timer = -1; @@ -68,8 +65,6 @@ static gint ett_isis_hello_clv_ipv6_int_addr = -1; static gint ett_isis_hello_clv_ptp_adj = -1; static gint ett_isis_hello_clv_mt = -1; -static dissector_handle_t data_handle; - static const value_string isis_hello_circuit_type_vals[] = { { ISIS_HELLO_TYPE_RESERVED, "Reserved 0 (discard PDU)"}, { ISIS_HELLO_TYPE_LEVEL_1, "Level 1 only"}, @@ -280,7 +275,7 @@ static const isis_clv_handle_t clv_ptp_hello_opts[] = { }, { ISIS_CLV_PTP_ADJ, - "point-to-point Adjacency State", + "Point-to-point Adjacency State", &ett_isis_hello_clv_ptp_adj, dissect_hello_ptp_adj_clv }, @@ -618,14 +613,9 @@ isis_dissect_isis_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 pdu_length; const guint8 *lan_id; - if (!proto_is_protocol_enabled(proto_isis_hello)) { - call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, tree); - return; - } - if (tree) { - ti = proto_tree_add_item(tree, proto_isis_hello, tvb, - offset, tvb_length_remaining(tvb, offset), FALSE); + ti = proto_tree_add_text(tree, tvb, offset, + tvb_length_remaining(tvb, offset), "ISIS HELLO"); hello_tree = proto_item_add_subtree(ti, ett_isis_hello); octet = tvb_get_guint8(tvb, offset); proto_tree_add_uint_format(hello_tree, @@ -718,60 +708,58 @@ isis_dissect_isis_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } /* - * Name: proto_register_isis_hello() + * Name: isis_register_hello() * * Description: * Register our protocol sub-sets with protocol manager. - * NOTE: this procedure is autolinked by the makefile process that - * builds register.c * * Input: - * void + * int : protocol index for the ISIS protocol * * Output: * void */ void -proto_register_isis_hello(void) { +isis_register_hello(int proto_isis) { static hf_register_info hf[] = { { &hf_isis_hello_circuit_reserved, - { "Circuit type ", "isis_hello.circuite_type", + { "Circuit type ", "isis.hello.circuit_type", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL }}, { &hf_isis_hello_source_id, - { "SystemID{ Sender of PDU } ", "isis_hello.source_id", + { "SystemID{ Sender of PDU } ", "isis.hello.source_id", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL }}, { &hf_isis_hello_holding_timer, - { "Holding timer ", "isis_hello.holding_timer", + { "Holding timer ", "isis.hello.holding_timer", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, { &hf_isis_hello_pdu_length, - { "PDU length ", "isis_hello.pdu_length", + { "PDU length ", "isis.hello.pdu_length", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, { &hf_isis_hello_priority_reserved, - { "Priority ", "isis_hello.priority", + { "Priority ", "isis.hello.priority", FT_UINT8, BASE_DEC, NULL, ISIS_HELLO_P_RESERVED_MASK, "", HFILL }}, { &hf_isis_hello_lan_id, - { "SystemID{ Designated IS } ", "isis_hello.lan_id", + { "SystemID{ Designated IS } ", "isis.hello.lan_id", FT_BYTES, BASE_DEC, NULL, 0x0, "", HFILL }}, { &hf_isis_hello_local_circuit_id, - { "Local circuit ID ", "isis_hello.local_circuit_id", + { "Local circuit ID ", "isis.hello.local_circuit_id", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL }}, { &hf_isis_hello_clv_ipv4_int_addr, - { "IPv4 interface address ", "isis_hello.clv_ipv4_int_addr", + { "IPv4 interface address ", "isis.hello.clv_ipv4_int_addr", FT_IPv4, BASE_NONE, NULL, 0x0, "", HFILL }}, { &hf_isis_hello_clv_ipv6_int_addr, - { "IPv6 interface address ", "isis_hello.clv_ipv6_int_addr", + { "IPv6 interface address ", "isis.hello.clv_ipv6_int_addr", FT_IPv6, BASE_NONE, NULL, 0x0, "", HFILL }}, { &hf_isis_hello_clv_ptp_adj, - { "point-to-point Adjacency ", "isis_hello.clv_ptp_adj", + { "Point-to-point Adjacency ", "isis.hello.clv_ptp_adj", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL }}, }; @@ -789,13 +777,6 @@ proto_register_isis_hello(void) { &ett_isis_hello_clv_mt }; - proto_isis_hello = proto_register_protocol("ISIS HELLO", - "ISIS HELLO", "isis_hello"); - proto_register_field_array(proto_isis_hello, hf, array_length(hf)); + proto_register_field_array(proto_isis, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } - -void -proto_reg_handoff_isis_hello(void){ - data_handle = find_dissector("data"); -} diff --git a/packet-isis-hello.h b/packet-isis-hello.h index cf1f030529..25edc4172b 100644 --- a/packet-isis-hello.h +++ b/packet-isis-hello.h @@ -1,7 +1,7 @@ /* packet-isis-hello.h * Declares for hello handling inside isis. * - * $Id: packet-isis-hello.h,v 1.5 2001/07/02 00:19:34 guy Exp $ + * $Id: packet-isis-hello.h,v 1.6 2001/12/20 07:33:21 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -21,8 +21,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * */ #ifndef _PACKET_ISIS_HELLO_H @@ -100,4 +98,6 @@ extern void isis_dissect_isis_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int hello_type, int header_length,int id_length); +extern void isis_register_hello(int proto_isis); + #endif /* _PACKET_ISIS_HELLO_H */ diff --git a/packet-isis-lsp.c b/packet-isis-lsp.c index 9a795333ac..f17b7c8058 100644 --- a/packet-isis-lsp.c +++ b/packet-isis-lsp.c @@ -1,7 +1,7 @@ /* packet-isis-lsp.c * Routines for decoding isis lsp packets and their CLVs * - * $Id: packet-isis-lsp.c,v 1.21 2001/11/26 04:52:50 hagbard Exp $ + * $Id: packet-isis-lsp.c,v 1.22 2001/12/20 07:33:21 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -21,8 +21,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * */ #ifdef HAVE_CONFIG_H @@ -51,7 +49,6 @@ #include "resolv.h" /* lsp packets */ -static int proto_isis_lsp = -1; static int hf_isis_lsp_pdu_length = -1; static int hf_isis_lsp_remaining_life = -1; static int hf_isis_lsp_sequence_number = -1; @@ -86,8 +83,6 @@ static gint ett_isis_lsp_clv_mt = -1; static gint ett_isis_lsp_clv_mt_is = -1; static gint ett_isis_lsp_part_of_clv_mt_is = -1; -static dissector_handle_t data_handle; - static const char *isis_lsp_attached_bits[] = { "error", "expense", "delay", "default" }; @@ -1614,14 +1609,9 @@ isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, char sbuf[128]; int inx, q, some, value, len; - if (!proto_is_protocol_enabled(proto_isis_lsp)) { - call_dissector(data_handle,tvb_new_subset(tvb, offset, -1, tvb_reported_length_remaining(tvb,offset)),pinfo, tree); - return; - } - if (tree) { - ti = proto_tree_add_item(tree, proto_isis_lsp, tvb, - offset, tvb_length_remaining(tvb, offset), FALSE); + ti = proto_tree_add_text(tree, tvb, offset, + tvb_length_remaining(tvb, offset), PROTO_STRING_LSP); lsp_tree = proto_item_add_subtree(ti, ett_isis_lsp); } @@ -1712,42 +1702,46 @@ isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } } /* - * Name: proto_register_isis_lsp() + * Name: isis_register_lsp() * * Description: * Register our protocol sub-sets with protocol manager. - * NOTE: this procedure is autolinked by the makefile process that - * builds register.c + * + * Input: + * int : protocol index for the ISIS protocol + * + * Output: + * void */ void -proto_register_isis_lsp(void) { +isis_register_lsp(int proto_isis) { static hf_register_info hf[] = { { &hf_isis_lsp_pdu_length, - { "PDU length", "isis_lsp.pdu_length", FT_UINT16, + { "PDU length", "isis.lsp.pdu_length", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, { &hf_isis_lsp_remaining_life, - { "Remaining lifetime", "isis_lsp.remaining_life", FT_UINT16, + { "Remaining lifetime", "isis.lsp.remaining_life", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, { &hf_isis_lsp_sequence_number, - { "Sequence number", "isis_lsp.sequence_number", + { "Sequence number", "isis.lsp.sequence_number", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, { &hf_isis_lsp_checksum, - { "Checksum", "isis_lsp.checksum",FT_UINT16, + { "Checksum", "isis.lsp.checksum",FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL }}, { &hf_isis_lsp_clv_ipv4_int_addr, - { "IPv4 interface address", "isis_lsp.clv_ipv4_int_addr", FT_IPv4, + { "IPv4 interface address", "isis.lsp.clv_ipv4_int_addr", FT_IPv4, BASE_NONE, NULL, 0x0, "", HFILL }}, { &hf_isis_lsp_clv_ipv6_int_addr, - { "IPv6 interface address", "isis_lsp.clv_ipv6_int_addr", FT_IPv6, + { "IPv6 interface address", "isis.lsp.clv_ipv6_int_addr", FT_IPv6, BASE_NONE, NULL, 0x0, "", HFILL }}, { &hf_isis_lsp_clv_te_router_id, - { "Traffic Engineering Router ID", "isis_lsp.clv_te_router_id", FT_IPv4, + { "Traffic Engineering Router ID", "isis.lsp.clv_te_router_id", FT_IPv4, BASE_NONE, NULL, 0x0, "", HFILL }}, }; static gint *ett[] = { @@ -1777,13 +1771,6 @@ proto_register_isis_lsp(void) { &ett_isis_lsp_part_of_clv_mt_is, }; - proto_isis_lsp = proto_register_protocol(PROTO_STRING_LSP, - "ISIS LSP", "isis_lsp"); - proto_register_field_array(proto_isis_lsp, hf, array_length(hf)); + proto_register_field_array(proto_isis, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } - -void -proto_reg_handoff_isis_lsp(void){ - data_handle = find_dissector("data"); -} diff --git a/packet-isis-lsp.h b/packet-isis-lsp.h index 6011ee8f4b..57424c154f 100644 --- a/packet-isis-lsp.h +++ b/packet-isis-lsp.h @@ -1,7 +1,7 @@ /* packet-isis-lsp.h * Defines and such for LSP and their CLV decodes * - * $Id: packet-isis-lsp.h,v 1.10 2001/08/22 18:00:40 guy Exp $ + * $Id: packet-isis-lsp.h,v 1.11 2001/12/20 07:33:21 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -21,8 +21,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * */ #ifndef _PACKET_ISIS_LSP_H @@ -115,5 +113,6 @@ extern void isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, int hello_type, int header_length, int id_length); extern void isis_lsp_decode_lsp_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, char *tstr, int id_length); +extern void isis_register_lsp(int proto_isis); #endif /* _PACKET_ISIS_LSP_H */ diff --git a/packet-isis-snp.c b/packet-isis-snp.c index e4e25c09f9..2d7e1c0030 100644 --- a/packet-isis-snp.c +++ b/packet-isis-snp.c @@ -1,13 +1,12 @@ /* packet-isis-snp.c * Routines for decoding isis complete & partial SNP and their payload * - * $Id: packet-isis-snp.c,v 1.11 2001/11/26 04:52:50 hagbard Exp $ + * $Id: packet-isis-snp.c,v 1.12 2001/12/20 07:33:21 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 Gerald Combs - * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -22,8 +21,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * */ #ifdef HAVE_CONFIG_H @@ -45,7 +42,6 @@ #include "packet-isis-snp.h" /* csnp packets */ -static int proto_isis_csnp = -1; static int hf_isis_csnp_pdu_length = -1; static gint ett_isis_csnp = -1; static gint ett_isis_csnp_lsp_entries = -1; @@ -53,15 +49,12 @@ static gint ett_isis_csnp_authentication = -1; static gint ett_isis_csnp_clv_unknown = -1; /* psnp packets */ -static int proto_isis_psnp = -1; static int hf_isis_psnp_pdu_length = -1; static gint ett_isis_psnp = -1; static gint ett_isis_psnp_lsp_entries = -1; static gint ett_isis_psnp_authentication = -1; static gint ett_isis_psnp_clv_unknown = -1; -static dissector_handle_t data_handle; - static void dissect_l1_snp_authentication_clv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int id_length, int length); @@ -254,14 +247,9 @@ isis_dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 pdu_length; int len; - if (!proto_is_protocol_enabled(proto_isis_csnp)) { - call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, tree); - return; - } - if (tree) { - ti = proto_tree_add_item(tree, proto_isis_csnp, tvb, - offset, tvb_length_remaining(tvb, offset), FALSE); + ti = proto_tree_add_text(tree, tvb, offset, + tvb_length_remaining(tvb, offset), PROTO_STRING_CSNP); csnp_tree = proto_item_add_subtree(ti, ett_isis_csnp); } @@ -335,14 +323,9 @@ isis_dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 pdu_length; int len; - if (!proto_is_protocol_enabled(proto_isis_psnp)) { - call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, tree); - return; - } - if (tree) { - ti = proto_tree_add_item(tree, proto_isis_psnp, tvb, - offset, tvb_length_remaining(tvb, offset), FALSE); + ti = proto_tree_add_text(tree, tvb, offset, + tvb_length_remaining(tvb, offset), PROTO_STRING_PSNP); psnp_tree = proto_item_add_subtree(ti, ett_isis_psnp); } @@ -434,19 +417,22 @@ dissect_l2_snp_authentication_clv(tvbuff_t *tvb, packet_info *pinfo, } /* - * Name: proto_register_isis_csnp() + * Name: isis_register_csnp() * * Description: * Register our protocol sub-sets with protocol manager. - * NOTE: this procedure is autolinked by the makefile process that - * builds register.c * + * Input: + * int : protocol index for the ISIS protocol + * + * Output: + * void */ void -proto_register_isis_csnp(void) { +isis_register_csnp(int proto_isis) { static hf_register_info hf[] = { { &hf_isis_csnp_pdu_length, - { "PDU length", "isis_csnp.pdu_length", FT_UINT16, + { "PDU length", "isis.csnp.pdu_length", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, }; static gint *ett[] = { @@ -456,26 +442,28 @@ proto_register_isis_csnp(void) { &ett_isis_csnp_clv_unknown, }; - proto_isis_csnp = proto_register_protocol(PROTO_STRING_CSNP, - "ISIS CSNP", "isis_csnp"); - proto_register_field_array(proto_isis_csnp, hf, array_length(hf)); + proto_register_field_array(proto_isis, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } /* - * Name: proto_register_isis_psnp() + * Name: isis_register_psnp() * * Description: * Register our protocol sub-sets with protocol manager. - * NOTE: this procedure is autolinked by the makefile process that - * builds register.c + * + * Input: + * int : protocol index for the ISIS protocol + * + * Output: + * void */ void -proto_register_isis_psnp(void) { +isis_register_psnp(int proto_isis) { static hf_register_info hf[] = { { &hf_isis_psnp_pdu_length, - { "PDU length", "isis_psnp.pdu_length", FT_UINT16, + { "PDU length", "isis.psnp.pdu_length", FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }}, }; static gint *ett[] = { @@ -485,13 +473,6 @@ proto_register_isis_psnp(void) { &ett_isis_psnp_clv_unknown, }; - proto_isis_psnp = proto_register_protocol(PROTO_STRING_PSNP, - "ISIS PSNP", "isis_psnp"); - proto_register_field_array(proto_isis_psnp, hf, array_length(hf)); + proto_register_field_array(proto_isis, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } - -void -proto_reg_handoff_isis_psnp(void){ - data_handle = find_dissector("data"); -} diff --git a/packet-isis-snp.h b/packet-isis-snp.h index 05b02f63c1..2fe5ba0ad2 100644 --- a/packet-isis-snp.h +++ b/packet-isis-snp.h @@ -1,13 +1,12 @@ /* packet-isis-snp.h * Defines and such for CSNP, PSNP, and their payloads * - * $Id: packet-isis-snp.h,v 1.3 2001/07/02 00:19:34 guy Exp $ + * $Id: packet-isis-snp.h,v 1.4 2001/12/20 07:33:21 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 Gerald Combs - * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -22,8 +21,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * */ #ifndef _PACKET_ISIS_SNP_H @@ -69,8 +66,10 @@ extern void isis_dissect_isis_csnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int type, int header_length, int id_length); +extern void isis_register_csnp(int proto_isis); extern void isis_dissect_isis_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int type, int header_length, int id_length); +extern void isis_register_psnp(int proto_isis); #endif /* _PACKET_ISIS_CSNP_H */ diff --git a/packet-isis.c b/packet-isis.c index 51ad2b2c92..ac050c0243 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.27 2001/12/10 00:25:29 guy Exp $ + * $Id: packet-isis.c,v 1.28 2001/12/20 07:33:21 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -314,6 +314,15 @@ proto_register_isis(void) { proto_isis = proto_register_protocol(PROTO_STRING_ISIS, "ISIS", "isis"); proto_register_field_array(proto_isis, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + /* + * Call registration routines for other source files in the ISIS + * dissector. + */ + isis_register_hello(proto_isis); + isis_register_lsp(proto_isis); + isis_register_csnp(proto_isis); + isis_register_psnp(proto_isis); } void |