diff options
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | epan/packet.h | 4 | ||||
-rw-r--r-- | epan/proto.h | 4 | ||||
-rw-r--r-- | packet-atalk.c | 4 | ||||
-rw-r--r-- | packet-atm.c | 8 | ||||
-rw-r--r-- | packet-bpdu.c | 137 | ||||
-rw-r--r-- | packet-bpdu.h | 30 | ||||
-rw-r--r-- | packet-data.c | 9 | ||||
-rw-r--r-- | packet-ethertype.c | 4 | ||||
-rw-r--r-- | packet-fddi.c | 4 | ||||
-rw-r--r-- | packet-giop.c | 4 | ||||
-rw-r--r-- | packet-gre.c | 4 | ||||
-rw-r--r-- | packet-h1.c | 4 | ||||
-rw-r--r-- | packet-http.c | 8 | ||||
-rw-r--r-- | packet-ipp.c | 10 | ||||
-rw-r--r-- | packet-ipx.c | 6 | ||||
-rw-r--r-- | packet-isl.c | 4 | ||||
-rw-r--r-- | packet-lapd.c | 6 | ||||
-rw-r--r-- | packet-llc.c | 28 | ||||
-rw-r--r-- | packet-nbipx.c | 4 | ||||
-rw-r--r-- | packet-null.c | 4 | ||||
-rw-r--r-- | packet-pop.c | 4 | ||||
-rw-r--r-- | packet-ppp.c | 4 | ||||
-rw-r--r-- | packet-quake.c | 6 | ||||
-rw-r--r-- | packet-sip.c | 4 | ||||
-rw-r--r-- | packet-sscop.c | 4 | ||||
-rw-r--r-- | packet-tr.c | 4 | ||||
-rw-r--r-- | packet-v120.c | 4 | ||||
-rw-r--r-- | packet-x25.c | 4 | ||||
-rw-r--r-- | plugins/plugin_table.h | 4 |
30 files changed, 155 insertions, 172 deletions
diff --git a/Makefile.am b/Makefile.am index ce9a6c1de6..cfd263b1f8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ # Makefile.am # Automake file for Ethereal # -# $Id: Makefile.am,v 1.247 2000/11/15 08:27:14 guy Exp $ +# $Id: Makefile.am,v 1.248 2000/11/16 07:35:37 guy Exp $ # # Ethereal - Network traffic analyzer # By Gerald Combs <gerald@zing.org> @@ -188,7 +188,6 @@ noinst_HEADERS = \ packet-atm.h \ packet-bgp.h \ packet-bootparams.h \ - packet-bpdu.h \ packet-cdp.h \ packet-cgmp.h \ packet-clip.h \ diff --git a/epan/packet.h b/epan/packet.h index 6e9ca7e38b..e73245a79c 100644 --- a/epan/packet.h +++ b/epan/packet.h @@ -1,7 +1,7 @@ /* packet.h * Definitions for packet disassembly structures and routines * - * $Id: packet.h,v 1.5 2000/11/15 07:07:47 guy Exp $ + * $Id: packet.h,v 1.6 2000/11/16 07:35:42 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -327,7 +327,7 @@ void init_dissect_rpc(void); void dissect_packet(tvbuff_t **p_tvb, union wtap_pseudo_header *pseudo_header, const u_char *pd, frame_data *fd, proto_tree *tree); void old_dissect_data(const u_char *, int, frame_data *, proto_tree *); -void dissect_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); +void dissect_data(tvbuff_t *tvb, int, packet_info *pinfo, proto_tree *tree); /* These functions are in ethertype.c */ diff --git a/epan/proto.h b/epan/proto.h index 2c388db283..b68f789dd8 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -1,7 +1,7 @@ /* proto.h * Definitions for protocol display * - * $Id: proto.h,v 1.1 2000/09/27 04:54:52 gram Exp $ + * $Id: proto.h,v 1.2 2000/11/16 07:35:42 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -68,7 +68,7 @@ struct value_string; #define CHECK_DISPLAY_AS_DATA(index, tvb, pinfo, tree) { \ if (!proto_is_protocol_enabled(index)) { \ - dissect_data(tvb, pinfo, tree); \ + dissect_data(tvb, 0, pinfo, tree); \ return; \ } \ } diff --git a/packet-atalk.c b/packet-atalk.c index 6eb0587fc6..5e70302e75 100644 --- a/packet-atalk.c +++ b/packet-atalk.c @@ -1,7 +1,7 @@ /* packet-atalk.c * Routines for Appletalk packet disassembly (DDP, currently). * - * $Id: packet-atalk.c,v 1.43 2000/11/13 08:57:57 guy Exp $ + * $Id: packet-atalk.c,v 1.44 2000/11/16 07:35:37 guy Exp $ * * Simon Wilkinson <sxw@dcs.ed.ac.uk> * @@ -440,7 +440,7 @@ dissect_ddp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { new_tvb = tvb_new_subset(tvb, DDP_HEADER_SIZE, -1, -1); if (!dissector_try_port(ddp_dissector_table, ddp.type, new_tvb, pinfo, tree)) - dissect_data(new_tvb, pinfo, tree); + dissect_data(new_tvb, 0, pinfo, tree); } void diff --git a/packet-atm.c b/packet-atm.c index cb11f4ce34..44473c6388 100644 --- a/packet-atm.c +++ b/packet-atm.c @@ -1,7 +1,7 @@ /* packet-atm.c * Routines for ATM packet disassembly * - * $Id: packet-atm.c,v 1.25 2000/11/13 07:18:42 guy Exp $ + * $Id: packet-atm.c,v 1.26 2000/11/16 07:35:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -415,7 +415,7 @@ dissect_lane(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) default: /* Dump it as raw data. */ next_tvb = tvb_new_subset(tvb, 0, -1, -1); - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); break; } } @@ -748,7 +748,7 @@ dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) default: if (tree) { /* Dump it as raw data. */ - dissect_data(tvb, pinfo, tree); + dissect_data(tvb, 0, pinfo, tree); break; } } @@ -757,7 +757,7 @@ dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) default: if (tree) { /* Dump it as raw data. (Is this a single cell?) */ - dissect_data(tvb, pinfo, tree); + dissect_data(tvb, 0, pinfo, tree); } break; } diff --git a/packet-bpdu.c b/packet-bpdu.c index c7c75ef681..27b1b27ffe 100644 --- a/packet-bpdu.c +++ b/packet-bpdu.c @@ -1,7 +1,7 @@ /* packet-bpdu.c * Routines for BPDU (Spanning Tree Protocol) disassembly * - * $Id: packet-bpdu.c,v 1.13 2000/08/13 14:08:04 deniel Exp $ + * $Id: packet-bpdu.c,v 1.14 2000/11/16 07:35:37 guy Exp $ * * Copyright 1999 Christophe Tronche <ch.tronche@computer.org> * @@ -75,16 +75,19 @@ static int hf_bpdu_forward_delay = -1; static gint ett_bpdu = -1; -void dissect_bpdu(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { +static void +dissect_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint16 protocol_identifier; guint8 protocol_version_identifier; guint8 bpdu_type; guint8 flags; guint16 root_identifier_bridge_priority; - gchar *root_identifier_mac; + guint8 *root_identifier_mac; + gchar *root_identifier_mac_str; guint32 root_path_cost; guint16 bridge_identifier_bridge_priority; - gchar *bridge_identifier_mac; + guint8 *bridge_identifier_mac; + gchar *bridge_identifier_mac_str; guint16 port_identifier; double message_age; double max_age; @@ -93,54 +96,55 @@ void dissect_bpdu(const u_char *pd, int offset, frame_data *fd, proto_tree *tree proto_tree *bpdu_tree; proto_item *ti; - const u_char *bpdu; - OLD_CHECK_DISPLAY_AS_DATA(proto_bpdu, pd, offset, fd, tree); + CHECK_DISPLAY_AS_DATA(proto_bpdu, tvb, pinfo, tree); - bpdu = pd + offset; - bpdu_type = (guint8) bpdu[BPDU_TYPE]; - flags = (guint8) bpdu[BPDU_FLAGS]; - root_identifier_bridge_priority = pntohs(bpdu + BPDU_ROOT_IDENTIFIER); - root_identifier_mac = ether_to_str(bpdu + BPDU_ROOT_IDENTIFIER + 2); - root_path_cost = pntohl(bpdu + BPDU_ROOT_PATH_COST); - port_identifier = pntohs(bpdu + BPDU_PORT_IDENTIFIER); + pinfo->current_proto = "STP"; - if (check_col(fd, COL_PROTOCOL)) { - col_add_str(fd, COL_PROTOCOL, "STP"); /* Spanning Tree Protocol */ + bpdu_type = tvb_get_guint8(tvb, BPDU_TYPE); + flags = tvb_get_guint8(tvb, BPDU_FLAGS); + root_identifier_bridge_priority = tvb_get_ntohs(tvb, BPDU_ROOT_IDENTIFIER); + root_identifier_mac = tvb_get_ptr(tvb, BPDU_ROOT_IDENTIFIER + 2, 6); + root_identifier_mac_str = ether_to_str(root_identifier_mac); + root_path_cost = tvb_get_ntohl(tvb, BPDU_ROOT_PATH_COST); + port_identifier = tvb_get_ntohs(tvb, BPDU_PORT_IDENTIFIER); + + if (check_col(pinfo->fd, COL_PROTOCOL)) { + col_add_str(pinfo->fd, COL_PROTOCOL, "STP"); /* Spanning Tree Protocol */ } - if (check_col(fd, COL_INFO)) { + if (check_col(pinfo->fd, COL_INFO)) { if (bpdu_type == 0) - col_add_fstr(fd, COL_INFO, "Conf. %sRoot = %d/%s Cost = %d Port = 0x%04x", + col_add_fstr(pinfo->fd, COL_INFO, "Conf. %sRoot = %d/%s Cost = %d Port = 0x%04x", flags & 0x1 ? "TC + " : "", - root_identifier_bridge_priority, root_identifier_mac, root_path_cost, + root_identifier_bridge_priority, root_identifier_mac_str, root_path_cost, port_identifier); else if (bpdu_type == 0x80) - col_add_fstr(fd, COL_INFO, "Topology Change Notification"); + col_add_fstr(pinfo->fd, COL_INFO, "Topology Change Notification"); } if (tree) { - protocol_identifier = pntohs(bpdu + BPDU_IDENTIFIER); - protocol_version_identifier = (guint8) bpdu[BPDU_VERSION_IDENTIFIER]; + protocol_identifier = tvb_get_ntohs(tvb, BPDU_IDENTIFIER); + protocol_version_identifier = tvb_get_guint8(tvb, BPDU_VERSION_IDENTIFIER); - ti = proto_tree_add_protocol_format(tree, proto_bpdu, NullTVB, offset, 35, + ti = proto_tree_add_protocol_format(tree, proto_bpdu, tvb, 0, 35, "Spanning Tree Protocol"); bpdu_tree = proto_item_add_subtree(ti, ett_bpdu); - proto_tree_add_uint_format(bpdu_tree, hf_bpdu_proto_id, NullTVB, - offset + BPDU_IDENTIFIER, 2, + proto_tree_add_uint_format(bpdu_tree, hf_bpdu_proto_id, tvb, + BPDU_IDENTIFIER, 2, protocol_identifier, "Protocol Identifier: 0x%04x (%s)", protocol_identifier, protocol_identifier == 0 ? "Spanning Tree" : "Unknown Protocol"); - proto_tree_add_uint(bpdu_tree, hf_bpdu_version_id, NullTVB, - offset + BPDU_VERSION_IDENTIFIER, 1, + proto_tree_add_uint(bpdu_tree, hf_bpdu_version_id, tvb, + BPDU_VERSION_IDENTIFIER, 1, protocol_version_identifier); if (protocol_version_identifier != 0) - proto_tree_add_text(bpdu_tree, NullTVB, offset + BPDU_VERSION_IDENTIFIER, 1, " (Warning: this version of packet-bpdu only knows about version = 0)"); - proto_tree_add_uint_format(bpdu_tree, hf_bpdu_type, NullTVB, - offset + BPDU_TYPE, 1, + proto_tree_add_text(bpdu_tree, tvb, BPDU_VERSION_IDENTIFIER, 1, " (Warning: this version of packet-bpdu only knows about version = 0)"); + proto_tree_add_uint_format(bpdu_tree, hf_bpdu_type, tvb, + BPDU_TYPE, 1, bpdu_type, "BPDU Type: 0x%02x (%s)", bpdu_type, @@ -148,57 +152,58 @@ void dissect_bpdu(const u_char *pd, int offset, frame_data *fd, proto_tree *tree bpdu_type == 0x80 ? "Topology Change Notification" : "Unknown"); if (bpdu_type != 0) { - old_dissect_data(pd, offset + BPDU_TYPE + 1, fd, tree); + dissect_data(tvb, BPDU_TYPE + 1, pinfo, tree); return; } - bridge_identifier_bridge_priority = pntohs(bpdu + BPDU_BRIDGE_IDENTIFIER); - bridge_identifier_mac = ether_to_str(bpdu + BPDU_BRIDGE_IDENTIFIER + 2); - message_age = pntohs(bpdu + BPDU_MESSAGE_AGE) / 256.0; - max_age = pntohs(bpdu + BPDU_MAX_AGE) / 256.0; - hello_time = pntohs(bpdu + BPDU_HELLO_TIME) / 256.0; - forward_delay = pntohs(bpdu + BPDU_FORWARD_DELAY) / 256.0; + bridge_identifier_bridge_priority = tvb_get_ntohs(tvb, BPDU_BRIDGE_IDENTIFIER); + bridge_identifier_mac = tvb_get_ptr(tvb, BPDU_BRIDGE_IDENTIFIER + 2, 6); + bridge_identifier_mac_str = ether_to_str(bridge_identifier_mac); + message_age = tvb_get_ntohs(tvb, BPDU_MESSAGE_AGE) / 256.0; + max_age = tvb_get_ntohs(tvb, BPDU_MAX_AGE) / 256.0; + hello_time = tvb_get_ntohs(tvb, BPDU_HELLO_TIME) / 256.0; + forward_delay = tvb_get_ntohs(tvb, BPDU_FORWARD_DELAY) / 256.0; - proto_tree_add_uint(bpdu_tree, hf_bpdu_flags, NullTVB, - offset + BPDU_FLAGS, 1, flags); + proto_tree_add_uint(bpdu_tree, hf_bpdu_flags, tvb, + BPDU_FLAGS, 1, flags); if (flags & 0x80) - proto_tree_add_text(bpdu_tree, NullTVB, offset + BPDU_FLAGS, 1, " 1... .... Topology Change Acknowledgment"); + proto_tree_add_text(bpdu_tree, tvb, BPDU_FLAGS, 1, " 1... .... Topology Change Acknowledgment"); if (flags & 0x01) - proto_tree_add_text(bpdu_tree, NullTVB, offset + BPDU_FLAGS, 1, " .... ...1 Topology Change"); + proto_tree_add_text(bpdu_tree, tvb, BPDU_FLAGS, 1, " .... ...1 Topology Change"); - proto_tree_add_ether_hidden(bpdu_tree, hf_bpdu_root_mac, NullTVB, - offset + BPDU_ROOT_IDENTIFIER + 2, 6, - bpdu + BPDU_ROOT_IDENTIFIER + 2); - proto_tree_add_text(bpdu_tree, NullTVB, - offset + BPDU_ROOT_IDENTIFIER, 8, + proto_tree_add_ether_hidden(bpdu_tree, hf_bpdu_root_mac, tvb, + BPDU_ROOT_IDENTIFIER + 2, 6, + root_identifier_mac); + proto_tree_add_text(bpdu_tree, tvb, + BPDU_ROOT_IDENTIFIER, 8, "Root Identifier: %d / %s", root_identifier_bridge_priority, - root_identifier_mac); - proto_tree_add_uint(bpdu_tree, hf_bpdu_root_cost, NullTVB, - offset + BPDU_ROOT_PATH_COST, 4, + root_identifier_mac_str); + proto_tree_add_uint(bpdu_tree, hf_bpdu_root_cost, tvb, + BPDU_ROOT_PATH_COST, 4, root_path_cost); - proto_tree_add_text(bpdu_tree, NullTVB, - offset + BPDU_BRIDGE_IDENTIFIER, 8, + proto_tree_add_text(bpdu_tree, tvb, + BPDU_BRIDGE_IDENTIFIER, 8, "Bridge Identifier: %d / %s", bridge_identifier_bridge_priority, - bridge_identifier_mac); - proto_tree_add_ether_hidden(bpdu_tree, hf_bpdu_bridge_mac, NullTVB, - offset + BPDU_BRIDGE_IDENTIFIER + 2, 6, - bpdu + BPDU_BRIDGE_IDENTIFIER + 2); - proto_tree_add_uint(bpdu_tree, hf_bpdu_port_id, NullTVB, - offset + BPDU_PORT_IDENTIFIER, 2, + bridge_identifier_mac_str); + proto_tree_add_ether_hidden(bpdu_tree, hf_bpdu_bridge_mac, tvb, + BPDU_BRIDGE_IDENTIFIER + 2, 6, + bridge_identifier_mac); + proto_tree_add_uint(bpdu_tree, hf_bpdu_port_id, tvb, + BPDU_PORT_IDENTIFIER, 2, port_identifier); - proto_tree_add_double(bpdu_tree, hf_bpdu_msg_age, NullTVB, - offset + BPDU_MESSAGE_AGE, 2, + proto_tree_add_double(bpdu_tree, hf_bpdu_msg_age, tvb, + BPDU_MESSAGE_AGE, 2, message_age); - proto_tree_add_double(bpdu_tree, hf_bpdu_max_age, NullTVB, - offset + BPDU_MAX_AGE, 2, + proto_tree_add_double(bpdu_tree, hf_bpdu_max_age, tvb, + BPDU_MAX_AGE, 2, max_age); - proto_tree_add_double(bpdu_tree, hf_bpdu_hello_time, NullTVB, - offset + BPDU_HELLO_TIME, 2, + proto_tree_add_double(bpdu_tree, hf_bpdu_hello_time, tvb, + BPDU_HELLO_TIME, 2, hello_time); - proto_tree_add_double(bpdu_tree, hf_bpdu_forward_delay, NullTVB, - offset + BPDU_FORWARD_DELAY, 2, + proto_tree_add_double(bpdu_tree, hf_bpdu_forward_delay, tvb, + BPDU_FORWARD_DELAY, 2, forward_delay); } } @@ -264,10 +269,12 @@ proto_register_bpdu(void) proto_bpdu = proto_register_protocol("Spanning Tree Protocol", "stp"); proto_register_field_array(proto_bpdu, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + register_dissector("bpdu", dissect_bpdu); } void proto_reg_handoff_bpdu(void) { - old_dissector_add("llc.dsap", SAP_BPDU, dissect_bpdu); + dissector_add("llc.dsap", SAP_BPDU, dissect_bpdu); } diff --git a/packet-bpdu.h b/packet-bpdu.h deleted file mode 100644 index 4f00c751c1..0000000000 --- a/packet-bpdu.h +++ /dev/null @@ -1,30 +0,0 @@ -/* packet-bpdu.h - * - * $Id: packet-bpdu.h,v 1.2 2000/08/11 13:34:17 deniel Exp $ - * - * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> - * 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 - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * 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_BPDU_H__ -#define __PACKET_BPDU_H__ - -void dissect_bpdu(const u_char *, int, frame_data *, proto_tree *); - -#endif diff --git a/packet-data.c b/packet-data.c index fcdbb956e5..82b0e0801e 100644 --- a/packet-data.c +++ b/packet-data.c @@ -2,7 +2,7 @@ * Routines for raw data (default case) * Gilbert Ramirez <gram@xiexie.org> * - * $Id: packet-data.c,v 1.19 2000/08/07 03:20:27 guy Exp $ + * $Id: packet-data.c,v 1.20 2000/11/16 07:35:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -52,14 +52,15 @@ old_dissect_data(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } void -dissect_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +dissect_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { int bytes; if (tree) { - bytes = tvb_length(tvb); + bytes = tvb_length_remaining(tvb, offset); if (bytes > 0) { - proto_tree_add_protocol_format(tree, proto_data, tvb, 0, + proto_tree_add_protocol_format(tree, proto_data, tvb, + offset, bytes, "Data (%d byte%s)", bytes, plurality(bytes, "", "s")); } diff --git a/packet-ethertype.c b/packet-ethertype.c index 529edfb6d0..3ffcd0e2c3 100644 --- a/packet-ethertype.c +++ b/packet-ethertype.c @@ -1,7 +1,7 @@ /* ethertype.c * Routines for calling the right protocol for the ethertype. * - * $Id: packet-ethertype.c,v 1.7 2000/08/09 22:10:23 deniel Exp $ + * $Id: packet-ethertype.c,v 1.8 2000/11/16 07:35:37 guy Exp $ * * Gilbert Ramirez <gram@xiexie.org> * @@ -114,7 +114,7 @@ ethertype(guint16 etype, tvbuff_t *tvb, int offset_after_etype, packet_info *pin next_tvb, pinfo, tree)) { /* No sub-dissector found. Label rest of packet as "Data" */ - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); /* Label protocol */ switch(etype) { diff --git a/packet-fddi.c b/packet-fddi.c index b92e037bdb..7fb6a1b5bb 100644 --- a/packet-fddi.c +++ b/packet-fddi.c @@ -3,7 +3,7 @@ * * Laurent Deniel <deniel@worldnet.fr> * - * $Id: packet-fddi.c,v 1.39 2000/11/15 09:37:49 guy Exp $ + * $Id: packet-fddi.c,v 1.40 2000/11/16 07:35:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -317,7 +317,7 @@ dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, return; default : - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); return; } /* fc */ diff --git a/packet-giop.c b/packet-giop.c index e0e0af9e27..c2a365e10f 100644 --- a/packet-giop.c +++ b/packet-giop.c @@ -4,7 +4,7 @@ * Laurent Deniel <deniel@worldnet.fr> * Craig Rodrigues <rodrigc@mediaone.net> * - * $Id: packet-giop.c,v 1.24 2000/11/15 20:10:20 guy Exp $ + * $Id: packet-giop.c,v 1.25 2000/11/16 07:35:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -1286,7 +1286,7 @@ dissect_giop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) header.GIOP_version.major, header.GIOP_version.minor); } - dissect_data (payload_tvb, pinfo, tree); + dissect_data (payload_tvb, 0, pinfo, tree); return TRUE; } diff --git a/packet-gre.c b/packet-gre.c index 1d503ecf06..2af23462a8 100644 --- a/packet-gre.c +++ b/packet-gre.c @@ -2,7 +2,7 @@ * Routines for the Generic Routing Encapsulation (GRE) protocol * Brad Robel-Forrest <brad.robel-forrest@watchguard.com> * - * $Id: packet-gre.c,v 1.25 2000/08/13 14:08:11 deniel Exp $ + * $Id: packet-gre.c,v 1.26 2000/11/16 07:35:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -227,7 +227,7 @@ dissect_gre(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { break; default: next_tvb = tvb_create_from_top(offset); - dissect_data(next_tvb, &pi, gre_tree); + dissect_data(next_tvb, 0, &pi, gre_tree); break; } } diff --git a/packet-h1.c b/packet-h1.c index 981c6063ff..69448481fe 100644 --- a/packet-h1.c +++ b/packet-h1.c @@ -2,7 +2,7 @@ * Routines for Sinec H1 packet disassembly * Gerrit Gehnen <G.Gehnen@atrie.de> * - * $Id: packet-h1.c,v 1.12 2000/08/13 14:08:11 deniel Exp $ + * $Id: packet-h1.c,v 1.13 2000/11/16 07:35:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -242,7 +242,7 @@ static gboolean dissect_h1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) position += tvb_get_guint8(tvb,offset + position + 1); /* Goto next section */ } /* ..while */ next_tvb = tvb_new_subset(tvb, offset+tvb_get_guint8(tvb,offset+2), -1, -1); - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); return TRUE; } diff --git a/packet-http.c b/packet-http.c index f43f8d17fc..7cdc060b76 100644 --- a/packet-http.c +++ b/packet-http.c @@ -3,7 +3,7 @@ * * Guy Harris <guy@alum.mit.edu> * - * $Id: packet-http.c,v 1.27 2000/11/15 08:27:14 guy Exp $ + * $Id: packet-http.c,v 1.28 2000/11/16 07:35:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -218,9 +218,9 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) datalen = tvb_length_remaining(tvb, offset); if (datalen > 0) { - tvbuff_t *new_tvb = tvb_new_subset(tvb, offset, -1, -1); - if (is_ipp) { + tvbuff_t *new_tvb = tvb_new_subset(tvb, offset, -1, -1); + /* * Fix up the top-level item so that it doesn't * include the IPP stuff. @@ -230,7 +230,7 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) call_dissector(ipp_handle, new_tvb, pinfo, tree); } else - dissect_data(new_tvb, pinfo, http_tree); + dissect_data(tvb, offset, pinfo, http_tree); } } diff --git a/packet-ipp.c b/packet-ipp.c index 4bd9fab7e0..8244d66d2d 100644 --- a/packet-ipp.c +++ b/packet-ipp.c @@ -3,7 +3,7 @@ * * Guy Harris <guy@alum.mit.edu> * - * $Id: packet-ipp.c,v 1.15 2000/11/15 08:27:14 guy Exp $ + * $Id: packet-ipp.c,v 1.16 2000/11/16 07:35:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -235,12 +235,8 @@ dissect_ipp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset = parse_attributes(tvb, offset, ipp_tree); - if (tvb_offset_exists(tvb, offset)) { - proto_tree_add_text(ipp_tree, tvb, offset, - tvb_length_remaining(tvb, offset), - "Data (%d bytes)", - tvb_length_remaining(tvb, offset)); - } + if (tvb_offset_exists(tvb, offset)) + dissect_data(tvb, offset, pinfo, ipp_tree); } } diff --git a/packet-ipx.c b/packet-ipx.c index 083006b588..308efde1b6 100644 --- a/packet-ipx.c +++ b/packet-ipx.c @@ -2,7 +2,7 @@ * Routines for NetWare's IPX * Gilbert Ramirez <gram@xiexie.org> * - * $Id: packet-ipx.c,v 1.66 2000/11/10 21:09:49 guy Exp $ + * $Id: packet-ipx.c,v 1.67 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -386,7 +386,7 @@ dissect_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (dissector_try_port(ipx_socket_dissector_table, ipx_ssocket, next_tvb, pinfo, tree)) return; - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); } @@ -472,7 +472,7 @@ dissect_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(spx_tree, hf_spx_all_nr, tvb, 10, 2, FALSE); next_tvb = tvb_new_subset(tvb, SPX_HEADER_LEN, -1, -1); - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); } } diff --git a/packet-isl.c b/packet-isl.c index 9d312ec054..7bae35db44 100644 --- a/packet-isl.c +++ b/packet-isl.c @@ -1,7 +1,7 @@ /* packet-isl.c * Routines for Cisco ISL Ethernet header disassembly * - * $Id: packet-isl.c,v 1.15 2000/08/13 14:08:23 deniel Exp $ + * $Id: packet-isl.c,v 1.16 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -234,7 +234,7 @@ dissect_isl(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) default: next_tvb = tvb_create_from_top(offset+26); - dissect_data(next_tvb, &pi, tree); + dissect_data(next_tvb, 0, &pi, tree); break; } } diff --git a/packet-lapd.c b/packet-lapd.c index 68f0a4b0ae..671d50bb3d 100644 --- a/packet-lapd.c +++ b/packet-lapd.c @@ -2,7 +2,7 @@ * Routines for LAPD frame disassembly * Gilbert Ramirez <gram@xiexie.org> * - * $Id: packet-lapd.c,v 1.14 2000/09/21 04:41:07 gram Exp $ + * $Id: packet-lapd.c,v 1.15 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -153,11 +153,11 @@ dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; default: - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); break; } } else - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); } void diff --git a/packet-llc.c b/packet-llc.c index 5135ec64f5..f1481cff29 100644 --- a/packet-llc.c +++ b/packet-llc.c @@ -2,7 +2,7 @@ * Routines for IEEE 802.2 LLC layer * Gilbert Ramirez <gram@xiexie.org> * - * $Id: packet-llc.c,v 1.69 2000/08/25 06:31:25 guy Exp $ + * $Id: packet-llc.c,v 1.70 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -38,7 +38,6 @@ #include "xdlc.h" #include "etypes.h" #include "llcsaps.h" -#include "packet-bpdu.h" #include "packet-cdp.h" #include "packet-cgmp.h" #include "packet-ip.h" @@ -63,6 +62,8 @@ static gint ett_llc_ctrl = -1; static dissector_table_t subdissector_table; +static dissector_handle_t bpdu_handle; + typedef void (capture_func_t)(const u_char *, int, packet_counts *); /* The SAP info is split into two tables, one value_string table and one @@ -357,7 +358,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ethertype(etype, tvb, 8, pinfo, tree, llc_tree, hf_llc_type); } else - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); break; case OUI_CISCO: @@ -392,11 +393,11 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; default: - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); break; } } else - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); break; case OUI_CABLE_BPDU: /* DOCSIS cable modem spanning tree BPDU */ @@ -404,7 +405,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint(llc_tree, hf_llc_pid, tvb, 6, 2, etype); } - dissect_bpdu(pd, offset, pinfo->fd, tree); + call_dissector(bpdu_handle, next_tvb, pinfo, tree); break; default: @@ -412,7 +413,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint(llc_tree, hf_llc_pid, tvb, 6, 2, etype); } - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); break; } } @@ -435,10 +436,10 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* do lookup with the subdissector table */ if (!dissector_try_port(subdissector_table, dsap, next_tvb, pinfo, tree)) { - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); } } else { - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); } } } @@ -495,3 +496,12 @@ proto_register_llc(void) /* subdissector code */ subdissector_table = register_dissector_table("llc.dsap"); } + +void +proto_reg_handoff_llc(void) +{ + /* + * Get a handle for the BPDU dissector. + */ + bpdu_handle = find_dissector("bpdu"); +} diff --git a/packet-nbipx.c b/packet-nbipx.c index 420bf4a637..b5d2fa832a 100644 --- a/packet-nbipx.c +++ b/packet-nbipx.c @@ -2,7 +2,7 @@ * Routines for NetBIOS over IPX packet disassembly * Gilbert Ramirez <gram@xiexie.org> * - * $Id: packet-nbipx.c,v 1.26 2000/11/13 08:58:03 guy Exp $ + * $Id: packet-nbipx.c,v 1.27 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -429,7 +429,7 @@ dissect_nwlink_dg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; default: - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); break; } } diff --git a/packet-null.c b/packet-null.c index e9ef7d0b23..648bb790d0 100644 --- a/packet-null.c +++ b/packet-null.c @@ -1,7 +1,7 @@ /* packet-null.c * Routines for null packet disassembly * - * $Id: packet-null.c,v 1.29 2000/11/13 04:50:07 guy Exp $ + * $Id: packet-null.c,v 1.30 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -308,7 +308,7 @@ dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; default: - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); break; } } diff --git a/packet-pop.c b/packet-pop.c index c41ccfcd1a..7ef52d47aa 100644 --- a/packet-pop.c +++ b/packet-pop.c @@ -2,7 +2,7 @@ * Routines for pop packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-pop.c,v 1.19 2000/11/13 08:58:07 guy Exp $ + * $Id: packet-pop.c,v 1.20 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -113,7 +113,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * Put the whole packet into the tree as data. */ - dissect_data(tvb, pinfo, pop_tree); + dissect_data(tvb, 0, pinfo, pop_tree); return; } diff --git a/packet-ppp.c b/packet-ppp.c index 6ec222100d..06f97d33d6 100644 --- a/packet-ppp.c +++ b/packet-ppp.c @@ -1,7 +1,7 @@ /* packet-ppp.c * Routines for ppp packet disassembly * - * $Id: packet-ppp.c,v 1.39 2000/08/13 14:08:38 deniel Exp $ + * $Id: packet-ppp.c,v 1.40 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -1019,7 +1019,7 @@ dissect_ppp_stuff( tvbuff_t *tvb, packet_info *pinfo, if (check_col(pinfo->fd, COL_INFO)) col_add_fstr(pinfo->fd, COL_INFO, "PPP %s (0x%04x)", val_to_str(ppp_prot, ppp_vals, "Unknown"), ppp_prot); - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); return FALSE; } } diff --git a/packet-quake.c b/packet-quake.c index 39f5de363a..4389b5ff28 100644 --- a/packet-quake.c +++ b/packet-quake.c @@ -4,7 +4,7 @@ * Uwe Girlich <uwe@planetquake.com> * http://www.idsoftware.com/q1source/q1source.zip * - * $Id: packet-quake.c,v 1.7 2000/10/21 05:52:21 guy Exp $ + * $Id: packet-quake.c,v 1.8 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -499,7 +499,7 @@ dissect_quake_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) (next_tvb, pinfo, control_tree); break; default: - dissect_data(next_tvb, pinfo, control_tree); + dissect_data(next_tvb, 0, pinfo, control_tree); break; } } @@ -586,7 +586,7 @@ dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) rest_length = tvb_reported_length(tvb) - 8; next_tvb = tvb_new_subset(tvb, 8, rest_length , rest_length); - dissect_data(next_tvb, pinfo, quake_tree); + dissect_data(next_tvb, 0, pinfo, quake_tree); } void diff --git a/packet-sip.c b/packet-sip.c index 771c6bef4b..f671f4042f 100644 --- a/packet-sip.c +++ b/packet-sip.c @@ -7,7 +7,7 @@ * * Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi> * - * $Id: packet-sip.c,v 1.5 2000/11/15 07:07:44 guy Exp $ + * $Id: packet-sip.c,v 1.6 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -128,7 +128,7 @@ static void dissect_sip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) bad: next_tvb = tvb_new_subset(tvb, offset, -1, -1); - dissect_data(tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); return; } diff --git a/packet-sscop.c b/packet-sscop.c index 72c9eeb97d..259460e88e 100644 --- a/packet-sscop.c +++ b/packet-sscop.c @@ -2,7 +2,7 @@ * Routines for SSCOP (Q.2110, Q.SAAL) frame disassembly * Guy Harris <guy@alum.mit.edu> * - * $Id: packet-sscop.c,v 1.10 2000/08/13 14:09:03 deniel Exp $ + * $Id: packet-sscop.c,v 1.11 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -310,7 +310,7 @@ dissect_sscop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (pdu_type == SSCOP_SD) dissect_q2931(next_tvb, pinfo, tree); else - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); } break; } diff --git a/packet-tr.c b/packet-tr.c index f6451bd1a7..f6bed0f1d0 100644 --- a/packet-tr.c +++ b/packet-tr.c @@ -2,7 +2,7 @@ * Routines for Token-Ring packet disassembly * Gilbert Ramirez <gram@xiexie.org> * - * $Id: packet-tr.c,v 1.48 2000/11/13 05:11:16 guy Exp $ + * $Id: packet-tr.c,v 1.49 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -528,7 +528,7 @@ dissect_tr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; default: /* non-MAC, non-LLC, i.e., "Reserved" */ - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); break; } } diff --git a/packet-v120.c b/packet-v120.c index 6d38647502..41485ecde4 100644 --- a/packet-v120.c +++ b/packet-v120.c @@ -2,7 +2,7 @@ * Routines for v120 frame disassembly * Bert Driehuis <driehuis@playbeing.org> * - * $Id: packet-v120.c,v 1.12 2000/08/13 14:07:53 deniel Exp $ + * $Id: packet-v120.c,v 1.13 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -145,7 +145,7 @@ dissect_v120(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) v120len += dissect_v120_header(tvb, v120len, pinfo, v120_tree); proto_item_set_len(ti, v120len); next_tvb = tvb_new_subset(tvb, v120len, -1, -1); - dissect_data(next_tvb, pinfo, v120_tree); + dissect_data(next_tvb, 0, pinfo, v120_tree); } } diff --git a/packet-x25.c b/packet-x25.c index d1e78263d8..5cfee0201a 100644 --- a/packet-x25.c +++ b/packet-x25.c @@ -2,7 +2,7 @@ * Routines for x25 packet disassembly * Olivier Abad <oabad@cybercable.fr> * - * $Id: packet-x25.c,v 1.35 2000/08/13 14:09:13 deniel Exp $ + * $Id: packet-x25.c,v 1.36 2000/11/16 07:35:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -1933,7 +1933,7 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) dissect_ip(next_pd, next_offset, pinfo->fd, tree); } else { - dissect_data(next_tvb, pinfo, tree); + dissect_data(next_tvb, 0, pinfo, tree); } } } diff --git a/plugins/plugin_table.h b/plugins/plugin_table.h index a3fed7fa4a..126e205955 100644 --- a/plugins/plugin_table.h +++ b/plugins/plugin_table.h @@ -1,7 +1,7 @@ /* plugin_table.h * Table of exported addresses for Ethereal plugins. * - * $Id: plugin_table.h,v 1.9 2000/11/15 07:07:50 guy Exp $ + * $Id: plugin_table.h,v 1.10 2000/11/16 07:35:43 guy Exp $ * * Ethereal - Network traffic analyzer * Copyright 2000 by Gilbert Ramirez <gram@xiexie.org> @@ -56,7 +56,7 @@ typedef void (*addr_old_call_dissector)(dissector_handle_t, const u_char *, typedef void (*addr_call_dissector)(dissector_handle_t, tvbuff_t *, packet_info *, proto_tree *); -typedef void (*addr_dissect_data)(tvbuff_t *, packet_info *, proto_tree *); +typedef void (*addr_dissect_data)(tvbuff_t *, int, packet_info *, proto_tree *); typedef void (*addr_old_dissect_data)(const u_char *, int, frame_data *, proto_tree *); typedef gboolean (*addr_proto_is_protocol_enabled)(int); |