Switched from using CHECK_DISPLAY_AS_DATA to using CHECK_DISPLAY_AS_X

which also takes a handle as an argument and thus doesn't call
dissect_data directly.

svn path=/trunk/; revision=4270
This commit is contained in:
Ed Warnicke 2001-11-26 05:13:14 +00:00
parent fcd5b352af
commit 4877553530
12 changed files with 41 additions and 24 deletions

View File

@ -1,7 +1,7 @@
/* proto.h
* Definitions for protocol display
*
* $Id: proto.h,v 1.20 2001/11/15 10:58:51 guy Exp $
* $Id: proto.h,v 1.21 2001/11/26 05:13:14 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -62,6 +62,14 @@ struct value_string;
} \
}
/* check protocol activation */
#define CHECK_DISPLAY_AS_X(x_handle,index, tvb, pinfo, tree) { \
if (!proto_is_protocol_enabled(index)) { \
call_dissector(x_handle,tvb, pinfo, tree); \
return; \
} \
}
enum {
BASE_NONE,
BASE_DEC,

View File

@ -1,7 +1,7 @@
/* packet-arp.c
* Routines for ARP packet disassembly
*
* $Id: packet-arp.c,v 1.44 2001/06/18 02:17:44 guy Exp $
* $Id: packet-arp.c,v 1.45 2001/11/26 05:13:11 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -70,6 +70,8 @@ static gint ett_arp = -1;
static gint ett_atmarp_nsap = -1;
static gint ett_atmarp_tl = -1;
static dissector_handle_t data_handle;
/* Definitions taken from Linux "linux/if_arp.h" header file, and from
http://www.isi.edu/in-notes/iana/assignments/arp-parameters
@ -410,7 +412,7 @@ dissect_atmarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *tl_tree;
proto_item *tl;
CHECK_DISPLAY_AS_DATA(proto_arp, tvb, pinfo, tree);
CHECK_DISPLAY_AS_X(data_handle,proto_arp, tvb, pinfo, tree);
/* Override the setting to "ARP/RARP". */
pinfo->current_proto = "ATMARP";
@ -650,7 +652,7 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
const guint8 *sha_val, *spa_val, *tha_val, *tpa_val;
gchar *sha_str, *spa_str, *tha_str, *tpa_str;
CHECK_DISPLAY_AS_DATA(proto_arp, tvb, pinfo, tree);
CHECK_DISPLAY_AS_X(data_handle,proto_arp, tvb, pinfo, tree);
pinfo->current_proto = "ARP";
@ -943,6 +945,7 @@ proto_register_arp(void)
void
proto_reg_handoff_arp(void)
{
data_handle = find_dissector("data");
dissector_add("ethertype", ETHERTYPE_ARP, dissect_arp, proto_arp);
dissector_add("ethertype", ETHERTYPE_REVARP, dissect_arp, proto_arp);
}

View File

@ -3,7 +3,7 @@
*
* Copyright 2001, Paul Ionescu <paul@acorp.ro>
*
* $Id: packet-fr.c,v 1.19 2001/11/26 01:03:35 hagbard Exp $
* $Id: packet-fr.c,v 1.20 2001/11/26 05:13:11 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -239,7 +239,7 @@ void dissect_fr_uncompressed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_item *ti = NULL;
proto_tree *fr_tree = NULL;
CHECK_DISPLAY_AS_DATA(proto_fr, tvb, pinfo, tree);
CHECK_DISPLAY_AS_X(data_handle,proto_fr, tvb, pinfo, tree);
pinfo->current_proto = "Frame Relay";
if (check_col(pinfo->fd, COL_PROTOCOL))

View File

@ -3,7 +3,7 @@
* Copyright 2000, Axis Communications AB
* Inquiries/bugreports should be sent to Johan.Jorgensen@axis.com
*
* $Id: packet-ieee80211.c,v 1.42 2001/11/26 04:52:50 hagbard Exp $
* $Id: packet-ieee80211.c,v 1.43 2001/11/26 05:13:11 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -816,7 +816,7 @@ dissect_ieee80211_mgt (guint16 fcf, tvbuff_t * tvb, packet_info * pinfo,
guint32 next_len;
int tagged_parameter_tree_len;
CHECK_DISPLAY_AS_DATA(proto_wlan_mgt, tvb, pinfo, tree);
CHECK_DISPLAY_AS_X(data_handle,proto_wlan_mgt, tvb, pinfo, tree);
if (tree)
{

View File

@ -3,7 +3,7 @@
*
* Guy Harris <guy@alum.mit.edu>
*
* $Id: packet-ipp.c,v 1.23 2001/11/26 04:52:50 hagbard Exp $
* $Id: packet-ipp.c,v 1.24 2001/11/26 05:13:11 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -171,7 +171,7 @@ dissect_ipp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint16 status_code;
gchar *status_fmt;
CHECK_DISPLAY_AS_DATA(proto_ipp, tvb, pinfo, tree);
CHECK_DISPLAY_AS_X(data_handle,proto_ipp, tvb, pinfo, tree);
pinfo->current_proto = "IPP";

View File

@ -4,7 +4,7 @@
* Uwe Girlich <uwe@planetquake.com>
* http://www.idsoftware.com/q1source/q1source.zip
*
* $Id: packet-quake.c,v 1.19 2001/11/25 22:19:24 hagbard Exp $
* $Id: packet-quake.c,v 1.20 2001/11/26 05:13:11 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -524,7 +524,7 @@ dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* call a conversation dissector doesn't check for disabled
* protocols or set "pinfo->current_proto".
*/
CHECK_DISPLAY_AS_DATA(proto_quake, tvb, pinfo, tree);
CHECK_DISPLAY_AS_X(data_handle,proto_quake, tvb, pinfo, tree);
pinfo->current_proto = "QUAKE";

View File

@ -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.3 2001/11/25 22:19:24 hagbard Exp $
* $Id: packet-quake2.c,v 1.4 2001/11/26 05:13:11 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -275,7 +275,7 @@ dissect_quake2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* call a conversation dissector doesn't check for disabled
* protocols or set "pinfo->current_proto".
*/
CHECK_DISPLAY_AS_DATA(proto_quake2, tvb, pinfo, tree);
CHECK_DISPLAY_AS_X(data_handle,proto_quake2, tvb, pinfo, tree);
direction = (pinfo->destport == gbl_quake2ServerPort) ?
DIR_C2S : DIR_S2C;

View File

@ -4,7 +4,7 @@
* Uwe Girlich <uwe@planetquake.com>
* http://www.idsoftware.com/q1source/q1source.zip
*
* $Id: packet-quakeworld.c,v 1.5 2001/11/25 22:19:24 hagbard Exp $
* $Id: packet-quakeworld.c,v 1.6 2001/11/26 05:13:12 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -725,7 +725,7 @@ dissect_quakeworld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* call a conversation dissector doesn't check for disabled
* protocols or set "pinfo->current_proto".
*/
CHECK_DISPLAY_AS_DATA(proto_quakeworld, tvb, pinfo, tree);
CHECK_DISPLAY_AS_X(data_handle,proto_quakeworld, tvb, pinfo, tree);
direction = (pinfo->destport == gbl_quakeworldServerPort) ?
DIR_C2S : DIR_S2C;

View File

@ -1,6 +1,6 @@
/* packet-rtcp.c
*
* $Id: packet-rtcp.c,v 1.22 2001/09/08 00:43:51 guy Exp $
* $Id: packet-rtcp.c,v 1.23 2001/11/26 05:13:12 hagbard Exp $
*
* Routines for RTCP dissection
* RTCP = Real-time Transport Control Protocol
@ -178,6 +178,8 @@ static gint ett_sdes_item = -1;
static address fake_addr;
static int heur_init = FALSE;
static dissector_handle_t data_handle;
static gboolean dissect_rtcp_heur( tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree );
@ -636,7 +638,7 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
unsigned int offset = 0;
guint16 packet_length = 0;
CHECK_DISPLAY_AS_DATA(proto_rtcp, tvb, pinfo, tree);
CHECK_DISPLAY_AS_X(data_handle,proto_rtcp, tvb, pinfo, tree);
pinfo->current_proto = "RTCP";
@ -1228,6 +1230,7 @@ proto_register_rtcp(void)
void
proto_reg_handoff_rtcp(void)
{
data_handle = find_dissector("data");
/*
* Register this dissector as one that can be assigned to a
* UDP conversation.

View File

@ -6,7 +6,7 @@
* Copyright 2000, Philips Electronics N.V.
* Written by Andreas Sikkema <andreas.sikkema@philips.com>
*
* $Id: packet-rtp.c,v 1.26 2001/11/26 04:52:51 hagbard Exp $
* $Id: packet-rtp.c,v 1.27 2001/11/26 05:13:12 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -345,7 +345,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
guint32 sync_src;
guint32 csrc_item;
CHECK_DISPLAY_AS_DATA(proto_rtp, tvb, pinfo, tree);
CHECK_DISPLAY_AS_X(data_handle,proto_rtp, tvb, pinfo, tree);
pinfo->current_proto = "RTP";

View File

@ -8,7 +8,7 @@
*
* See RFCs 1905, 1906, 1909, and 1910 for SNMPv2u.
*
* $Id: packet-snmp.c,v 1.72 2001/11/26 04:52:51 hagbard Exp $
* $Id: packet-snmp.c,v 1.73 2001/11/26 05:13:12 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -2105,7 +2105,7 @@ dissect_snmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* call a conversation dissector doesn't check for disabled
* protocols or set "pinfo->current_proto".
*/
CHECK_DISPLAY_AS_DATA(proto_snmp, tvb, pinfo, tree);
CHECK_DISPLAY_AS_X(data_handle,proto_snmp, tvb, pinfo, tree);
pinfo->current_proto = "SNMP";

View File

@ -5,7 +5,7 @@
* Craig Newell <CraigN@cheque.uq.edu.au>
* RFC2347 TFTP Option Extension
*
* $Id: packet-tftp.c,v 1.30 2001/11/03 02:25:26 guy Exp $
* $Id: packet-tftp.c,v 1.31 2001/11/26 05:13:12 hagbard Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -55,6 +55,8 @@ static int hf_tftp_error_string = -1;
static gint ett_tftp = -1;
static dissector_handle_t data_handle;
#define UDP_PORT_TFTP 69
#define TFTP_RRQ 1
@ -99,7 +101,7 @@ dissect_tftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
u_int i1;
guint16 error;
CHECK_DISPLAY_AS_DATA(proto_tftp, tvb, pinfo, tree);
CHECK_DISPLAY_AS_X(data_handle,proto_tftp, tvb, pinfo, tree);
pinfo->current_proto = "TFTP";
@ -346,5 +348,6 @@ proto_register_tftp(void)
void
proto_reg_handoff_tftp(void)
{
data_handle = find_dissector("data");
dissector_add("udp.port", UDP_PORT_TFTP, dissect_tftp, proto_tftp);
}