Add dissection of router address(R) flag. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6350.

svn path=/trunk/; revision=39029
This commit is contained in:
Chris Maynard 2011-09-16 19:23:26 +00:00
parent 207297d913
commit afb6549467
1 changed files with 13 additions and 7 deletions

View File

@ -16,7 +16,7 @@
*
* RPL support added by Colin O'Flynn & Owen Kirby.
*
* Enhance ICMPv6 dissector by Alexis La Goutte
* Enhance ICMPv6 dissector by Alexis La Goutte
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -79,6 +79,7 @@
* RFC 5075/5175: IPv6 Router Advertisement Flags Option
* RFC 5269: Distributing a Symmetric Fast Mobile IPv6 (FMIPv6) Handover Key Using SEcure Neighbor Discovery (SEND)
* RFC 5271: Mobile IPv6 Fast Handovers for 3G CDMA Networks
* RFC 6275: Mobility Support in IPv6
* draft-ieft-roll-rpl-19.txt: RPL: IPv6 Routing Protocol for Low power and Lossy Networks
* draft-ietf-csi-proxy-send-05: Secure Proxy ND Support for SEND
* draft-ietf-6lowpan-nd-17: Neighbor Discovery Optimization for Low Power and Lossy Networks (6LoWPAN)
@ -138,6 +139,7 @@ static int hf_icmpv6_opt_prefix_len = -1;
static int hf_icmpv6_opt_prefix_flag = -1;
static int hf_icmpv6_opt_prefix_flag_l = -1;
static int hf_icmpv6_opt_prefix_flag_a = -1;
static int hf_icmpv6_opt_prefix_flag_r = -1;
static int hf_icmpv6_opt_prefix_flag_reserved = -1;
static int hf_icmpv6_opt_prefix_valid_lifetime = -1;
static int hf_icmpv6_opt_prefix_preferred_lifetime = -1;
@ -1275,7 +1277,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
link_str = tvb_ether_to_str(tvb, opt_offset);
col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", link_str);
proto_item_append_text(ti, " : %s", link_str);
/* if the opt len is 16 and the 6 last bytes is 0n the Link Addr is EUI64 Address */
/* if the opt len is 16 and the 6 last bytes is 0n the Link Addr is EUI64 Address */
}else if(opt_len == 16 && tvb_get_ntohl(tvb, opt_offset + 8) == 0 && tvb_get_ntohs(tvb, opt_offset + 12) == 0){
proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_src_linkaddr_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
@ -1309,7 +1311,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
col_append_fstr(pinfo->cinfo, COL_INFO, " is at %s", link_str);
proto_item_append_text(ti, " : %s", link_str);
/* if the opt len is 16 and the 6 last bytes is 0n the Link Addr is EUI64 Address */
/* if the opt len is 16 and the 6 last bytes is 0n the Link Addr is EUI64 Address */
}else if(opt_len == 16 && tvb_get_ntohl(tvb, opt_offset + 8) == 0 && tvb_get_ntohs(tvb, opt_offset + 12) == 0){
proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_linkaddr_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
ti_opt = proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_target_linkaddr_eui64, tvb, opt_offset, 8, ENC_BIG_ENDIAN);
@ -1345,6 +1347,7 @@ dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_l, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_a, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_r, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(flag_tree, hf_icmpv6_opt_prefix_flag_reserved, tvb, opt_offset, 1, ENC_BIG_ENDIAN);
opt_offset += 1;
@ -3663,10 +3666,10 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = dissect_rpl_control(tvb, offset, pinfo, icmp6_tree, icmp6_type, icmp6_code);
break;
}
case ICMP6_6LOWPANND_DAR:
case ICMP6_6LOWPANND_DAC:
{
{
/* Status */
proto_tree_add_item(icmp6_tree, hf_icmpv6_da_status, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
@ -3682,7 +3685,7 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* EUI-64 */
proto_tree_add_item(icmp6_tree, hf_icmpv6_da_eui64, tvb, offset, 8, ENC_BIG_ENDIAN);
offset += 8;
/* Address */
proto_tree_add_item(icmp6_tree, hf_icmpv6_da_raddr, tvb, offset, 16, ENC_BIG_ENDIAN);
offset += 16;
@ -3859,8 +3862,11 @@ proto_register_icmpv6(void)
{ &hf_icmpv6_opt_prefix_flag_a,
{ "Autonomous address-configuration flag(A)", "icmpv6.opt.prefix.flag.a", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
"When set indicates that this prefix can be used for stateless address configuration", HFILL }},
{ &hf_icmpv6_opt_prefix_flag_r,
{ "Router address flag(R)", "icmpv6.opt.prefix.flag.r", FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
"When set indicates that the Prefix field contains a complete IP address assigned to the sending router", HFILL }},
{ &hf_icmpv6_opt_prefix_flag_reserved,
{ "Reserved", "icmpv6.opt.prefix.flag.reserved", FT_UINT8, BASE_DEC, NULL, 0x3f,
{ "Reserved", "icmpv6.opt.prefix.flag.reserved", FT_UINT8, BASE_DEC, NULL, 0x1f,
NULL, HFILL }},
{ &hf_icmpv6_opt_prefix_valid_lifetime,
{ "Valid Lifetime", "icmpv6.opt.prefix.valid_lifetime", FT_UINT32, BASE_DEC, NULL, 0x00,