diff options
-rw-r--r-- | epan/proto.h | 10 | ||||
-rw-r--r-- | packet-arp.c | 9 | ||||
-rw-r--r-- | packet-fr.c | 4 | ||||
-rw-r--r-- | packet-ieee80211.c | 4 | ||||
-rw-r--r-- | packet-ipp.c | 4 | ||||
-rw-r--r-- | packet-quake.c | 4 | ||||
-rw-r--r-- | packet-quake2.c | 4 | ||||
-rw-r--r-- | packet-quakeworld.c | 4 | ||||
-rw-r--r-- | packet-rtcp.c | 7 | ||||
-rw-r--r-- | packet-rtp.c | 4 | ||||
-rw-r--r-- | packet-snmp.c | 4 | ||||
-rw-r--r-- | packet-tftp.c | 7 |
12 files changed, 41 insertions, 24 deletions
diff --git a/epan/proto.h b/epan/proto.h index 9721ba1cc0..60699f413a 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -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, diff --git a/packet-arp.c b/packet-arp.c index 62a20d5255..678cc9fe48 100644 --- a/packet-arp.c +++ b/packet-arp.c @@ -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); } diff --git a/packet-fr.c b/packet-fr.c index 115ad78bc0..76854b634e 100644 --- a/packet-fr.c +++ b/packet-fr.c @@ -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)) diff --git a/packet-ieee80211.c b/packet-ieee80211.c index 1b6ff51587..c597d929dd 100644 --- a/packet-ieee80211.c +++ b/packet-ieee80211.c @@ -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) { diff --git a/packet-ipp.c b/packet-ipp.c index 7235226eb5..1854990b63 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.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"; diff --git a/packet-quake.c b/packet-quake.c index e148b1eddb..66cd853282 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.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"; diff --git a/packet-quake2.c b/packet-quake2.c index 78e39ecc94..fb8bbf3259 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.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; diff --git a/packet-quakeworld.c b/packet-quakeworld.c index b052638cff..268275814f 100644 --- a/packet-quakeworld.c +++ b/packet-quakeworld.c @@ -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; diff --git a/packet-rtcp.c b/packet-rtcp.c index c9b937b05b..ffb94eb50b 100644 --- a/packet-rtcp.c +++ b/packet-rtcp.c @@ -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. diff --git a/packet-rtp.c b/packet-rtp.c index d9866f1de1..7af447fcb7 100644 --- a/packet-rtp.c +++ b/packet-rtp.c @@ -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"; diff --git a/packet-snmp.c b/packet-snmp.c index 5f59ca3b27..0e4a05553d 100644 --- a/packet-snmp.c +++ b/packet-snmp.c @@ -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"; diff --git a/packet-tftp.c b/packet-tftp.c index 8f3e716901..39c40324db 100644 --- a/packet-tftp.c +++ b/packet-tftp.c @@ -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); } |