diff options
author | Gerald Combs <gerald@wireshark.org> | 2010-06-02 18:13:00 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2010-06-02 18:13:00 +0000 |
commit | 1bac7c2610224e70bff86c851dad98435f86c2ef (patch) | |
tree | 30698e9b454012fbed0a1b6bf198f8fe644d8dca /epan | |
parent | 263c23d913931f61561628a167cedb072338961c (diff) |
From Chris Maynard via bug 4014:
This trivial patch merely displays the ICMP ID and sequence # in the Info
column.
svn path=/trunk/; revision=33056
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-icmp.c | 11 | ||||
-rw-r--r-- | epan/dissectors/packet-ip.c | 1 | ||||
-rw-r--r-- | epan/packet_info.h | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c index ac32b3691c..e6dc91320e 100644 --- a/epan/dissectors/packet-icmp.c +++ b/epan/dissectors/packet-icmp.c @@ -53,6 +53,7 @@ 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_seq_num_le = -1; static int hf_icmp_mtu = -1; static int hf_icmp_redir_gw = -1; @@ -731,7 +732,7 @@ dissect_icmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; } - col_set_str(pinfo->cinfo, COL_INFO, type_str); + col_add_fstr(pinfo->cinfo, COL_INFO, "%-20s", type_str); if (code_str) col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)", code_str); @@ -783,6 +784,10 @@ dissect_icmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ICMP_MASKREPLY: 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); + proto_tree_add_item(icmp_tree, hf_icmp_seq_num_le, tvb, 6, 2, TRUE); + col_append_fstr(pinfo->cinfo, COL_INFO, + " (id=0x%04x, seq(be/le)=%u/%u, ttl=%u)", tvb_get_ntohs(tvb, 4), + tvb_get_ntohs(tvb, 6), tvb_get_letohs(tvb, 6), pinfo->ip_ttl); break; case ICMP_UNREACH: @@ -929,6 +934,10 @@ proto_register_icmp(void) { "Sequence number", "icmp.seq", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_icmp_seq_num_le, + {"Sequence number (LE)", "icmp.seq_le", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, + "", HFILL }}, + { &hf_icmp_mtu, { "MTU of next hop", "icmp.mtu", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}}, diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 2fcac7a670..5e6caf41cf 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -1469,6 +1469,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) } iph->ip_ttl = tvb_get_guint8(tvb, offset + 8); + pinfo->ip_ttl = iph->ip_ttl; if (tree) { ttl_item = proto_tree_add_item(ip_tree, hf_ip_ttl, tvb, offset + 8, 1, FALSE); } else { diff --git a/epan/packet_info.h b/epan/packet_info.h index 393b7a7f7d..8446685c49 100644 --- a/epan/packet_info.h +++ b/epan/packet_info.h @@ -127,6 +127,7 @@ typedef struct _packet_info { int iplen; /* total length of IP packet */ int iphdrlen; /* length of IP header */ + guint8 ip_ttl; /* IP time to live */ int p2p_dir; /* Packet was captured as an outbound (P2P_DIR_SENT) inbound (P2P_DIR_RECV) |