/* packet-icmpv6.c
* Routines for ICMPv6 packet disassembly
*
- * $Id: packet-icmpv6.c,v 1.39 2001/04/23 03:37:31 guy Exp $
+ * $Id: packet-icmpv6.c,v 1.40 2001/04/23 03:56:57 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
static gint ett_nodeinfo_nodebitmap = -1;
static gint ett_nodeinfo_nodedns = -1;
+static dissector_handle_t ipv6_handle;
+
static const value_string names_nodeinfo_qtype[] = {
{ NI_QTYPE_NOOP, "NOOP" },
{ NI_QTYPE_SUPTYPES, "Supported query types" },
proto_tree_add_text(icmp6opt_tree, tvb,
offset + 8, (opt->nd_opt_len << 3) - 8, "Redirected packet");
/* tiny sanity check */
- if ((tvb_get_guint8(tvb, offset + 8) & 0xf0) == 0x60)
- dissect_ipv6(tvb_new_subset(tvb, offset + 8, -1, -1), pinfo, icmp6opt_tree);
- else
+ if ((tvb_get_guint8(tvb, offset + 8) & 0xf0) == 0x60) {
+ /* The redirected packet is an IPv6 datagram; dissect it.
+
+ Set the columns non-writable, so that the packet list
+ shows this as an ICMPv6 packet, not as the type of packet
+ for which the ICMPv6 packet was generated. */
+ col_set_writable(pinfo->fd, FALSE);
+
+ call_dissector(ipv6_handle, tvb_new_subset(tvb, offset + 8, -1, -1),
+ pinfo, icmp6opt_tree);
+ } else
dissect_data(tvb_new_subset(tvb, offset + 8, -1, -1), 0, pinfo, icmp6opt_tree);
break;
case ND_OPT_MTU:
case ICMP6_TIME_EXCEEDED:
/* tiny sanity check */
if ((tvb_get_guint8(tvb, offset + sizeof(*dp)) & 0xf0) == 0x60) {
- dissect_ipv6(next_tvb, pinfo, icmp6_tree);
+ /* The invoking packet is an IPv6 datagram; dissect it.
+
+ Set the columns non-writable, so that the packet list
+ shows this as an ICMPv6 packet, not as the type of packet
+ for which the ICMPv6 packet was generated. */
+ col_set_writable(pinfo->fd, FALSE);
+
+ call_dissector(ipv6_handle, next_tvb, pinfo, icmp6_tree);
} else {
dissect_data(next_tvb, 0, pinfo, icmp6_tree);
}
"MTU: %u", pntohl(&dp->icmp6_mtu));
/* tiny sanity check */
if ((tvb_get_guint8(tvb, offset + sizeof(*dp)) & 0xf0) == 0x60) {
- dissect_ipv6(next_tvb, pinfo, icmp6_tree);
+ /* The invoking packet is an IPv6 datagram; dissect it.
+
+ Set the columns non-writable, so that the packet list
+ shows this as an ICMPv6 packet, not as the type of packet
+ for which the ICMPv6 packet was generated. */
+ col_set_writable(pinfo->fd, FALSE);
+
+ call_dissector(ipv6_handle, next_tvb, pinfo, icmp6_tree);
} else {
dissect_data(next_tvb, 0, pinfo, icmp6_tree);
}
"Problem pointer: 0x%04x", pntohl(&dp->icmp6_pptr));
/* tiny sanity check */
if ((tvb_get_guint8(tvb, offset + sizeof(*dp)) & 0xf0) == 0x60) {
- dissect_ipv6(next_tvb, pinfo, icmp6_tree);
+ /* The invoking packet is an IPv6 datagram; dissect it.
+
+ Set the columns non-writable, so that the packet list
+ shows this as an ICMPv6 packet, not as the type of packet
+ for which the ICMPv6 packet was generated. */
+ col_set_writable(pinfo->fd, FALSE);
+
+ call_dissector(ipv6_handle, next_tvb, pinfo, icmp6_tree);
} else {
dissect_data(next_tvb, 0, pinfo, icmp6_tree);
}
proto_reg_handoff_icmpv6(void)
{
dissector_add("ip.proto", IP_PROTO_ICMPV6, dissect_icmpv6, proto_icmpv6);
+
+ /*
+ * Get a handle for the IPv6 dissector.
+ */
+ ipv6_handle = find_dissector("ipv6");
}
/* packet-ipv6.c
* Routines for IPv6 packet disassembly
*
- * $Id: packet-ipv6.c,v 1.55 2001/04/23 03:37:31 guy Exp $
+ * $Id: packet-ipv6.c,v 1.56 2001/04/23 03:56:57 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
return dissect_opts(tvb, offset, tree, "Destination Option");
}
-void
+static void
dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_tree *ipv6_tree;
proto_item *ti;
proto_ipv6 = proto_register_protocol("Internet Protocol Version 6", "IPv6", "ipv6");
proto_register_field_array(proto_ipv6, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+
+ register_dissector("ipv6", dissect_ipv6, proto_ipv6);
}
void
proto_reg_handoff_ipv6(void)
{
- dissector_add("ethertype", ETHERTYPE_IPv6, dissect_ipv6, proto_ipv6);
- dissector_add("ppp.protocol", PPP_IPV6, dissect_ipv6, proto_ipv6);
- dissector_add("ip.proto", IP_PROTO_IPV6, dissect_ipv6, proto_ipv6);
- dissector_add("null.type", BSD_AF_INET6_BSD, dissect_ipv6, proto_ipv6);
- dissector_add("null.type", BSD_AF_INET6_FREEBSD, dissect_ipv6, proto_ipv6);
- dissector_add("ip.proto", IP_PROTO_NONE, dissect_ipv6_none, proto_ipv6);
+ dissector_add("ethertype", ETHERTYPE_IPv6, dissect_ipv6, proto_ipv6);
+ dissector_add("ppp.protocol", PPP_IPV6, dissect_ipv6, proto_ipv6);
+ dissector_add("ip.proto", IP_PROTO_IPV6, dissect_ipv6, proto_ipv6);
+ dissector_add("null.type", BSD_AF_INET6_BSD, dissect_ipv6, proto_ipv6);
+ dissector_add("null.type", BSD_AF_INET6_FREEBSD, dissect_ipv6, proto_ipv6);
+ dissector_add("ip.proto", IP_PROTO_NONE, dissect_ipv6_none, proto_ipv6);
}
* Routines for PIM disassembly
* (c) Copyright Jun-ichiro itojun Hagino <itojun@itojun.org>
*
- * $Id: packet-pim.c,v 1.25 2001/04/23 03:37:31 guy Exp $
+ * $Id: packet-pim.c,v 1.26 2001/04/23 03:56:57 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#include "packet.h"
#include "packet-ip.h"
-#include "packet-ipv6.h"
#include "in_cksum.h"
#define PIM_TYPE(x) ((x) & 0x0f)
static gint ett_pim = -1;
static dissector_handle_t ip_handle;
+static dissector_handle_t ipv6_handle;
/*
* Address family values.
break;
case 6: /* IPv6 */
#if 0
- dissect_ipv6(next_tvb, pinfo, tree);
+ call_dissector(ipv6_handle, next_tvb, pinfo, tree);
#else
- dissect_ipv6(next_tvb, pinfo, pimopt_tree);
+ call_dissector(ipv6_handle, next_tvb, pinfo, pimopt_tree);
#endif
break;
default:
dissector_add("ip.proto", IP_PROTO_PIM, dissect_pim, proto_pim);
/*
- * Get a handle for the IP dissector.
+ * Get handles for the IPv4 and IPv6 dissectors.
*/
ip_handle = find_dissector("ip");
+ ipv6_handle = find_dissector("ipv6");
}