aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2010-08-21 00:19:32 +0000
committerGerald Combs <gerald@wireshark.org>2010-08-21 00:19:32 +0000
commit71c99df3261d46b46ca63d22d74a77840b9bde6b (patch)
tree3e2141765c637e7612c56afbb4b9009cab38ed6c /epan
parent000b99fc5fd4a697b680dad3321056fc8a65cdbf (diff)
If we have something that looks like a stateless autoconfiguration
address, add the corresponding MAC address to the tree. svn path=/trunk/; revision=33870
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-ipv6.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c
index d2c7706cf7..1b585ecf23 100644
--- a/epan/dissectors/packet-ipv6.c
+++ b/epan/dissectors/packet-ipv6.c
@@ -100,10 +100,13 @@ static int hf_ipv6_nxt = -1;
static int hf_ipv6_hlim = -1;
static int hf_ipv6_src = -1;
static int hf_ipv6_src_host = -1;
+static int hf_ipv6_src_sa_mac = -1;
static int hf_ipv6_dst = -1;
static int hf_ipv6_dst_host = -1;
+static int hf_ipv6_dst_sa_mac = -1;
static int hf_ipv6_addr = -1;
static int hf_ipv6_host = -1;
+static int hf_ipv6_sa_mac = -1;
static int hf_ipv6_opt_pad1 = -1;
static int hf_ipv6_opt_padn = -1;
static int hf_ipv6_dst_opt = -1;
@@ -1329,6 +1332,7 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gboolean update_col_info = TRUE;
gboolean save_fragmented = FALSE;
const char *sep = "IPv6 ";
+ guint8 *mac_addr;
struct ip6_hdr ipv6;
@@ -1412,6 +1416,19 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
16, get_addr_name(&pinfo->src));
PROTO_ITEM_SET_GENERATED(ti);
PROTO_ITEM_SET_HIDDEN(ti);
+ if (tvb_get_guint8(tvb, offset + IP6H_SRC + 8) & 0x02 && tvb_get_ntohs(tvb, offset + IP6H_SRC + 11) == 0xfffe) {
+ mac_addr = ep_alloc(6);
+ tvb_memcpy(tvb, mac_addr, offset + IP6H_SRC + 8, 3);
+ tvb_memcpy(tvb, mac_addr+3, offset+ IP6H_SRC + 13, 3);
+ mac_addr[0] &= ~0x02;
+ ti = proto_tree_add_ether(ipv6_tree, hf_ipv6_src_sa_mac, tvb,
+ offset + IP6H_SRC + 8, 6, mac_addr);
+ PROTO_ITEM_SET_GENERATED(ti);
+ ti = proto_tree_add_ether(ipv6_tree, hf_ipv6_sa_mac, tvb,
+ offset + IP6H_SRC + 8, 6, mac_addr);
+ PROTO_ITEM_SET_GENERATED(ti);
+ PROTO_ITEM_SET_HIDDEN(ti);
+ }
/* Adds different items for the destination address */
proto_tree_add_item(ipv6_tree, hf_ipv6_dst, tvb,
@@ -1430,6 +1447,19 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
16, get_addr_name(&pinfo->dst));
PROTO_ITEM_SET_GENERATED(ti);
PROTO_ITEM_SET_HIDDEN(ti);
+ if (tvb_get_guint8(tvb, offset + IP6H_DST + 8) & 0x02 && tvb_get_ntohs(tvb, offset + IP6H_DST + 11) == 0xfffe) {
+ mac_addr = ep_alloc(6);
+ tvb_memcpy(tvb, mac_addr, offset + IP6H_DST + 8, 3);
+ tvb_memcpy(tvb, mac_addr+3, offset+ IP6H_DST + 13, 3);
+ mac_addr[0] &= ~0x02;
+ ti = proto_tree_add_ether(ipv6_tree, hf_ipv6_dst_sa_mac, tvb,
+ offset + IP6H_DST + 8, 6, mac_addr);
+ PROTO_ITEM_SET_GENERATED(ti);
+ ti = proto_tree_add_ether(ipv6_tree, hf_ipv6_sa_mac, tvb,
+ offset + IP6H_DST + 8, 6, mac_addr);
+ PROTO_ITEM_SET_GENERATED(ti);
+ PROTO_ITEM_SET_HIDDEN(ti);
+ }
}
/* start of the new header (could be a extension header) */
@@ -1661,6 +1691,10 @@ proto_register_ipv6(void)
{ "Source Host", "ipv6.src_host",
FT_STRING, BASE_NONE, NULL, 0x0,
"Source IPv6 Host", HFILL }},
+ { &hf_ipv6_src_sa_mac,
+ { "Source SA MAC", "ipv6.src_sa_mac",
+ FT_ETHER, BASE_NONE, NULL, 0x0,
+ "Source IPv6 Stateless Autoconfiguration MAC Address", HFILL }},
{ &hf_ipv6_dst,
{ "Destination", "ipv6.dst",
FT_IPv6, BASE_NONE, NULL, 0x0,
@@ -1669,6 +1703,10 @@ proto_register_ipv6(void)
{ "Destination Host", "ipv6.dst_host",
FT_STRING, BASE_NONE, NULL, 0x0,
"Destination IPv6 Host", HFILL }},
+ { &hf_ipv6_dst_sa_mac,
+ { "Destination SA MAC", "ipv6.dst_sa_mac",
+ FT_ETHER, BASE_NONE, NULL, 0x0,
+ "Destination IPv6 Stateless Autoconfiguration MAC Address", HFILL }},
{ &hf_ipv6_addr,
{ "Address", "ipv6.addr",
FT_IPv6, BASE_NONE, NULL, 0x0,
@@ -1678,6 +1716,10 @@ proto_register_ipv6(void)
FT_STRING, BASE_NONE, NULL, 0x0,
"IPv6 Host", HFILL }},
+ { &hf_ipv6_sa_mac,
+ { "SA MAC", "ipv6.sa_mac",
+ FT_ETHER, BASE_NONE, NULL, 0x0,
+ "IPv6 Stateless Autoconfiguration MAC Address", HFILL }},
{ &hf_ipv6_opt_pad1,
{ "Pad1", "ipv6.opt.pad1",
FT_NONE, BASE_NONE, NULL, 0x0,