diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-10-15 22:00:02 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-10-15 22:00:02 +0000 |
commit | a4d463d3f8b9bf5d607cb5d2146f2465ec59d47d (patch) | |
tree | a80af3d9b83aa6674cf6dbe8bca22d0af30cebc9 /packet-ip.c | |
parent | 7c618cf80adedf174b46185a20cb3fdd4c521752 (diff) |
From Giles Scott: make some items in the ICMP protocol tree named fields.
svn path=/trunk/; revision=8710
Diffstat (limited to 'packet-ip.c')
-rw-r--r-- | packet-ip.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/packet-ip.c b/packet-ip.c index 939cf166bb..dc738b5a4d 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.199 2003/08/29 22:15:19 guy Exp $ + * $Id: packet-ip.c,v 1.200 2003/10/15 22:00:02 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -135,6 +135,11 @@ static int hf_icmp_type = -1; static int hf_icmp_code = -1; static int hf_icmp_checksum = -1; static int hf_icmp_checksum_bad = -1; +static int hf_icmp_ident = -1; +static int hf_icmp_seq_num = -1; +static int hf_icmp_mtu = -1; +static int hf_icmp_redir_gw = -1; + /* Mobile ip */ static int hf_icmp_mip_type = -1; @@ -1444,17 +1449,14 @@ dissect_icmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ICMP_IREQREPLY: case ICMP_MASKREQ: case ICMP_MASKREPLY: - proto_tree_add_text(icmp_tree, tvb, 4, 2, "Identifier: 0x%04x", - tvb_get_ntohs(tvb, 4)); - proto_tree_add_text(icmp_tree, tvb, 6, 2, "Sequence number: %02x:%02x", - tvb_get_guint8(tvb, 6), tvb_get_guint8(tvb, 7)); + proto_tree_add_item(icmp_tree, hf_icmp_ident, tvb, 4, 2, FALSE); + proto_tree_add_item(icmp_tree, hf_icmp_seq_num, tvb, 6, 2, FALSE); break; case ICMP_UNREACH: switch (icmp_code) { case ICMP_FRAG_NEEDED: - proto_tree_add_text(icmp_tree, tvb, 6, 2, "MTU of next hop: %u", - tvb_get_ntohs(tvb, 6)); + proto_tree_add_item(icmp_tree, hf_icmp_mtu, tvb, 6, 2, FALSE); break; } break; @@ -1476,8 +1478,7 @@ dissect_icmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; case ICMP_REDIRECT: - proto_tree_add_text(icmp_tree, tvb, 4, 4, "Gateway address: %s", - ip_to_str(tvb_get_ptr(tvb, 4, 4))); + proto_tree_add_item(icmp_tree, hf_icmp_redir_gw, tvb, 4, 4, FALSE); break; } @@ -1777,6 +1778,22 @@ proto_register_icmp(void) { "Bad Checksum", "icmp.checksum_bad", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "", HFILL }}, + { &hf_icmp_ident, + {"Identifier", "icmp.ident", FT_UINT16, BASE_HEX, NULL, 0x0, + "", HFILL }}, + + { &hf_icmp_seq_num, + {"Sequence number", "icmp.seq", FT_UINT16, BASE_HEX, NULL, 0x0, + "", HFILL }}, + + { &hf_icmp_mtu, + {"MTU of next hop", "icmp.mtu", FT_UINT16, BASE_DEC, NULL, 0x0, + "", HFILL}}, + + { &hf_icmp_redir_gw, + {"Gateway address", "icmp.redir_gw", FT_IPv4, BASE_NONE, NULL, 0x0, + "", HFILL }}, + { &hf_icmp_mip_type, { "Extension Type", "icmp.mip.type", FT_UINT8, BASE_DEC, VALS(mip_extensions), 0x0,"", HFILL}}, |