summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-01-22 08:54:08 +0000
committerGuy Harris <guy@alum.mit.edu>2001-01-22 08:54:08 +0000
commita4e137f630823d36bcfb8ab402556ca9e6d0d734 (patch)
tree8617f6910eca8b6064b548f3d9cd6357d07843f1
parentc57c848dfa1f7061ada20fa88ad6eac33ad1ea7c (diff)
downloadwireshark-a4e137f630823d36bcfb8ab402556ca9e6d0d734.tar.gz
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. svn path=/trunk/; revision=2932
-rw-r--r--packet-http.c10
-rw-r--r--packet-icmpv6.c4
-rw-r--r--packet-radius.c4
-rw-r--r--packet-srvloc.c6
-rw-r--r--plugins/mgcp/packet-mgcp.c15
5 files changed, 18 insertions, 21 deletions
diff --git a/packet-http.c b/packet-http.c
index 9b7da3cc7a..eb535b210a 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.36 2001/01/11 06:30:54 guy Exp $
+ * $Id: packet-http.c,v 1.37 2001/01/22 08:54:06 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -97,10 +97,6 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
http_type_t http_type;
int datalen;
- CHECK_DISPLAY_AS_DATA(proto_http, tvb, pinfo, tree);
-
- pinfo->current_proto = "HTTP";
-
switch (pinfo->match_port) {
case TCP_PORT_SSDP: /* TCP_PORT_SSDP = UDP_PORT_SSDP */
@@ -122,6 +118,10 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* if it's an HTTP request or reply (but leave out the
* line terminator).
* Otherwise, just call it a continuation.
+ *
+ * Note that "tvb_find_line_end()" will return a value that
+ * is not longer than what's in the buffer, so the
+ * "tvb_get_ptr()" call won't throw an exception.
*/
linelen = tvb_find_line_end(tvb, offset, -1, &next_offset);
line = tvb_get_ptr(tvb, offset, linelen);
diff --git a/packet-icmpv6.c b/packet-icmpv6.c
index f73c5e640d..8966b5d879 100644
--- a/packet-icmpv6.c
+++ b/packet-icmpv6.c
@@ -1,7 +1,7 @@
/* packet-icmpv6.c
* Routines for ICMPv6 packet disassembly
*
- * $Id: packet-icmpv6.c,v 1.34 2001/01/09 06:31:36 guy Exp $
+ * $Id: packet-icmpv6.c,v 1.35 2001/01/22 08:54:06 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -732,8 +732,6 @@ dissect_icmpv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
guint32 phdr[2];
guint16 cksum, computed_cksum;
- OLD_CHECK_DISPLAY_AS_DATA(proto_icmpv6, pd, offset, fd, tree);
-
dp = (struct icmp6_hdr *)&pd[offset];
codename = typename = colcodename = coltypename = "Unknown";
len = sizeof(*dp);
diff --git a/packet-radius.c b/packet-radius.c
index dc79f770d2..7bb763d211 100644
--- a/packet-radius.c
+++ b/packet-radius.c
@@ -1,7 +1,7 @@
/* packet-radius.c
* Routines for RADIUS packet disassembly
*
- * $Id: packet-radius.c,v 1.23 2001/01/16 23:35:58 guy Exp $
+ * $Id: packet-radius.c,v 1.24 2001/01/22 08:54:06 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Johan Feyaerts
@@ -689,8 +689,6 @@ proto_tree
return;
}
- OLD_CHECK_DISPLAY_AS_DATA(proto_radius, pd, offset, fd, tree);
-
memcpy(&rh,&pd[offset],sizeof(e_radiushdr));
diff --git a/packet-srvloc.c b/packet-srvloc.c
index 02ec577b77..685f75caea 100644
--- a/packet-srvloc.c
+++ b/packet-srvloc.c
@@ -6,7 +6,7 @@
* In particular I have not had an opportunity to see how it
* responds to SRVLOC over TCP.
*
- * $Id: packet-srvloc.c,v 1.20 2001/01/13 08:57:46 guy Exp $
+ * $Id: packet-srvloc.c,v 1.21 2001/01/22 08:54:06 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -227,10 +227,6 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 flags;
guint32 count;
- CHECK_DISPLAY_AS_DATA(proto_srvloc, tvb, pinfo, tree);
-
- pinfo->current_proto = "SRVLOC";
-
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "SRVLOC");
diff --git a/plugins/mgcp/packet-mgcp.c b/plugins/mgcp/packet-mgcp.c
index 01504dd234..020b0710e6 100644
--- a/plugins/mgcp/packet-mgcp.c
+++ b/plugins/mgcp/packet-mgcp.c
@@ -2,7 +2,7 @@
* Routines for mgcp packet disassembly
* RFC 2705
*
- * $Id: packet-mgcp.c,v 1.14 2001/01/09 06:32:10 guy Exp $
+ * $Id: packet-mgcp.c,v 1.15 2001/01/22 08:54:08 guy Exp $
*
* Copyright (c) 2000 by Ed Warnicke <hagbard@physics.rutgers.edu>
*
@@ -195,10 +195,6 @@ dissect_mgcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint tvb_sectionend,tvb_sectionbegin, tvb_len, tvb_current_len;
tvbuff_t *next_tvb;
- CHECK_DISPLAY_AS_DATA(proto_mgcp, tvb, pinfo, tree);
-
- pinfo->current_proto = "MGCP";
-
/* Initialize variables */
tvb_sectionend = 0;
@@ -207,6 +203,15 @@ dissect_mgcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb_len = tvb_length(tvb);
tvb_current_len = tvb_len;
+ /*
+ * Set the columns now, so that they'll be set correctly if we throw
+ * an exception. We can set them later as well....
+ */
+ if (check_col(pinfo->fd, COL_PROTOCOL))
+ col_add_str(pinfo->fd, COL_PROTOCOL, "MGCP");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
+
/*
* Check to see whether we're really dealing with MGCP by looking
* for a valid MGCP verb or response code. This isn't infallible,