From 9f2c88966a252520a4bafaa5fee36cf39c1eb85a Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 22 Jan 2001 03:33:45 +0000 Subject: Remove more "CHECK_DISPLAY_AS_DATA()" calls and "pinfo->current_proto =" statements. Move the setting of the Protocol column in various dissectors before anything is fetched from the packet, and also clear the Info column at that point in those and some other dissectors, so that if an exception is thrown, the columns don't reflect the previous protocol. Make the IP dissector static, as it's called only via dissector tables or dissector handles. Also make the "dissect the TOS field as the DiffServ DS field" flag static, as it's not referred to outside of "packet-ip.c". In the NCP dissector, refer to the port type through "pinfo" rather than through the global "pi", as it's a tvbuffified dissector. svn path=/trunk/; revision=2929 --- packet-ip.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'packet-ip.c') diff --git a/packet-ip.c b/packet-ip.c index 3eaa63c54b..a304a3a60e 100644 --- a/packet-ip.c +++ b/packet-ip.c @@ -1,7 +1,7 @@ /* packet-ip.c * Routines for IP and miscellaneous IP protocol packet disassembly * - * $Id: packet-ip.c,v 1.121 2001/01/13 07:47:48 guy Exp $ + * $Id: packet-ip.c,v 1.122 2001/01/22 03:33:45 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -60,7 +60,7 @@ static void dissect_icmp(tvbuff_t *, packet_info *, proto_tree *); static void dissect_igmp(tvbuff_t *, packet_info *, proto_tree *); /* Decode the old IPv4 TOS field as the DiffServ DS Field */ -gboolean g_ip_dscp_actif = TRUE; +static gboolean g_ip_dscp_actif = TRUE; static int proto_ip = -1; static int hf_ip_version = -1; @@ -784,7 +784,7 @@ static guint16 ip_checksum(const guint8 *ptr, int len) return in_cksum(&cksum_vec[0], 1); } -void +static void dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { e_ip iph; @@ -797,10 +797,6 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint16 ipsum; tvbuff_t *next_tvb; - CHECK_DISPLAY_AS_DATA(proto_ip, tvb, pinfo, tree); - - pinfo->current_proto = "IP"; - if (check_col(pinfo->fd, COL_PROTOCOL)) col_set_str(pinfo->fd, COL_PROTOCOL, "IP"); if (check_col(pinfo->fd, COL_INFO)) @@ -1013,10 +1009,6 @@ dissect_icmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint8 addr_entry_size = 0; int i; - CHECK_DISPLAY_AS_DATA(proto_icmp, tvb, pinfo, tree); - - pinfo->current_proto = "ICMP"; - if (check_col(pinfo->fd, COL_PROTOCOL)) col_set_str(pinfo->fd, COL_PROTOCOL, "ICMP"); if (check_col(pinfo->fd, COL_INFO)) @@ -1241,10 +1233,6 @@ dissect_igmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item *ti; gchar *type_str; - CHECK_DISPLAY_AS_DATA(proto_igmp, tvb, pinfo, tree); - - pinfo->current_proto = "IGMP"; - if (check_col(pinfo->fd, COL_PROTOCOL)) col_set_str(pinfo->fd, COL_PROTOCOL, "IGMP"); if (check_col(pinfo->fd, COL_INFO)) -- cgit v1.2.3