summaryrefslogtreecommitdiff
path: root/packet-udp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-01-22 03:33:45 +0000
committerGuy Harris <guy@alum.mit.edu>2001-01-22 03:33:45 +0000
commit9f2c88966a252520a4bafaa5fee36cf39c1eb85a (patch)
treed6278fa82b47a9aa4ce9153dbf718e6cfc6b8fdc /packet-udp.c
parent79e1fdb9e56339d8d7e8d9df090dc0386cf4131e (diff)
downloadwireshark-9f2c88966a252520a4bafaa5fee36cf39c1eb85a.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. 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
Diffstat (limited to 'packet-udp.c')
-rw-r--r--packet-udp.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/packet-udp.c b/packet-udp.c
index f853bfeb70..88c7fd792d 100644
--- a/packet-udp.c
+++ b/packet-udp.c
@@ -1,7 +1,7 @@
/* packet-udp.c
* Routines for UDP packet disassembly
*
- * $Id: packet-udp.c,v 1.85 2001/01/11 16:27:23 gram Exp $
+ * $Id: packet-udp.c,v 1.86 2001/01/22 03:33:45 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -144,9 +144,10 @@ dissect_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint16 computed_cksum;
int offset = 0;
- CHECK_DISPLAY_AS_DATA(proto_udp, tvb, pinfo, tree);
-
- pinfo->current_proto = "UDP";
+ if (check_col(pinfo->fd, COL_PROTOCOL))
+ col_set_str(pinfo->fd, COL_PROTOCOL, "UDP");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
/* Avoids alignment problems on many architectures. */
tvb_memcpy(tvb, (guint8 *)&uh, offset, sizeof(e_udphdr));
@@ -155,8 +156,6 @@ dissect_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
uh_ulen = ntohs(uh.uh_ulen);
uh_sum = ntohs(uh.uh_sum);
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_set_str(pinfo->fd, COL_PROTOCOL, "UDP");
if (check_col(pinfo->fd, COL_INFO))
col_add_fstr(pinfo->fd, COL_INFO, "Source port: %s Destination port: %s",
get_udp_port(uh_sport), get_udp_port(uh_dport));