* Note that protocol constants are still subject to change, based on IANA
* assignment decisions.
*
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
-#include <epan/ipv6-utils.h>
#include "packet-arp.h"
static int proto_dhcpv6 = -1;
optlen, "IAADDR: malformed option");
break;
}
- tvb_memcpy(tvb, (guint8 *)&in6, off, sizeof(in6));
+ tvb_get_ipv6(tvb, off, &in6);
proto_tree_add_text(subtree, tvb, off,
sizeof(in6), "IPv6 address: %s",
ip6_to_str(&in6));
break;
}
proto_tree_add_text(subtree, tvb, off, 2,
- "elapsed-time: %d sec",
- (guint32)tvb_get_ntohs(tvb, off));
+ "elapsed-time: %u ms",
+ 10*(guint32)tvb_get_ntohs(tvb, off));
break;
case OPTION_RELAY_MSG:
if (optlen == 0) {
optlen, "UNICAST: malformed option");
break;
}
- tvb_memcpy(tvb, (guint8 *)&in6, off, sizeof(in6));
+ tvb_get_ipv6(tvb, off, &in6);
proto_tree_add_text(subtree, tvb, off,
sizeof(in6), "IPv6 address: %s",
ip6_to_str(&in6));
status_code);
if (optlen - 2 > 0) {
- status_message = ep_tvb_get_string(tvb, off + 2, optlen - 2);
+ status_message = tvb_get_ephemeral_string(tvb, off + 2, optlen - 2);
proto_tree_add_text(subtree, tvb, off + 2, optlen - 2,
"Status Message: %s",
status_message);
break;
}
for (i = 0; i < optlen; i += 16) {
- tvb_memcpy(tvb, (guint8 *)&in6, off + i, sizeof(in6));
+ tvb_get_ipv6(tvb, off + i, &in6);
proto_tree_add_text(subtree, tvb, off + i,
sizeof(in6), "SIP servers address: %s",
ip6_to_str(&in6));
break;
}
for (i = 0; i < optlen; i += 16) {
- tvb_memcpy(tvb, (guint8 *)&in6, off + i, sizeof(in6));
+ tvb_get_ipv6(tvb, off + i, &in6);
proto_tree_add_text(subtree, tvb, off + i,
sizeof(in6), "DNS servers address: %s",
ip6_to_str(&in6));
break;
}
for (i = 0; i < optlen; i += 16) {
- tvb_memcpy(tvb, (guint8 *)&in6, off + i, sizeof(in6));
+ tvb_get_ipv6(tvb, off + i, &in6);
proto_tree_add_text(subtree, tvb, off + i,
sizeof(in6), "NIS servers address: %s",
ip6_to_str(&in6));
break;
}
for (i = 0; i < optlen; i += 16) {
- tvb_memcpy(tvb, (guint8 *)&in6, off + i, sizeof(in6));
+ tvb_get_ipv6(tvb, off + i, &in6);
proto_tree_add_text(subtree, tvb, off + i,
sizeof(in6), "NISP servers address: %s",
ip6_to_str(&in6));
break;
}
for (i = 0; i < optlen; i += 16) {
- tvb_memcpy(tvb, (guint8 *)&in6, off + i, sizeof(in6));
+ tvb_get_ipv6(tvb, off + i, &in6);
proto_tree_add_text(subtree, tvb, off + i,
sizeof(in6), "SNTP servers address: %s",
ip6_to_str(&in6));
break;
case OPTION_TIME_ZONE:
if (optlen > 0) {
- buf = ep_tvb_get_string(tvb, off, optlen);
+ buf = tvb_get_ephemeral_string(tvb, off, optlen);
proto_tree_add_text(subtree, tvb, off, optlen, "time-zone: %s", buf);
}
break;
}
proto_tree_add_text(subtree, tvb, off + 8, 1,
"Prefix length: %d", prefix_length);
- tvb_memcpy(tvb, (guint8 *)&in6, off + 9 , sizeof(in6));
+ tvb_get_ipv6(tvb, off + 9, &in6);
proto_tree_add_text(subtree, tvb, off + 9,
16, "Prefix address: %s",
ip6_to_str(&in6));
break;
}
- tvb_memcpy(tvb, (guint8 *)&in6, off , sizeof(in6));
+ tvb_get_ipv6(tvb, off, &in6);
proto_tree_add_text(subtree, tvb, off,
16, "Home Agent: %s", ip6_to_str(&in6));
break;
break;
}
- tvb_memcpy(tvb, (guint8 *)&in6, off , sizeof(in6));
+ tvb_get_ipv6(tvb, off, &in6);
proto_tree_add_text(subtree, tvb, off,
16, "Home Address: %s", ip6_to_str(&in6));
break;
hop_count = tvb_get_guint8(tvb, off+1);
proto_tree_add_text(bp_tree, tvb, off+1, 1, "Hop count: %d", hop_count);
- tvb_memcpy(tvb, (guint8 *)&in6, off+2, sizeof(in6));
+ tvb_get_ipv6(tvb, off+2, &in6);
proto_tree_add_text(bp_tree, tvb, off+2, sizeof(in6),
"Link-address: %s",ip6_to_str(&in6));
- tvb_memcpy(tvb, (guint8 *)&in6, off+18, sizeof(in6));
+ tvb_get_ipv6(tvb, off+18, &in6);
proto_tree_add_text(bp_tree, tvb, off+18, sizeof(in6),
"Peer-address: %s",ip6_to_str(&in6));
msgtype);
proto_tree_add_text(bp_tree, tvb, off+1, 3, "Transaction-ID: 0x%08x", xid);
#if 0
- tvb_memcpy(tvb, (guint8 *)&in6, 4, sizeof(in6));
+ tvb_get_ipv6(tvb, 4, &in6);
proto_tree_add_text(bp_tree, tvb, 4, sizeof(in6),
"Server address: %s", ip6_to_str(&in6));
#endif
{ &hf_fqdn_1,
{ "Reserved", "", FT_UINT8, BASE_HEX, NULL, 0xF8, "", HFILL}},
{ &hf_fqdn_2,
- { "N", "", FT_BOOLEAN, 8, TFS(&fqdn_n), 0x4, "", HFILL}},
+ { "N", "dhcpv6.msgtype.n", FT_BOOLEAN, 8, TFS(&fqdn_n), 0x4, "", HFILL}},
{ &hf_fqdn_3,
- { "O", "", FT_BOOLEAN, 8, TFS(&fqdn_o), 0x2, "", HFILL}},
+ { "O", "dhcpv6.msgtype.o", FT_BOOLEAN, 8, TFS(&fqdn_o), 0x2, "", HFILL}},
{ &hf_fqdn_4,
- { "S", "", FT_BOOLEAN, 8, TFS(&fqdn_s), 0x1, "", HFILL}}
+ { "S", "dhcpv6.msgtype.s", FT_BOOLEAN, 8, TFS(&fqdn_s), 0x1, "", HFILL}}
};
static gint *ett[] = {