#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.55 2001-06-15 22:17:32 fenner Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.60 2002-05-30 22:01:34 itojun Exp $";
#endif
#ifdef HAVE_CONFIG_H
#include <arpa/inet.h>
#include <stdio.h>
+#include <string.h>
#include <netdb.h>
#include "ip6.h"
case ICMP6_NI_REPLY:
icmp6_nodeinfo_print(icmp6len, bp, ep);
break;
+ case ICMP6_HADISCOV_REQUEST:
+ case ICMP6_HADISCOV_REPLY:
+ {
+ struct in6_addr *in6;
+ u_int32_t *res;
+ u_char *cp;
+ printf("icmp6: ha discovery %s: ",
+ dp->icmp6_type == ICMP6_HADISCOV_REQUEST ?
+ "request" : "reply");
+ TCHECK(dp->icmp6_data16[0]);
+ printf("id=%d", ntohs(dp->icmp6_data16[0]));
+ cp = (u_char *)dp + icmp6len;
+ res = (u_int32_t *)(dp + 1);
+ in6 = (struct in6_addr *)(res + 2);
+ for (; (u_char *)in6 < cp; in6++) {
+ TCHECK(*in6);
+ printf(", %s", ip6addr_string(in6));
+ }
+ break;
+ }
+ case ICMP6_MOBILEPREFIX_SOLICIT:
+ case ICMP6_MOBILEPREFIX_ADVERT:
default:
printf("icmp6: type-#%d", dp->icmp6_type);
break;
const struct icmp6_opts_redirect *opr;
const struct nd_opt_mtu *opm;
const struct nd_opt_advinterval *opa;
+ const struct nd_opt_homeagent_info *oph;
const struct nd_opt_route_info *opri;
const u_char *cp, *ep;
struct in6_addr in6, *in6p;
/*(*/
printf(")");
break;
+ case ND_OPT_HOMEAGENT_INFO:
+ oph = (struct nd_opt_homeagent_info *)op;
+ TCHECK(oph->nd_opt_hai_lifetime);
+ printf("(ha info:"); /*)*/
+ printf(" pref=%d", ntohs(oph->nd_opt_hai_preference));
+ printf(", lifetime=%u", ntohs(oph->nd_opt_hai_lifetime));
+ printf(")");
+ break;
case ND_OPT_ROUTE_INFO:
opri = (struct nd_opt_route_info *)op;
TCHECK(opri->nd_opt_rti_lifetime);
printf(")");
break;
default:
- printf("(unknwon opt_type=%d, opt_len=%d)",
+ printf("(unknown opt_type=%d, opt_len=%d)",
op->nd_opt_type, op->nd_opt_len);
break;
}