diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-02-28 19:33:49 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-02-28 19:33:49 +0000 |
commit | 1658a51f79ecf8e46ebd65c14a12e77c26c47d0c (patch) | |
tree | 1f5055ea09b46239e63d7cf6c567851c580041cb /packet-udp.c | |
parent | 9815f805630f14c7d53928450d7acbe35692b6e9 (diff) |
Add hidden fields for bad checksums to various IP-family protocols.
Initialize the "hf_" value for "icmp.checksum_bad" to -1, the way all
other "hf_" values are initialized, and declare it and "ip.checksum_bad"
to have base BASE_NONE, not 4.
svn path=/trunk/; revision=3087
Diffstat (limited to 'packet-udp.c')
-rw-r--r-- | packet-udp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packet-udp.c b/packet-udp.c index bc36905876..4609ebf216 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.87 2001/01/28 21:17:26 guy Exp $ + * $Id: packet-udp.c,v 1.88 2001/02/28 19:33:49 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -58,6 +58,7 @@ static int hf_udp_dstport = -1; static int hf_udp_port = -1; static int hf_udp_length = -1; static int hf_udp_checksum = -1; +static int hf_udp_checksum_bad = -1; static gint ett_udp = -1; @@ -192,6 +193,8 @@ dissect_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint_format(udp_tree, hf_udp_checksum, tvb, offset + 6, 2, uh_sum, "Checksum: 0x%04x (correct)", uh_sum); } else { + proto_tree_add_item_hidden(udp_tree, hf_udp_checksum_bad, tvb, + offset + 6, 2, TRUE); proto_tree_add_uint_format(udp_tree, hf_udp_checksum, tvb, offset + 6, 2, uh_sum, "Checksum: 0x%04x (incorrect, should be 0x%04x)", uh_sum, @@ -235,6 +238,10 @@ proto_register_udp(void) { "Length", "udp.length", FT_UINT16, BASE_DEC, NULL, 0x0, "" }}, + { &hf_udp_checksum_bad, + { "Bad Checksum", "udp.checksum_bad", FT_BOOLEAN, BASE_NONE, NULL, 0x0, + "" }}, + { &hf_udp_checksum, { "Checksum", "udp.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, "" }}, |