diff options
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | packet-icmpv6.c | 62 | ||||
-rw-r--r-- | packet-ipv6.c | 4 | ||||
-rw-r--r-- | packet-ipv6.h | 29 |
4 files changed, 90 insertions, 6 deletions
@@ -511,6 +511,7 @@ Burke Lau <burke_lau[AT]agilent.com> { Martti Kuparinen <martti.kuparinen[AT]nomadiclab.com> { Mobile IPv6 support + HMIPv6 support } David Hampton <dhampton[AT]mac.com> { diff --git a/packet-icmpv6.c b/packet-icmpv6.c index e6d8530b24..15a44b034c 100644 --- a/packet-icmpv6.c +++ b/packet-icmpv6.c @@ -1,7 +1,7 @@ /* packet-icmpv6.c * Routines for ICMPv6 packet disassembly * - * $Id: packet-icmpv6.c,v 1.48 2001/07/02 07:11:39 guy Exp $ + * $Id: packet-icmpv6.c,v 1.49 2001/09/04 21:04:51 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -9,6 +9,8 @@ * * MobileIPv6 support added by Tomislav Borosa <tomislav.borosa@siemens.hr> * + * HMIPv6 support added by Martti Kuparinen <martti.kuparinen@iki.fi> + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -155,7 +157,7 @@ static void dissect_icmpv6opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { proto_tree *icmp6opt_tree, *field_tree; - proto_item *ti, *tf; + proto_item *ti, *tf; struct nd_opt_hdr nd_opt_hdr, *opt; int len; char *typename; @@ -205,6 +207,9 @@ again: case ND_OPT_HOMEAGENT_INFO: typename = "Home Agent Information"; break; + case ND_OPT_MAP: + typename = "HMIPv6 MAP option"; + break; default: typename = "Unknown"; break; @@ -312,6 +317,59 @@ again: pntohs(&pi->nd_opt_ha_info_ha_life)); break; } + case ND_OPT_MAP: + { + struct nd_opt_map_info mapbuf, *map; + int flagoff; + + map = &mapbuf; + tvb_memcpy(tvb, (guint8 *)map, offset, sizeof *map); + proto_tree_add_text(icmp6opt_tree, tvb, + offset + offsetof(struct nd_opt_map_info, nd_opt_map_distance), + 1, "Distance: %d", map->nd_opt_map_distance); + proto_tree_add_text(icmp6opt_tree, tvb, + offset + offsetof(struct nd_opt_map_info, nd_opt_map_preference), + 1, "Preference: %d", map->nd_opt_map_preference); + proto_tree_add_text(icmp6opt_tree, tvb, + offset + offsetof(struct nd_opt_map_info, nd_opt_map_prefixlen), + 1, "Prefix Length: %d", map->nd_opt_map_prefixlen); + flagoff = offset + offsetof(struct nd_opt_map_info, + nd_opt_map_flags); + tf = proto_tree_add_text(icmp6opt_tree, tvb, flagoff, 1, + "Flags: 0x%02x", + tvb_get_guint8(tvb, offset + offsetof(struct nd_opt_map_info, + nd_opt_map_flags))); + field_tree = proto_item_add_subtree(tf, ett_icmpv6flag); + proto_tree_add_text(field_tree, tvb, flagoff, 1, "%s", + decode_boolean_bitfield(map->nd_opt_map_flags, + ND_OPT_MAP_FLAG_R, 8, "R", "")); + proto_tree_add_text(field_tree, tvb, flagoff, 1, "%s", + decode_boolean_bitfield(map->nd_opt_map_flags, + ND_OPT_MAP_FLAG_M, 8, "M", "")); + proto_tree_add_text(field_tree, tvb, flagoff, 1, "%s", + decode_boolean_bitfield(map->nd_opt_map_flags, + ND_OPT_MAP_FLAG_I, 8, "I", "")); + proto_tree_add_text(field_tree, tvb, flagoff, 1, "%s", + decode_boolean_bitfield(map->nd_opt_map_flags, + ND_OPT_MAP_FLAG_T, 8, "T", "")); + proto_tree_add_text(field_tree, tvb, flagoff, 1, "%s", + decode_boolean_bitfield(map->nd_opt_map_flags, + ND_OPT_MAP_FLAG_P, 8, "P", "")); + proto_tree_add_text(icmp6opt_tree, tvb, + offset + offsetof(struct nd_opt_map_info, nd_opt_map_lifetime), + 4, "Lifetime: %d", pntohs(&map->nd_opt_map_lifetime)); + + 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; + } case ND_OPT_ROUTE_INFO: { struct nd_opt_route_info ribuf, *ri; diff --git a/packet-ipv6.c b/packet-ipv6.c index d5a6e7de0e..5288f8f424 100644 --- a/packet-ipv6.c +++ b/packet-ipv6.c @@ -1,7 +1,7 @@ /* packet-ipv6.c * Routines for IPv6 packet disassembly * - * $Id: packet-ipv6.c,v 1.61 2001/06/29 09:46:52 guy Exp $ + * $Id: packet-ipv6.c,v 1.62 2001/09/04 21:04:51 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -972,7 +972,7 @@ dissect_ipv6_none(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (hf_ipv6_mipv6_length != -1) { if (check_col(pinfo->fd, COL_INFO)) - col_add_fstr(pinfo->fd, COL_INFO, "MobileIPv6 Destination Option"); + col_add_fstr(pinfo->fd, COL_INFO, "Mobile IPv6 Destination Option"); } else { if (check_col(pinfo->fd, COL_INFO)) col_add_fstr(pinfo->fd, COL_INFO, "IPv6 no next header"); diff --git a/packet-ipv6.h b/packet-ipv6.h index 10cfefd965..eb92c5ea4c 100644 --- a/packet-ipv6.h +++ b/packet-ipv6.h @@ -1,7 +1,7 @@ /* packet-ipv6.h * Definitions for IPv6 packet disassembly * - * $Id: packet-ipv6.h,v 1.23 2001/06/26 17:31:36 itojun Exp $ + * $Id: packet-ipv6.h,v 1.24 2001/09/04 21:04:52 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -9,6 +9,8 @@ * Copyright 1998 Gerald Combs * * MobileIPv6 support added by Tomislav Borosa <tomislav.borosa@siemens.hr> + * + * HMIPv6 support added by Martti Kuparinen <martti.kuparinen@iki.fi> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -390,8 +392,13 @@ struct nd_opt_hdr { /* Neighbor discovery option header */ #define ND_OPT_MTU 5 #define ND_OPT_ADVINTERVAL 7 #define ND_OPT_HOMEAGENT_INFO 8 +#define ND_OPT_SOURCE_ADDRLIST 9 +#define ND_OPT_TARGET_ADDRLIST 10 + /* draft-ietf-ipngwg-router-preference, not officially assigned yet */ -#define ND_OPT_ROUTE_INFO 9 +#define ND_OPT_ROUTE_INFO 200 +/* draft-ietf-mobileip-hmipv6, not officially assigned yet */ +#define ND_OPT_MAP 201 struct nd_opt_prefix_info { /* prefix information */ guint8 nd_opt_pi_type; @@ -448,6 +455,24 @@ struct nd_opt_route_info { /* route info */ /* prefix follows */ }; +struct nd_opt_map_info { /* HMIPv6 MAP option */ + guint8 nd_opt_map_type; + guint8 nd_opt_map_len; + guint8 nd_opt_map_distance; + guint8 nd_opt_map_preference; + guint8 nd_opt_map_prefixlen; + guint8 nd_opt_map_flags; + guint16 nd_opt_map_unused; + guint32 nd_opt_map_lifetime; + struct e_in6_addr nd_opt_map_address; +}; + +#define ND_OPT_MAP_FLAG_R 0x80 +#define ND_OPT_MAP_FLAG_M 0x40 +#define ND_OPT_MAP_FLAG_I 0x20 +#define ND_OPT_MAP_FLAG_T 0x10 +#define ND_OPT_MAP_FLAG_P 0x08 + /* * icmp6 node information */ |