From ee3072b1292e6b00cf80c5c496a409ff07ae33d4 Mon Sep 17 00:00:00 2001 From: hagbard Date: Sun, 25 Nov 2001 22:19:25 +0000 Subject: [PATCH] Switched from calling dissect_data to using call_dissector git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4263 f5534014-38df-0310-8fa8-9805f1628bb7 --- packet-quake.c | 8 +++++--- packet-quake2.c | 8 +++++--- packet-quake3.c | 8 +++++--- packet-quakeworld.c | 9 +++++---- packet-sip.c | 6 ++++-- packet-skinny.c | 7 +++++-- packet-sll.c | 6 ++++-- packet-sscop.c | 6 ++++-- packet-v120.c | 7 +++++-- packet-x25.c | 6 ++++-- 10 files changed, 46 insertions(+), 25 deletions(-) diff --git a/packet-quake.c b/packet-quake.c index 920d864423..e148b1eddb 100644 --- a/packet-quake.c +++ b/packet-quake.c @@ -4,7 +4,7 @@ * Uwe Girlich * http://www.idsoftware.com/q1source/q1source.zip * - * $Id: packet-quake.c,v 1.18 2001/09/03 10:33:06 guy Exp $ + * $Id: packet-quake.c,v 1.19 2001/11/25 22:19:24 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -80,6 +80,7 @@ static gint ett_quake_control = -1; static gint ett_quake_control_colors = -1; static gint ett_quake_flags = -1; +static dissector_handle_t data_handle; /* I took these names directly out of the Q1 source. */ #define NETFLAG_LENGTH_MASK 0x0000ffff @@ -501,7 +502,7 @@ dissect_quake_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) (next_tvb, pinfo, control_tree); break; default: - dissect_data(next_tvb, 0, pinfo, control_tree); + call_dissector(data_handle,next_tvb, pinfo, control_tree); break; } } @@ -595,7 +596,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, 0, pinfo, quake_tree); + call_dissector(data_handle,next_tvb, pinfo, quake_tree); } @@ -616,6 +617,7 @@ proto_reg_handoff_quake(void) dissector_add("udp.port", gbl_quakeServerPort, dissect_quake, proto_quake); + data_handle = find_dissector("data"); } diff --git a/packet-quake2.c b/packet-quake2.c index fc7b602f6d..78e39ecc94 100644 --- a/packet-quake2.c +++ b/packet-quake2.c @@ -7,7 +7,7 @@ * http://www.dgs.monash.edu.au/~timf/bottim/ * http://www.opt-sci.Arizona.EDU/Pandora/default.asp * - * $Id: packet-quake2.c,v 1.2 2001/07/22 18:52:38 girlich Exp $ + * $Id: packet-quake2.c,v 1.3 2001/11/25 22:19:24 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -64,6 +64,7 @@ static gint ett_quake2_game_seq2 = -1; static gint ett_quake2_game_clc = -1; static gint ett_quake2_game_svc = -1; +static dissector_handle_t data_handle; #define PORT_MASTER 27910 static unsigned int gbl_quake2ServerPort=PORT_MASTER; @@ -120,7 +121,7 @@ dissect_quake2_client_commands(tvbuff_t *tvb, packet_info *pinfo, the information from my DM2 specs: http://www.planetquake.com/demospecs/dm2/ */ - dissect_data(tvb, 0, pinfo, tree); + call_dissector(data_handle,tvb, pinfo, tree); } @@ -132,7 +133,7 @@ dissect_quake2_server_commands(tvbuff_t *tvb, packet_info *pinfo, the information from my DM2 specs: http://www.planetquake.com/demospecs/dm2/ */ - dissect_data(tvb, 0, pinfo, tree); + call_dissector(data_handle,tvb, pinfo, tree); } @@ -347,6 +348,7 @@ proto_reg_handoff_quake2(void) dissector_add("udp.port", gbl_quake2ServerPort, dissect_quake2, proto_quake2); + data_handle = find_dissector("data"); } diff --git a/packet-quake3.c b/packet-quake3.c index e3796827d6..fea1d62a68 100644 --- a/packet-quake3.c +++ b/packet-quake3.c @@ -3,7 +3,7 @@ * * Uwe Girlich * - * $Id: packet-quake3.c,v 1.4 2001/10/13 07:43:25 guy Exp $ + * $Id: packet-quake3.c,v 1.5 2001/11/25 22:19:24 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -77,6 +77,7 @@ static gint ett_quake3_game_seq2 = -1; static gint ett_quake3_game_clc = -1; static gint ett_quake3_game_svc = -1; +static dissector_handle_t data_handle; #define QUAKE3_SERVER_PORT 27960 #define QUAKE3_MASTER_PORT 27950 @@ -353,7 +354,7 @@ dissect_quake3_client_commands(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* this shouldn't be too difficult */ - dissect_data(tvb, 0, pinfo, tree); + call_dissector(data_handle,tvb, pinfo, tree); } @@ -363,7 +364,7 @@ dissect_quake3_server_commands(tvbuff_t *tvb, packet_info *pinfo, { /* It is totally forbidden to decode this any further, I wont do it. */ - dissect_data(tvb, 0, pinfo, tree); + call_dissector(data_handle,tvb, pinfo, tree); } @@ -580,6 +581,7 @@ proto_reg_handoff_quake3(void) for (i=0;i<4;i++) dissector_add("udp.port", gbl_quake3_master_port + i, dissect_quake3, proto_quake3); + data_handle = find_dissector("data"); } diff --git a/packet-quakeworld.c b/packet-quakeworld.c index bc9500a9f8..b052638cff 100644 --- a/packet-quakeworld.c +++ b/packet-quakeworld.c @@ -4,7 +4,7 @@ * Uwe Girlich * http://www.idsoftware.com/q1source/q1source.zip * - * $Id: packet-quakeworld.c,v 1.4 2001/07/22 18:51:51 girlich Exp $ + * $Id: packet-quakeworld.c,v 1.5 2001/11/25 22:19:24 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -77,7 +77,7 @@ static gint ett_quakeworld_game_seq2 = -1; static gint ett_quakeworld_game_clc = -1; static gint ett_quakeworld_game_svc = -1; - +static dissector_handle_t data_handle; /* helper functions, they may ave to go somewhere else @@ -580,7 +580,7 @@ dissect_quakeworld_client_commands(tvbuff_t *tvb, packet_info *pinfo, the information from my QWD specs: http://www.planetquake.com/demospecs/qwd/ */ - dissect_data(tvb, 0, pinfo, tree); + call_dissector(data_handle,tvb, pinfo, tree); } @@ -592,7 +592,7 @@ dissect_quakeworld_server_commands(tvbuff_t *tvb, packet_info *pinfo, the information from my QWD specs: http://www.planetquake.com/demospecs/qwd/ */ - dissect_data(tvb, 0, pinfo, tree); + call_dissector(data_handle,tvb, pinfo, tree); } @@ -798,6 +798,7 @@ proto_reg_handoff_quakeworld(void) dissector_add("udp.port", gbl_quakeworldServerPort, dissect_quakeworld, proto_quakeworld); + data_handle = find_dissector("data"); } diff --git a/packet-sip.c b/packet-sip.c index 6c13520fbe..25b3216c17 100644 --- a/packet-sip.c +++ b/packet-sip.c @@ -15,7 +15,7 @@ * Copyright 2000, Heikki Vatiainen * Copyright 2001, Jean-Francois Mule * - * $Id: packet-sip.c,v 1.17 2001/10/26 18:28:16 gram Exp $ + * $Id: packet-sip.c,v 1.18 2001/11/25 22:19:24 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -78,6 +78,7 @@ static gboolean sip_is_request(tvbuff_t *tvb, guint32 offset); static gint sip_get_msg_offset(tvbuff_t *tvb, guint32 offset); static dissector_handle_t sdp_handle; +static dissector_handle_t data_handle; #define SIP2_HDR "SIP/2.0 " #define SIP2_HDR_LEN (strlen (SIP2_HDR)) @@ -153,7 +154,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(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); return; } @@ -227,4 +228,5 @@ proto_reg_handoff_sip(void) * Get a handle for the SDP dissector. */ sdp_handle = find_dissector("sdp"); + data_handle = find_dissector("data"); } diff --git a/packet-skinny.c b/packet-skinny.c index 0d3b7966b4..042ccb060f 100644 --- a/packet-skinny.c +++ b/packet-skinny.c @@ -7,7 +7,7 @@ * This file is based on packet-aim.c, which is * Copyright 2000, Ralf Hoelzer * - * $Id: packet-skinny.c,v 1.4 2001/10/20 18:42:01 guy Exp $ + * $Id: packet-skinny.c,v 1.5 2001/11/25 22:19:25 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -175,6 +175,8 @@ static int hf_skinny_messageid = -1; /* Initialize the subtree pointers */ static gint ett_skinny = -1; +static dissector_handle_t data_handle; + /* Code to actually dissect the packets */ static void dissect_skinny(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -204,7 +206,7 @@ static void dissect_skinny(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* hdr_data_length > 1024 is just a heuristic. Better values/checks welcome */ if (hdr_data_length < 4 || hdr_data_length > 1024 || hdr_reserved != 0) { /* Not an SKINNY packet, just happened to use the same port */ - dissect_data(tvb, 0, pinfo, tree); + call_dissector(data_handle,tvb, pinfo, tree); return; } @@ -289,5 +291,6 @@ proto_register_skinny(void) void proto_reg_handoff_skinny(void) { + data_handle = find_dissector("data"); dissector_add("tcp.port", TCP_PORT_SKINNY, &dissect_skinny, proto_skinny); } diff --git a/packet-sll.c b/packet-sll.c index ea5533e0f5..eabcd0b7bd 100644 --- a/packet-sll.c +++ b/packet-sll.c @@ -1,7 +1,7 @@ /* packet-sll.c * Routines for disassembly of packets from Linux "cooked mode" captures * - * $Id: packet-sll.c,v 1.12 2001/11/20 21:59:13 guy Exp $ + * $Id: packet-sll.c,v 1.13 2001/11/25 22:19:25 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -90,6 +90,7 @@ static const value_string ltype_vals[] = { static dissector_handle_t ipx_handle; static dissector_handle_t llc_handle; +static dissector_handle_t data_handle; void capture_sll(const u_char *pd, int len, packet_counts *ld) @@ -216,7 +217,7 @@ dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; default: - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); break; } } else { @@ -284,6 +285,7 @@ proto_reg_handoff_sll(void) */ llc_handle = find_dissector("llc"); ipx_handle = find_dissector("ipx"); + data_handle = find_dissector("data"); dissector_add("wtap_encap", WTAP_ENCAP_SLL, dissect_sll, proto_sll); } diff --git a/packet-sscop.c b/packet-sscop.c index 62f6d0cad1..38d5b5152b 100644 --- a/packet-sscop.c +++ b/packet-sscop.c @@ -2,7 +2,7 @@ * Routines for SSCOP (Q.2110, Q.SAAL) frame disassembly * Guy Harris * - * $Id: packet-sscop.c,v 1.15 2001/05/27 07:15:26 guy Exp $ + * $Id: packet-sscop.c,v 1.16 2001/11/25 22:19:25 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -42,6 +42,7 @@ static int proto_sscop = -1; static gint ett_sscop = -1; static dissector_handle_t q2931_handle; +static dissector_handle_t data_handle; /* * See @@ -307,7 +308,7 @@ dissect_sscop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (pdu_type == SSCOP_SD) call_dissector(q2931_handle, next_tvb, pinfo, tree); else - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); } break; } @@ -331,4 +332,5 @@ proto_reg_handoff_sscop(void) * Get handle for the Q.2931 dissector. */ q2931_handle = find_dissector("q2931"); + data_handle = find_dissector("data"); } diff --git a/packet-v120.c b/packet-v120.c index 3f31267fdc..863a0f637e 100644 --- a/packet-v120.c +++ b/packet-v120.c @@ -2,7 +2,7 @@ * Routines for v120 frame disassembly * Bert Driehuis * - * $Id: packet-v120.c,v 1.19 2001/06/18 02:17:53 guy Exp $ + * $Id: packet-v120.c,v 1.20 2001/11/25 22:19:25 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -50,6 +50,8 @@ static gint ett_v120_address = -1; static gint ett_v120_control = -1; static gint ett_v120_header = -1; +static dissector_handle_t data_handle; + static int dissect_v120_header(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree); static void @@ -142,7 +144,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, 0, pinfo, v120_tree); + call_dissector(data_handle,next_tvb, pinfo, v120_tree); } } @@ -233,6 +235,7 @@ proto_register_v120(void) void proto_reg_handoff_v120(void) { + data_handle = find_dissector("data"); dissector_add("wtap_encap", WTAP_ENCAP_V120, dissect_v120, proto_v120); } diff --git a/packet-x25.c b/packet-x25.c index bd84405d38..122411714e 100644 --- a/packet-x25.c +++ b/packet-x25.c @@ -2,7 +2,7 @@ * Routines for x25 packet disassembly * Olivier Abad * - * $Id: packet-x25.c,v 1.54 2001/11/15 21:11:01 gram Exp $ + * $Id: packet-x25.c,v 1.55 2001/11/25 22:19:25 hagbard Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -158,6 +158,7 @@ static dissector_handle_t ip_handle; static dissector_handle_t ositp_handle; static dissector_handle_t sna_handle; static dissector_handle_t qllc_handle; +static dissector_handle_t data_handle; /* Preferences */ static gboolean non_q_bit_is_sna = FALSE; @@ -2029,7 +2030,7 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) call_dissector(ip_handle, next_tvb, pinfo, tree); } else { - dissect_data(next_tvb, 0, pinfo, tree); + call_dissector(data_handle,next_tvb, pinfo, tree); } } } @@ -2129,6 +2130,7 @@ proto_reg_handoff_x25(void) ositp_handle = find_dissector("ositp"); sna_handle = find_dissector("sna"); qllc_handle = find_dissector("qllc"); + data_handle = find_dissector("data"); dissector_add("llc.dsap", SAP_X25, dissect_x25, proto_x25); } -- 2.34.1