Add more information to the Info column for some ICMPv6 messages. Add a

small comment to addr_resolv.c.

svn path=/trunk/; revision=34384
This commit is contained in:
Gerald Combs 2010-10-05 17:57:23 +00:00
parent 0e64b1749c
commit a0b284c5db
2 changed files with 23 additions and 35 deletions

View File

@ -868,7 +868,7 @@ host_lookup6(const struct e_in6_addr *addr, const gboolean resolve, gboolean *fo
async_dns_queue_msg_t *caqm;
#endif /* HAVE_C_ARES */
struct hostent *hostp;
#endif
#endif /* INET6 */
*found = TRUE;

View File

@ -144,8 +144,8 @@ static const value_string icmpv6_type_str[] = {
{ 100, "Private experimentation" },
{ 101, "Private experimentation" },
{ 127, "Reserved for expansion of ICMPv6 error messages" },
{ ICMP6_ECHO_REQUEST, "Echo request" },
{ ICMP6_ECHO_REPLY, "Echo reply" },
{ ICMP6_ECHO_REQUEST, "Echo (ping) request" },
{ ICMP6_ECHO_REPLY, "Echo (ping) reply" },
{ ICMP6_MEMBERSHIP_QUERY, "Multicast listener query" },
{ ICMP6_MEMBERSHIP_REPORT, "Multicast listener report" },
{ ICMP6_MEMBERSHIP_REDUCTION, "Multicast listener done" },
@ -444,12 +444,18 @@ again:
case ND_OPT_TARGET_LINKADDR:
{
int len_local, p;
gchar *llstr;
p = offset + sizeof(*opt);
len_local = (opt->nd_opt_len << 3) - sizeof(*opt);
llstr = tvb_bytes_to_str_punct(tvb, p, len_local, ':');
proto_tree_add_text(icmp6opt_tree, tvb,
offset + sizeof(*opt), len_local, "Link-layer address: %s",
bytestring_to_str(tvb_get_ptr(tvb, p, len_local), len_local, ':'));
llstr);
col_append_fstr(pinfo->cinfo, COL_INFO,
" %s %s",
opt->nd_opt_type == ND_OPT_SOURCE_LINKADDR ? "from" : "is at",
llstr);
break;
}
case ND_OPT_PREFIX_INFORMATION:
@ -728,12 +734,8 @@ again:
proto_tree_add_text(icmp6opt_tree, tvb,
offset + offsetof(struct nd_opt_map_info, nd_opt_map_address), 16,
#ifdef INET6
"Address of MAP: %s (%s)",
get_hostname6(&map->nd_opt_map_address),
#else
"Address of MAP: %s",
#endif
ip6_to_str(&map->nd_opt_map_address));
break;
}
@ -1049,7 +1051,7 @@ again:
len_local = (opt->fmip6_opt_len << 3) - sizeof(*opt);
proto_tree_add_text(icmp6opt_tree, tvb,
offset + sizeof(*opt), len_local, "Link-layer address: %s",
bytestring_to_str(tvb_get_ptr(tvb, p, len_local), len_local, ':'));
tvb_bytes_to_str_punct(tvb, p, len_local, ':'));
break;
}
} /* switch (opt->fmip6_opt_type) */
@ -1585,13 +1587,8 @@ dissect_mldrv2( tvbuff_t *tvb, guint32 offset, guint16 count, proto_tree *tree )
tvb_get_ipv6(tvb, localOffset, &addr);
tf = proto_tree_add_text( tree, tvb, offset, recordSize,
#ifdef INET6
"%s: %s (%s)", val_to_str(recordType, mldrv2ModesNames,"Unknown mode"),
get_hostname6(&addr), ip6_to_str(&addr)
#else
"%s: %s", val_to_str(recordType, mldrv2ModesNames,"Unknown mode"),
ip6_to_str(&addr)
#endif
);
sub_tree = proto_item_add_subtree(tf, ett_multicastRR);
@ -1605,11 +1602,7 @@ dissect_mldrv2( tvbuff_t *tvb, guint32 offset, guint16 count, proto_tree *tree )
for( ; sourceNb; sourceNb--, localOffset += 16 ) {
tvb_get_ipv6(tvb, localOffset, &addr);
proto_tree_add_text( sub_tree, tvb, localOffset, 16,
#ifdef INET6
"Source Address: %s (%s)", get_hostname6(&addr), ip6_to_str(&addr)
#else
"Source Address: %s", ip6_to_str(&addr)
#endif
);
}
}
@ -1891,7 +1884,10 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"ID: 0x%04x", (guint16)g_ntohs(dp->icmp6_id));
proto_tree_add_text(icmp6_tree, tvb,
offset + ICMP6_SEQ_OFFSET, 2,
"Sequence: 0x%04x", (guint16)g_ntohs(dp->icmp6_seq));
"Sequence: %u", (guint16)g_ntohs(dp->icmp6_seq));
col_append_fstr(pinfo->cinfo, COL_INFO,
" id=0x%04x, seq=%u",
g_ntohs(dp->icmp6_id), g_ntohs(dp->icmp6_seq));
if (pinfo->destport == 0x0dd8 && dp->icmp6_type == ICMP6_ECHO_REQUEST) {
/* RFC 4380
@ -2047,13 +2043,11 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb_get_ntohl (tvb, offset+4));
proto_tree_add_text(icmp6_tree, tvb,
offset + offsetof(struct nd_neighbor_solicit, nd_ns_target), 16,
#ifdef INET6
"Target: %s (%s)",
get_hostname6(&ns->nd_ns_target),
#else
"Target: %s",
#endif
ip6_to_str(&ns->nd_ns_target));
col_append_fstr(pinfo->cinfo, COL_INFO,
" for %s", ip6_to_str(&ns->nd_ns_target));
dissect_icmpv6ndopt(tvb, offset + sizeof(*ns), pinfo, icmp6_tree);
break;
@ -2083,13 +2077,15 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
targetoff = offset + offsetof(struct nd_neighbor_advert, nd_na_target);
tvb_memcpy(tvb, (guint8 *)&na_target, targetoff, sizeof na_target);
proto_tree_add_text(icmp6_tree, tvb, targetoff, 16,
#ifdef INET6
"Target: %s (%s)",
get_hostname6(&na_target),
#else
"Target: %s",
#endif
ip6_to_str(&na_target));
col_append_fstr(pinfo->cinfo, COL_INFO,
" %s (%srtr, %ssol)",
ip6_to_str(&na_target),
na_flags & ND_NA_FLAG_ROUTER ? "" : "not ",
na_flags & ND_NA_FLAG_SOLICITED ? "" : "not "
);
dissect_icmpv6ndopt(tvb, offset + sizeof(struct nd_neighbor_advert), pinfo, icmp6_tree);
break;
@ -2104,22 +2100,14 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb_get_ntohs (tvb, offset+4));
proto_tree_add_text(icmp6_tree, tvb,
offset + offsetof(struct nd_redirect, nd_rd_target), 16,
#ifdef INET6
"Target: %s (%s)",
get_hostname6(&rd->nd_rd_target),
#else
"Target: %s",
#endif
ip6_to_str(&rd->nd_rd_target));
proto_tree_add_text(icmp6_tree, tvb,
offset + offsetof(struct nd_redirect, nd_rd_dst), 16,
#ifdef INET6
"Destination: %s (%s)",
get_hostname6(&rd->nd_rd_dst),
#else
"Destination: %s",
#endif
ip6_to_str(&rd->nd_rd_dst));
dissect_icmpv6ndopt(tvb, offset + sizeof(*rd), pinfo, icmp6_tree);