diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-02-21 19:35:50 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-02-21 19:35:50 +0000 |
commit | 35d8c6cbb25a9a1ec612a978b6f15fc494e31733 (patch) | |
tree | d6a117649f75f5c53ab6863ad7ffd6ce9e334135 | |
parent | 81f6ce8b713df9edc6fa5f7c58e5eb6a00592291 (diff) | |
download | wireshark-35d8c6cbb25a9a1ec612a978b6f15fc494e31733.tar.gz wireshark-35d8c6cbb25a9a1ec612a978b6f15fc494e31733.tar.bz2 wireshark-35d8c6cbb25a9a1ec612a978b6f15fc494e31733.zip |
Change from James E. Flemer to add hidden Boolean fields that are set if
the IP or ICMP checksum is bad.
svn path=/trunk/; revision=3063
-rw-r--r-- | AUTHORS | 4 | ||||
-rw-r--r-- | doc/ethereal.pod.template | 1 | ||||
-rw-r--r-- | packet-ip.c | 15 |
3 files changed, 19 insertions, 1 deletions
@@ -513,6 +513,10 @@ Greg Kilfoyle <gregk@redback.com> { BOOTP option 82 (Relay Agent Information option) support } +James E. Flemer <jflemer@acm.jhu.edu> { + Hidden Boolean fields set if the IP or ICMP checksums are bad +} + Alain Magloire <alainm@rcsm.ece.mcgill.ca> was kind enough to give his permission to use his version of snprintf.c. diff --git a/doc/ethereal.pod.template b/doc/ethereal.pod.template index e041a15de2..7b63215146 100644 --- a/doc/ethereal.pod.template +++ b/doc/ethereal.pod.template @@ -1082,6 +1082,7 @@ B<http://www.ethereal.com>. Alexandre P. Ferreira <alexandref@spliceip.com.br> Simharajan Srishylam <Simharajan.Srishylam@netapp.com> Greg Kilfoyle <gregk@redback.com> + James E. Flemer <jflemer@acm.jhu.edu> Alain Magloire <alainm@rcsm.ece.mcgill.ca> was kind enough to give his permission to use his version of snprintf.c. diff --git a/packet-ip.c b/packet-ip.c index a304a3a60e..effb8a0653 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.122 2001/01/22 03:33:45 guy Exp $ + * $Id: packet-ip.c,v 1.123 2001/02/21 19:35:49 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -87,6 +87,7 @@ static int hf_ip_frag_offset = -1; static int hf_ip_ttl = -1; static int hf_ip_proto = -1; static int hf_ip_checksum = -1; +static int hf_ip_checksum_bad = 0; static gint ett_ip = -1; static gint ett_ip_dsfield = -1; @@ -113,6 +114,7 @@ static int proto_icmp = -1; static int hf_icmp_type = -1; static int hf_icmp_code = -1; static int hf_icmp_checksum = -1; +static int hf_icmp_checksum_bad = 0; static gint ett_icmp = -1; @@ -891,6 +893,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) "Header checksum: 0x%04x (correct)", iph.ip_sum); } else { + proto_tree_add_item_hidden(ip_tree, hf_ip_checksum_bad, tvb, offset + 10, 2, TRUE); proto_tree_add_uint_format(ip_tree, hf_ip_checksum, tvb, offset + 10, 2, iph.ip_sum, "Header checksum: 0x%04x (incorrect, should be 0x%04x)", iph.ip_sum, in_cksum_shouldbe(iph.ip_sum, ipsum)); @@ -1117,6 +1120,8 @@ dissect_icmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cksum, "Checksum: 0x%04x (correct)", cksum); } else { + proto_tree_add_item_hidden(icmp_tree, hf_icmp_checksum_bad, + tvb, 2, 2, TRUE); proto_tree_add_uint_format(icmp_tree, hf_icmp_checksum, tvb, 2, 2, cksum, "Checksum: 0x%04x (incorrect, should be 0x%04x)", @@ -1436,6 +1441,10 @@ proto_register_ip(void) { &hf_ip_checksum, { "Header checksum", "ip.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, "" }}, + + { &hf_ip_checksum_bad, + { "Bad Header checksum", "ip.checksum_bad", FT_BOOLEAN, 4, NULL, 0x0, + "" }}, }; static gint *ett[] = { &ett_ip, @@ -1498,6 +1507,10 @@ proto_register_icmp(void) { &hf_icmp_checksum, { "Checksum", "icmp.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, "" }}, + + { &hf_icmp_checksum_bad, + { "Bad Checksum", "icmp.checksum_bad", FT_BOOLEAN, 4, NULL, 0x0, + "" }}, }; static gint *ett[] = { &ett_icmp, |