Home | History | Annotate | Line # | Download | only in netinet
icmp6.h revision 1.27.2.5
      1  1.27.2.5  christos /*	$NetBSD: icmp6.h,v 1.27.2.5 2005/12/11 10:29:24 christos Exp $	*/
      2      1.26    itojun /*	$KAME: icmp6.h,v 1.84 2003/04/23 10:26:51 itojun Exp $	*/
      3      1.26    itojun 
      4       1.3   thorpej 
      5       1.2    itojun /*
      6       1.2    itojun  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
      7       1.2    itojun  * All rights reserved.
      8       1.9    itojun  *
      9       1.2    itojun  * Redistribution and use in source and binary forms, with or without
     10       1.2    itojun  * modification, are permitted provided that the following conditions
     11       1.2    itojun  * are met:
     12       1.2    itojun  * 1. Redistributions of source code must retain the above copyright
     13       1.2    itojun  *    notice, this list of conditions and the following disclaimer.
     14       1.2    itojun  * 2. Redistributions in binary form must reproduce the above copyright
     15       1.2    itojun  *    notice, this list of conditions and the following disclaimer in the
     16       1.2    itojun  *    documentation and/or other materials provided with the distribution.
     17       1.2    itojun  * 3. Neither the name of the project nor the names of its contributors
     18       1.2    itojun  *    may be used to endorse or promote products derived from this software
     19       1.2    itojun  *    without specific prior written permission.
     20       1.9    itojun  *
     21       1.2    itojun  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
     22       1.2    itojun  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23       1.2    itojun  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24       1.2    itojun  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
     25       1.2    itojun  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     26       1.2    itojun  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     27       1.2    itojun  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     28       1.2    itojun  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     29       1.2    itojun  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     30       1.2    itojun  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     31       1.2    itojun  * SUCH DAMAGE.
     32       1.2    itojun  */
     33       1.2    itojun 
     34       1.4    itojun /*
     35       1.4    itojun  * Copyright (c) 1982, 1986, 1993
     36       1.4    itojun  *	The Regents of the University of California.  All rights reserved.
     37       1.4    itojun  *
     38       1.4    itojun  * Redistribution and use in source and binary forms, with or without
     39       1.4    itojun  * modification, are permitted provided that the following conditions
     40       1.4    itojun  * are met:
     41       1.4    itojun  * 1. Redistributions of source code must retain the above copyright
     42       1.4    itojun  *    notice, this list of conditions and the following disclaimer.
     43       1.4    itojun  * 2. Redistributions in binary form must reproduce the above copyright
     44       1.4    itojun  *    notice, this list of conditions and the following disclaimer in the
     45       1.4    itojun  *    documentation and/or other materials provided with the distribution.
     46  1.27.2.1     skrll  * 3. Neither the name of the University nor the names of its contributors
     47       1.4    itojun  *    may be used to endorse or promote products derived from this software
     48       1.4    itojun  *    without specific prior written permission.
     49       1.4    itojun  *
     50       1.4    itojun  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     51       1.4    itojun  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     52       1.4    itojun  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     53       1.4    itojun  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     54       1.4    itojun  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     55       1.4    itojun  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     56       1.4    itojun  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     57       1.4    itojun  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     58       1.4    itojun  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     59       1.4    itojun  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     60       1.4    itojun  * SUCH DAMAGE.
     61       1.4    itojun  *
     62       1.4    itojun  *	@(#)ip_icmp.h	8.1 (Berkeley) 6/10/93
     63       1.4    itojun  */
     64       1.4    itojun 
     65       1.2    itojun #ifndef _NETINET_ICMP6_H_
     66       1.2    itojun #define _NETINET_ICMP6_H_
     67       1.2    itojun 
     68       1.4    itojun #define ICMPV6_PLD_MAXLEN	1232	/* IPV6_MMTU - sizeof(struct ip6_hdr)
     69       1.4    itojun 					   - sizeof(struct icmp6_hdr) */
     70       1.4    itojun 
     71       1.4    itojun struct icmp6_hdr {
     72       1.4    itojun 	u_int8_t	icmp6_type;	/* type field */
     73       1.4    itojun 	u_int8_t	icmp6_code;	/* code field */
     74       1.4    itojun 	u_int16_t	icmp6_cksum;	/* checksum field */
     75       1.4    itojun 	union {
     76       1.4    itojun 		u_int32_t	icmp6_un_data32[1]; /* type-specific field */
     77       1.4    itojun 		u_int16_t	icmp6_un_data16[2]; /* type-specific field */
     78       1.4    itojun 		u_int8_t	icmp6_un_data8[4];  /* type-specific field */
     79       1.4    itojun 	} icmp6_dataun;
     80      1.21    itojun } __attribute__((__packed__));
     81       1.4    itojun 
     82       1.4    itojun #define icmp6_data32	icmp6_dataun.icmp6_un_data32
     83       1.4    itojun #define icmp6_data16	icmp6_dataun.icmp6_un_data16
     84       1.4    itojun #define icmp6_data8	icmp6_dataun.icmp6_un_data8
     85       1.4    itojun #define icmp6_pptr	icmp6_data32[0]		/* parameter prob */
     86       1.4    itojun #define icmp6_mtu	icmp6_data32[0]		/* packet too big */
     87       1.4    itojun #define icmp6_id	icmp6_data16[0]		/* echo request/reply */
     88       1.4    itojun #define icmp6_seq	icmp6_data16[1]		/* echo request/reply */
     89       1.4    itojun #define icmp6_maxdelay	icmp6_data16[0]		/* mcast group membership */
     90       1.4    itojun 
     91       1.4    itojun #define ICMP6_DST_UNREACH		1	/* dest unreachable, codes: */
     92       1.4    itojun #define ICMP6_PACKET_TOO_BIG		2	/* packet too big */
     93       1.4    itojun #define ICMP6_TIME_EXCEEDED		3	/* time exceeded, code: */
     94       1.4    itojun #define ICMP6_PARAM_PROB		4	/* ip6 header bad */
     95       1.4    itojun 
     96       1.4    itojun #define ICMP6_ECHO_REQUEST		128	/* echo service */
     97       1.4    itojun #define ICMP6_ECHO_REPLY		129	/* echo reply */
     98      1.27    itojun #define MLD_LISTENER_QUERY		130 	/* multicast listener query */
     99      1.27    itojun #define MLD_LISTENER_REPORT		131	/* multicast listener report */
    100      1.27    itojun #define MLD_LISTENER_DONE		132	/* multicast listener done */
    101      1.27    itojun 
    102      1.27    itojun /* RFC2292 decls */
    103       1.4    itojun #define ICMP6_MEMBERSHIP_QUERY		130	/* group membership query */
    104       1.4    itojun #define ICMP6_MEMBERSHIP_REPORT		131	/* group membership report */
    105       1.4    itojun #define ICMP6_MEMBERSHIP_REDUCTION	132	/* group membership termination */
    106      1.26    itojun 
    107      1.26    itojun #ifndef _KERNEL
    108      1.26    itojun /* the followings are for backward compatibility to old KAME apps. */
    109      1.26    itojun #define MLD6_LISTENER_QUERY	MLD_LISTENER_QUERY
    110      1.26    itojun #define MLD6_LISTENER_REPORT	MLD_LISTENER_REPORT
    111      1.26    itojun #define MLD6_LISTENER_DONE	MLD_LISTENER_DONE
    112      1.26    itojun #endif
    113       1.4    itojun 
    114       1.4    itojun #define ND_ROUTER_SOLICIT		133	/* router solicitation */
    115       1.4    itojun #define ND_ROUTER_ADVERT		134	/* router advertisment */
    116       1.4    itojun #define ND_NEIGHBOR_SOLICIT		135	/* neighbor solicitation */
    117       1.4    itojun #define ND_NEIGHBOR_ADVERT		136	/* neighbor advertisment */
    118       1.4    itojun #define ND_REDIRECT			137	/* redirect */
    119       1.4    itojun 
    120       1.4    itojun #define ICMP6_ROUTER_RENUMBERING	138	/* router renumbering */
    121       1.4    itojun 
    122       1.4    itojun #define ICMP6_WRUREQUEST		139	/* who are you request */
    123       1.4    itojun #define ICMP6_WRUREPLY			140	/* who are you reply */
    124       1.4    itojun #define ICMP6_FQDN_QUERY		139	/* FQDN query */
    125       1.4    itojun #define ICMP6_FQDN_REPLY		140	/* FQDN reply */
    126       1.4    itojun #define ICMP6_NI_QUERY			139	/* node information request */
    127       1.4    itojun #define ICMP6_NI_REPLY			140	/* node information reply */
    128       1.4    itojun 
    129       1.4    itojun /* The definitions below are experimental. TBA */
    130      1.26    itojun #define MLD_MTRACE_RESP			200	/* mtrace response(to sender) */
    131      1.26    itojun #define MLD_MTRACE			201	/* mtrace messages */
    132      1.26    itojun 
    133      1.26    itojun #ifndef _KERNEL
    134      1.26    itojun /* the followings are for backward compatibility to old KAME apps. */
    135      1.26    itojun #define MLD6_MTRACE_RESP	MLD_MTRACE_RESP
    136      1.26    itojun #define MLD6_MTRACE		MLD_MTRACE
    137      1.26    itojun #endif
    138       1.4    itojun 
    139      1.21    itojun #define ICMP6_MAXTYPE			201
    140       1.4    itojun 
    141       1.4    itojun #define ICMP6_DST_UNREACH_NOROUTE	0	/* no route to destination */
    142       1.4    itojun #define ICMP6_DST_UNREACH_ADMIN	 	1	/* administratively prohibited */
    143       1.4    itojun #define ICMP6_DST_UNREACH_NOTNEIGHBOR	2	/* not a neighbor(obsolete) */
    144       1.4    itojun #define ICMP6_DST_UNREACH_BEYONDSCOPE	2	/* beyond scope of source address */
    145       1.4    itojun #define ICMP6_DST_UNREACH_ADDR		3	/* address unreachable */
    146       1.4    itojun #define ICMP6_DST_UNREACH_NOPORT	4	/* port unreachable */
    147       1.4    itojun 
    148       1.4    itojun #define ICMP6_TIME_EXCEED_TRANSIT 	0	/* ttl==0 in transit */
    149       1.4    itojun #define ICMP6_TIME_EXCEED_REASSEMBLY	1	/* ttl==0 in reass */
    150       1.4    itojun 
    151       1.4    itojun #define ICMP6_PARAMPROB_HEADER 	 	0	/* erroneous header field */
    152       1.4    itojun #define ICMP6_PARAMPROB_NEXTHEADER	1	/* unrecognized next header */
    153       1.4    itojun #define ICMP6_PARAMPROB_OPTION		2	/* unrecognized option */
    154       1.4    itojun 
    155       1.4    itojun #define ICMP6_INFOMSG_MASK		0x80	/* all informational messages */
    156       1.4    itojun 
    157       1.9    itojun #define ICMP6_NI_SUBJ_IPV6	0	/* Query Subject is an IPv6 address */
    158       1.9    itojun #define ICMP6_NI_SUBJ_FQDN	1	/* Query Subject is a Domain name */
    159       1.9    itojun #define ICMP6_NI_SUBJ_IPV4	2	/* Query Subject is an IPv4 address */
    160       1.9    itojun 
    161      1.12    itojun #define ICMP6_NI_SUCCESS	0	/* node information successful reply */
    162       1.4    itojun #define ICMP6_NI_REFUSED	1	/* node information request is refused */
    163       1.4    itojun #define ICMP6_NI_UNKNOWN	2	/* unknown Qtype */
    164       1.4    itojun 
    165       1.4    itojun #define ICMP6_ROUTER_RENUMBERING_COMMAND  0	/* rr command */
    166       1.4    itojun #define ICMP6_ROUTER_RENUMBERING_RESULT   1	/* rr result */
    167       1.4    itojun #define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET   255	/* rr seq num reset */
    168       1.4    itojun 
    169       1.4    itojun /* Used in kernel only */
    170       1.4    itojun #define ND_REDIRECT_ONLINK	0	/* redirect to an on-link node */
    171       1.4    itojun #define ND_REDIRECT_ROUTER	1	/* redirect to a better router */
    172       1.4    itojun 
    173       1.4    itojun /*
    174       1.4    itojun  * Multicast Listener Discovery
    175       1.4    itojun  */
    176      1.26    itojun struct mld_hdr {
    177      1.26    itojun 	struct icmp6_hdr	mld_icmp6_hdr;
    178      1.26    itojun 	struct in6_addr		mld_addr; /* multicast address */
    179      1.21    itojun } __attribute__((__packed__));
    180       1.4    itojun 
    181      1.26    itojun /* definitions to provide backward compatibility to old KAME applications */
    182      1.26    itojun #ifndef _KERNEL
    183      1.26    itojun #define mld6_hdr	mld_hdr
    184      1.26    itojun #define mld6_type	mld_type
    185      1.26    itojun #define mld6_code	mld_code
    186      1.26    itojun #define mld6_cksum	mld_cksum
    187      1.26    itojun #define mld6_maxdelay	mld_maxdelay
    188      1.26    itojun #define mld6_reserved	mld_reserved
    189      1.26    itojun #define mld6_addr	mld_addr
    190      1.26    itojun #endif
    191      1.26    itojun 
    192      1.26    itojun /* shortcut macro definitions */
    193      1.26    itojun #define mld_type	mld_icmp6_hdr.icmp6_type
    194      1.26    itojun #define mld_code	mld_icmp6_hdr.icmp6_code
    195      1.26    itojun #define mld_cksum	mld_icmp6_hdr.icmp6_cksum
    196      1.26    itojun #define mld_maxdelay	mld_icmp6_hdr.icmp6_data16[0]
    197      1.26    itojun #define mld_reserved	mld_icmp6_hdr.icmp6_data16[1]
    198       1.4    itojun 
    199       1.4    itojun /*
    200       1.4    itojun  * Neighbor Discovery
    201       1.4    itojun  */
    202       1.4    itojun 
    203       1.4    itojun struct nd_router_solicit {	/* router solicitation */
    204       1.4    itojun 	struct icmp6_hdr 	nd_rs_hdr;
    205       1.4    itojun 	/* could be followed by options */
    206      1.21    itojun } __attribute__((__packed__));
    207       1.4    itojun 
    208       1.4    itojun #define nd_rs_type	nd_rs_hdr.icmp6_type
    209       1.4    itojun #define nd_rs_code	nd_rs_hdr.icmp6_code
    210       1.4    itojun #define nd_rs_cksum	nd_rs_hdr.icmp6_cksum
    211       1.4    itojun #define nd_rs_reserved	nd_rs_hdr.icmp6_data32[0]
    212       1.4    itojun 
    213       1.4    itojun struct nd_router_advert {	/* router advertisement */
    214       1.4    itojun 	struct icmp6_hdr	nd_ra_hdr;
    215       1.4    itojun 	u_int32_t		nd_ra_reachable;	/* reachable time */
    216       1.4    itojun 	u_int32_t		nd_ra_retransmit;	/* retransmit timer */
    217       1.4    itojun 	/* could be followed by options */
    218      1.21    itojun } __attribute__((__packed__));
    219       1.4    itojun 
    220       1.4    itojun #define nd_ra_type		nd_ra_hdr.icmp6_type
    221       1.4    itojun #define nd_ra_code		nd_ra_hdr.icmp6_code
    222       1.4    itojun #define nd_ra_cksum		nd_ra_hdr.icmp6_cksum
    223       1.4    itojun #define nd_ra_curhoplimit	nd_ra_hdr.icmp6_data8[0]
    224       1.4    itojun #define nd_ra_flags_reserved	nd_ra_hdr.icmp6_data8[1]
    225       1.4    itojun #define ND_RA_FLAG_MANAGED	0x80
    226       1.4    itojun #define ND_RA_FLAG_OTHER	0x40
    227       1.4    itojun #define nd_ra_router_lifetime	nd_ra_hdr.icmp6_data16[1]
    228       1.4    itojun 
    229       1.4    itojun struct nd_neighbor_solicit {	/* neighbor solicitation */
    230       1.4    itojun 	struct icmp6_hdr	nd_ns_hdr;
    231       1.4    itojun 	struct in6_addr		nd_ns_target;	/*target address */
    232       1.4    itojun 	/* could be followed by options */
    233      1.21    itojun } __attribute__((__packed__));
    234       1.4    itojun 
    235       1.4    itojun #define nd_ns_type		nd_ns_hdr.icmp6_type
    236       1.4    itojun #define nd_ns_code		nd_ns_hdr.icmp6_code
    237       1.4    itojun #define nd_ns_cksum		nd_ns_hdr.icmp6_cksum
    238       1.4    itojun #define nd_ns_reserved		nd_ns_hdr.icmp6_data32[0]
    239       1.4    itojun 
    240       1.4    itojun struct nd_neighbor_advert {	/* neighbor advertisement */
    241       1.4    itojun 	struct icmp6_hdr	nd_na_hdr;
    242       1.4    itojun 	struct in6_addr		nd_na_target;	/* target address */
    243       1.4    itojun 	/* could be followed by options */
    244      1.21    itojun } __attribute__((__packed__));
    245       1.4    itojun 
    246       1.4    itojun #define nd_na_type		nd_na_hdr.icmp6_type
    247       1.4    itojun #define nd_na_code		nd_na_hdr.icmp6_code
    248       1.4    itojun #define nd_na_cksum		nd_na_hdr.icmp6_cksum
    249       1.4    itojun #define nd_na_flags_reserved	nd_na_hdr.icmp6_data32[0]
    250       1.4    itojun #if BYTE_ORDER == BIG_ENDIAN
    251       1.4    itojun #define ND_NA_FLAG_ROUTER		0x80000000
    252       1.4    itojun #define ND_NA_FLAG_SOLICITED		0x40000000
    253       1.4    itojun #define ND_NA_FLAG_OVERRIDE		0x20000000
    254       1.4    itojun #else
    255       1.4    itojun #if BYTE_ORDER == LITTLE_ENDIAN
    256       1.4    itojun #define ND_NA_FLAG_ROUTER		0x80
    257       1.4    itojun #define ND_NA_FLAG_SOLICITED		0x40
    258       1.4    itojun #define ND_NA_FLAG_OVERRIDE		0x20
    259       1.4    itojun #endif
    260       1.4    itojun #endif
    261       1.4    itojun 
    262       1.4    itojun struct nd_redirect {		/* redirect */
    263       1.4    itojun 	struct icmp6_hdr	nd_rd_hdr;
    264       1.4    itojun 	struct in6_addr		nd_rd_target;	/* target address */
    265       1.4    itojun 	struct in6_addr		nd_rd_dst;	/* destination address */
    266       1.4    itojun 	/* could be followed by options */
    267      1.21    itojun } __attribute__((__packed__));
    268       1.4    itojun 
    269       1.4    itojun #define nd_rd_type		nd_rd_hdr.icmp6_type
    270       1.4    itojun #define nd_rd_code		nd_rd_hdr.icmp6_code
    271       1.4    itojun #define nd_rd_cksum		nd_rd_hdr.icmp6_cksum
    272       1.4    itojun #define nd_rd_reserved		nd_rd_hdr.icmp6_data32[0]
    273       1.4    itojun 
    274       1.4    itojun struct nd_opt_hdr {		/* Neighbor discovery option header */
    275       1.4    itojun 	u_int8_t	nd_opt_type;
    276       1.4    itojun 	u_int8_t	nd_opt_len;
    277       1.4    itojun 	/* followed by option specific data*/
    278      1.21    itojun } __attribute__((__packed__));
    279       1.4    itojun 
    280       1.4    itojun #define ND_OPT_SOURCE_LINKADDR		1
    281       1.4    itojun #define ND_OPT_TARGET_LINKADDR		2
    282       1.4    itojun #define ND_OPT_PREFIX_INFORMATION	3
    283       1.4    itojun #define ND_OPT_REDIRECTED_HEADER	4
    284       1.4    itojun #define ND_OPT_MTU			5
    285       1.4    itojun 
    286       1.4    itojun struct nd_opt_prefix_info {	/* prefix information */
    287       1.4    itojun 	u_int8_t	nd_opt_pi_type;
    288       1.4    itojun 	u_int8_t	nd_opt_pi_len;
    289       1.4    itojun 	u_int8_t	nd_opt_pi_prefix_len;
    290       1.4    itojun 	u_int8_t	nd_opt_pi_flags_reserved;
    291       1.4    itojun 	u_int32_t	nd_opt_pi_valid_time;
    292       1.4    itojun 	u_int32_t	nd_opt_pi_preferred_time;
    293       1.4    itojun 	u_int32_t	nd_opt_pi_reserved2;
    294       1.4    itojun 	struct in6_addr	nd_opt_pi_prefix;
    295      1.21    itojun } __attribute__((__packed__));
    296       1.4    itojun 
    297       1.4    itojun #define ND_OPT_PI_FLAG_ONLINK		0x80
    298       1.4    itojun #define ND_OPT_PI_FLAG_AUTO		0x40
    299       1.4    itojun 
    300      1.26    itojun struct nd_opt_rd_hdr {		/* redirected header */
    301       1.4    itojun 	u_int8_t	nd_opt_rh_type;
    302       1.4    itojun 	u_int8_t	nd_opt_rh_len;
    303       1.4    itojun 	u_int16_t	nd_opt_rh_reserved1;
    304       1.4    itojun 	u_int32_t	nd_opt_rh_reserved2;
    305       1.4    itojun 	/* followed by IP header and data */
    306      1.21    itojun } __attribute__((__packed__));
    307       1.4    itojun 
    308       1.4    itojun struct nd_opt_mtu {		/* MTU option */
    309       1.4    itojun 	u_int8_t	nd_opt_mtu_type;
    310       1.4    itojun 	u_int8_t	nd_opt_mtu_len;
    311       1.4    itojun 	u_int16_t	nd_opt_mtu_reserved;
    312       1.4    itojun 	u_int32_t	nd_opt_mtu_mtu;
    313      1.21    itojun } __attribute__((__packed__));
    314       1.4    itojun 
    315       1.4    itojun /*
    316       1.4    itojun  * icmp6 namelookup
    317       1.4    itojun  */
    318       1.4    itojun 
    319       1.4    itojun struct icmp6_namelookup {
    320       1.4    itojun 	struct icmp6_hdr 	icmp6_nl_hdr;
    321       1.4    itojun 	u_int8_t	icmp6_nl_nonce[8];
    322       1.9    itojun 	int32_t		icmp6_nl_ttl;
    323       1.4    itojun #if 0
    324       1.4    itojun 	u_int8_t	icmp6_nl_len;
    325       1.4    itojun 	u_int8_t	icmp6_nl_name[3];
    326       1.4    itojun #endif
    327       1.4    itojun 	/* could be followed by options */
    328      1.21    itojun } __attribute__((__packed__));
    329       1.4    itojun 
    330       1.4    itojun /*
    331       1.4    itojun  * icmp6 node information
    332       1.4    itojun  */
    333       1.4    itojun struct icmp6_nodeinfo {
    334       1.4    itojun 	struct icmp6_hdr icmp6_ni_hdr;
    335       1.4    itojun 	u_int8_t icmp6_ni_nonce[8];
    336       1.4    itojun 	/* could be followed by reply data */
    337      1.21    itojun } __attribute__((__packed__));
    338       1.4    itojun 
    339       1.4    itojun #define ni_type		icmp6_ni_hdr.icmp6_type
    340       1.4    itojun #define ni_code		icmp6_ni_hdr.icmp6_code
    341       1.4    itojun #define ni_cksum	icmp6_ni_hdr.icmp6_cksum
    342       1.4    itojun #define ni_qtype	icmp6_ni_hdr.icmp6_data16[0]
    343       1.4    itojun #define ni_flags	icmp6_ni_hdr.icmp6_data16[1]
    344       1.4    itojun 
    345       1.4    itojun #define NI_QTYPE_NOOP		0 /* NOOP  */
    346       1.4    itojun #define NI_QTYPE_SUPTYPES	1 /* Supported Qtypes */
    347      1.13    itojun #define NI_QTYPE_FQDN		2 /* FQDN (draft 04) */
    348      1.13    itojun #define NI_QTYPE_DNSNAME	2 /* DNS Name */
    349      1.12    itojun #define NI_QTYPE_NODEADDR	3 /* Node Addresses */
    350      1.12    itojun #define NI_QTYPE_IPV4ADDR	4 /* IPv4 Addresses */
    351       1.4    itojun 
    352       1.4    itojun #if BYTE_ORDER == BIG_ENDIAN
    353       1.4    itojun #define NI_SUPTYPE_FLAG_COMPRESS	0x1
    354       1.4    itojun #define NI_FQDN_FLAG_VALIDTTL		0x1
    355       1.7    itojun #elif BYTE_ORDER == LITTLE_ENDIAN
    356       1.7    itojun #define NI_SUPTYPE_FLAG_COMPRESS	0x0100
    357       1.7    itojun #define NI_FQDN_FLAG_VALIDTTL		0x0100
    358       1.7    itojun #endif
    359       1.7    itojun 
    360       1.7    itojun #ifdef NAME_LOOKUPS_04
    361       1.7    itojun #if BYTE_ORDER == BIG_ENDIAN
    362       1.4    itojun #define NI_NODEADDR_FLAG_LINKLOCAL	0x1
    363       1.4    itojun #define NI_NODEADDR_FLAG_SITELOCAL	0x2
    364       1.4    itojun #define NI_NODEADDR_FLAG_GLOBAL		0x4
    365       1.4    itojun #define NI_NODEADDR_FLAG_ALL		0x8
    366       1.4    itojun #define NI_NODEADDR_FLAG_TRUNCATE	0x10
    367       1.4    itojun #define NI_NODEADDR_FLAG_ANYCAST	0x20 /* just experimental. not in spec */
    368       1.4    itojun #elif BYTE_ORDER == LITTLE_ENDIAN
    369       1.4    itojun #define NI_NODEADDR_FLAG_LINKLOCAL	0x0100
    370       1.4    itojun #define NI_NODEADDR_FLAG_SITELOCAL	0x0200
    371       1.4    itojun #define NI_NODEADDR_FLAG_GLOBAL		0x0400
    372       1.4    itojun #define NI_NODEADDR_FLAG_ALL		0x0800
    373       1.4    itojun #define NI_NODEADDR_FLAG_TRUNCATE	0x1000
    374       1.4    itojun #define NI_NODEADDR_FLAG_ANYCAST	0x2000 /* just experimental. not in spec */
    375       1.7    itojun #endif
    376       1.7    itojun #else  /* draft-ietf-ipngwg-icmp-name-lookups-05 (and later?) */
    377       1.7    itojun #if BYTE_ORDER == BIG_ENDIAN
    378       1.7    itojun #define NI_NODEADDR_FLAG_TRUNCATE	0x1
    379       1.7    itojun #define NI_NODEADDR_FLAG_ALL		0x2
    380       1.7    itojun #define NI_NODEADDR_FLAG_COMPAT		0x4
    381       1.7    itojun #define NI_NODEADDR_FLAG_LINKLOCAL	0x8
    382       1.7    itojun #define NI_NODEADDR_FLAG_SITELOCAL	0x10
    383       1.7    itojun #define NI_NODEADDR_FLAG_GLOBAL		0x20
    384       1.7    itojun #define NI_NODEADDR_FLAG_ANYCAST	0x40 /* just experimental. not in spec */
    385       1.7    itojun #elif BYTE_ORDER == LITTLE_ENDIAN
    386       1.7    itojun #define NI_NODEADDR_FLAG_TRUNCATE	0x0100
    387       1.7    itojun #define NI_NODEADDR_FLAG_ALL		0x0200
    388       1.7    itojun #define NI_NODEADDR_FLAG_COMPAT		0x0400
    389       1.7    itojun #define NI_NODEADDR_FLAG_LINKLOCAL	0x0800
    390       1.7    itojun #define NI_NODEADDR_FLAG_SITELOCAL	0x1000
    391       1.7    itojun #define NI_NODEADDR_FLAG_GLOBAL		0x2000
    392       1.7    itojun #define NI_NODEADDR_FLAG_ANYCAST	0x4000 /* just experimental. not in spec */
    393       1.7    itojun #endif
    394       1.4    itojun #endif
    395       1.4    itojun 
    396       1.4    itojun struct ni_reply_fqdn {
    397       1.4    itojun 	u_int32_t ni_fqdn_ttl;	/* TTL */
    398       1.4    itojun 	u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */
    399       1.4    itojun 	u_int8_t ni_fqdn_name[3]; /* XXX: alignment */
    400      1.21    itojun } __attribute__((__packed__));
    401       1.4    itojun 
    402       1.4    itojun /*
    403       1.4    itojun  * Router Renumbering. as router-renum-08.txt
    404       1.4    itojun  */
    405       1.4    itojun struct icmp6_router_renum {	/* router renumbering header */
    406       1.4    itojun 	struct icmp6_hdr	rr_hdr;
    407      1.10    itojun 	u_int8_t	rr_segnum;
    408      1.10    itojun 	u_int8_t	rr_flags;
    409      1.10    itojun 	u_int16_t	rr_maxdelay;
    410      1.10    itojun 	u_int32_t	rr_reserved;
    411      1.21    itojun } __attribute__((__packed__));
    412      1.17    itojun 
    413      1.17    itojun #define ICMP6_RR_FLAGS_TEST		0x80
    414      1.17    itojun #define ICMP6_RR_FLAGS_REQRESULT	0x40
    415      1.17    itojun #define ICMP6_RR_FLAGS_FORCEAPPLY	0x20
    416      1.17    itojun #define ICMP6_RR_FLAGS_SPECSITE		0x10
    417      1.17    itojun #define ICMP6_RR_FLAGS_PREVDONE		0x08
    418      1.10    itojun 
    419      1.10    itojun #define rr_type		rr_hdr.icmp6_type
    420      1.10    itojun #define rr_code		rr_hdr.icmp6_code
    421      1.10    itojun #define rr_cksum	rr_hdr.icmp6_cksum
    422      1.10    itojun #define rr_seqnum 	rr_hdr.icmp6_data32[0]
    423       1.4    itojun 
    424       1.4    itojun struct rr_pco_match {		/* match prefix part */
    425       1.4    itojun 	u_int8_t	rpm_code;
    426       1.4    itojun 	u_int8_t	rpm_len;
    427       1.4    itojun 	u_int8_t	rpm_ordinal;
    428       1.4    itojun 	u_int8_t	rpm_matchlen;
    429       1.4    itojun 	u_int8_t	rpm_minlen;
    430       1.4    itojun 	u_int8_t	rpm_maxlen;
    431       1.4    itojun 	u_int16_t	rpm_reserved;
    432      1.10    itojun 	struct	in6_addr	rpm_prefix;
    433      1.21    itojun } __attribute__((__packed__));
    434       1.4    itojun 
    435       1.4    itojun #define RPM_PCO_ADD		1
    436       1.4    itojun #define RPM_PCO_CHANGE		2
    437       1.4    itojun #define RPM_PCO_SETGLOBAL	3
    438       1.4    itojun #define RPM_PCO_MAX		4
    439       1.4    itojun 
    440       1.4    itojun struct rr_pco_use {		/* use prefix part */
    441       1.4    itojun 	u_int8_t	rpu_uselen;
    442       1.4    itojun 	u_int8_t	rpu_keeplen;
    443      1.10    itojun 	u_int8_t	rpu_ramask;
    444      1.10    itojun 	u_int8_t	rpu_raflags;
    445       1.4    itojun 	u_int32_t	rpu_vltime;
    446       1.4    itojun 	u_int32_t	rpu_pltime;
    447      1.10    itojun 	u_int32_t	rpu_flags;
    448      1.10    itojun 	struct	in6_addr rpu_prefix;
    449      1.21    itojun } __attribute__((__packed__));
    450      1.10    itojun #define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK	0x80
    451      1.10    itojun #define ICMP6_RR_PCOUSE_RAFLAGS_AUTO	0x40
    452      1.10    itojun 
    453      1.10    itojun #if BYTE_ORDER == BIG_ENDIAN
    454      1.10    itojun #define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME     0x80000000
    455      1.10    itojun #define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME     0x40000000
    456       1.4    itojun #elif BYTE_ORDER == LITTLE_ENDIAN
    457      1.10    itojun #define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME     0x80
    458      1.10    itojun #define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME     0x40
    459      1.10    itojun #endif
    460       1.4    itojun 
    461       1.4    itojun struct rr_result {		/* router renumbering result message */
    462      1.10    itojun 	u_int16_t	rrr_flags;
    463       1.4    itojun 	u_int8_t	rrr_ordinal;
    464       1.4    itojun 	u_int8_t	rrr_matchedlen;
    465       1.4    itojun 	u_int32_t	rrr_ifid;
    466      1.10    itojun 	struct	in6_addr rrr_prefix;
    467      1.21    itojun } __attribute__((__packed__));
    468      1.10    itojun #if BYTE_ORDER == BIG_ENDIAN
    469      1.10    itojun #define ICMP6_RR_RESULT_FLAGS_OOB		0x0002
    470      1.10    itojun #define ICMP6_RR_RESULT_FLAGS_FORBIDDEN		0x0001
    471       1.4    itojun #elif BYTE_ORDER == LITTLE_ENDIAN
    472      1.18    itojun #define ICMP6_RR_RESULT_FLAGS_OOB		0x0200
    473      1.18    itojun #define ICMP6_RR_RESULT_FLAGS_FORBIDDEN		0x0100
    474      1.10    itojun #endif
    475       1.4    itojun 
    476       1.4    itojun /*
    477       1.4    itojun  * icmp6 filter structures.
    478       1.4    itojun  */
    479       1.4    itojun 
    480       1.4    itojun struct icmp6_filter {
    481       1.8    itojun 	u_int32_t icmp6_filt[8];
    482       1.4    itojun };
    483       1.4    itojun 
    484       1.4    itojun #define	ICMP6_FILTER_SETPASSALL(filterp) \
    485  1.27.2.4     skrll 	(void)memset(filterp, 0xff, sizeof(struct icmp6_filter))
    486       1.4    itojun #define	ICMP6_FILTER_SETBLOCKALL(filterp) \
    487  1.27.2.4     skrll 	(void)memset(filterp, 0x00, sizeof(struct icmp6_filter))
    488       1.4    itojun #define	ICMP6_FILTER_SETPASS(type, filterp) \
    489       1.8    itojun 	(((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31)))
    490       1.4    itojun #define	ICMP6_FILTER_SETBLOCK(type, filterp) \
    491       1.8    itojun 	(((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31)))
    492       1.4    itojun #define	ICMP6_FILTER_WILLPASS(type, filterp) \
    493       1.8    itojun 	((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0)
    494       1.4    itojun #define	ICMP6_FILTER_WILLBLOCK(type, filterp) \
    495       1.8    itojun 	((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0)
    496       1.4    itojun 
    497       1.4    itojun /*
    498       1.4    itojun  * Variables related to this implementation
    499       1.4    itojun  * of the internet control message protocol version 6.
    500       1.4    itojun  */
    501      1.10    itojun struct icmp6errstat {
    502      1.10    itojun 	u_quad_t icp6errs_dst_unreach_noroute;
    503      1.10    itojun 	u_quad_t icp6errs_dst_unreach_admin;
    504      1.10    itojun 	u_quad_t icp6errs_dst_unreach_beyondscope;
    505      1.10    itojun 	u_quad_t icp6errs_dst_unreach_addr;
    506      1.10    itojun 	u_quad_t icp6errs_dst_unreach_noport;
    507      1.10    itojun 	u_quad_t icp6errs_packet_too_big;
    508      1.10    itojun 	u_quad_t icp6errs_time_exceed_transit;
    509      1.10    itojun 	u_quad_t icp6errs_time_exceed_reassembly;
    510      1.10    itojun 	u_quad_t icp6errs_paramprob_header;
    511      1.10    itojun 	u_quad_t icp6errs_paramprob_nextheader;
    512      1.10    itojun 	u_quad_t icp6errs_paramprob_option;
    513      1.10    itojun 	u_quad_t icp6errs_redirect; /* we regard redirect as an error here */
    514      1.10    itojun 	u_quad_t icp6errs_unknown;
    515      1.10    itojun };
    516      1.10    itojun 
    517       1.4    itojun struct icmp6stat {
    518       1.4    itojun /* statistics related to icmp6 packets generated */
    519       1.4    itojun 	u_quad_t icp6s_error;		/* # of calls to icmp6_error */
    520       1.4    itojun 	u_quad_t icp6s_canterror;	/* no error 'cuz old was icmp */
    521       1.4    itojun 	u_quad_t icp6s_toofreq;		/* no error 'cuz rate limitation */
    522       1.4    itojun 	u_quad_t icp6s_outhist[256];
    523       1.4    itojun /* statistics related to input message processed */
    524       1.4    itojun 	u_quad_t icp6s_badcode;		/* icmp6_code out of range */
    525       1.4    itojun 	u_quad_t icp6s_tooshort;	/* packet < sizeof(struct icmp6_hdr) */
    526       1.4    itojun 	u_quad_t icp6s_checksum;	/* bad checksum */
    527       1.4    itojun 	u_quad_t icp6s_badlen;		/* calculated bound mismatch */
    528      1.21    itojun 	/*
    529      1.21    itojun 	 * number of responses: this member is inherited from netinet code, but
    530      1.21    itojun 	 * for netinet6 code, it is already available in icp6s_outhist[].
    531      1.21    itojun 	 */
    532      1.21    itojun 	u_quad_t icp6s_reflect;
    533      1.24    itojun 	u_quad_t icp6s_inhist[256];
    534       1.4    itojun 	u_quad_t icp6s_nd_toomanyopt;	/* too many ND options */
    535      1.10    itojun 	struct icmp6errstat icp6s_outerrhist;
    536      1.10    itojun #define icp6s_odst_unreach_noroute \
    537      1.10    itojun 	icp6s_outerrhist.icp6errs_dst_unreach_noroute
    538      1.10    itojun #define icp6s_odst_unreach_admin icp6s_outerrhist.icp6errs_dst_unreach_admin
    539      1.10    itojun #define icp6s_odst_unreach_beyondscope \
    540      1.10    itojun 	icp6s_outerrhist.icp6errs_dst_unreach_beyondscope
    541      1.10    itojun #define icp6s_odst_unreach_addr icp6s_outerrhist.icp6errs_dst_unreach_addr
    542      1.10    itojun #define icp6s_odst_unreach_noport icp6s_outerrhist.icp6errs_dst_unreach_noport
    543      1.10    itojun #define icp6s_opacket_too_big icp6s_outerrhist.icp6errs_packet_too_big
    544      1.10    itojun #define icp6s_otime_exceed_transit \
    545      1.10    itojun 	icp6s_outerrhist.icp6errs_time_exceed_transit
    546      1.10    itojun #define icp6s_otime_exceed_reassembly \
    547      1.10    itojun 	icp6s_outerrhist.icp6errs_time_exceed_reassembly
    548      1.10    itojun #define icp6s_oparamprob_header icp6s_outerrhist.icp6errs_paramprob_header
    549      1.10    itojun #define icp6s_oparamprob_nextheader \
    550      1.10    itojun 	icp6s_outerrhist.icp6errs_paramprob_nextheader
    551      1.10    itojun #define icp6s_oparamprob_option icp6s_outerrhist.icp6errs_paramprob_option
    552      1.10    itojun #define icp6s_oredirect icp6s_outerrhist.icp6errs_redirect
    553      1.10    itojun #define icp6s_ounknown icp6s_outerrhist.icp6errs_unknown
    554      1.15    itojun 	u_quad_t icp6s_pmtuchg;		/* path MTU changes */
    555      1.19    itojun 	u_quad_t icp6s_nd_badopt;	/* bad ND options */
    556      1.19    itojun 	u_quad_t icp6s_badns;		/* bad neighbor solicitation */
    557      1.19    itojun 	u_quad_t icp6s_badna;		/* bad neighbor advertisement */
    558      1.19    itojun 	u_quad_t icp6s_badrs;		/* bad router advertisement */
    559      1.19    itojun 	u_quad_t icp6s_badra;		/* bad router advertisement */
    560      1.19    itojun 	u_quad_t icp6s_badredirect;	/* bad redirect message */
    561       1.4    itojun };
    562       1.4    itojun 
    563       1.4    itojun /*
    564       1.4    itojun  * Names for ICMP sysctl objects
    565       1.4    itojun  */
    566       1.4    itojun #define ICMPV6CTL_STATS		1
    567       1.4    itojun #define ICMPV6CTL_REDIRACCEPT	2	/* accept/process redirects */
    568       1.4    itojun #define ICMPV6CTL_REDIRTIMEOUT	3	/* redirect cache time */
    569      1.11    itojun #if 0	/*obsoleted*/
    570       1.4    itojun #define ICMPV6CTL_ERRRATELIMIT	5	/* ICMPv6 error rate limitation */
    571      1.11    itojun #endif
    572       1.4    itojun #define ICMPV6CTL_ND6_PRUNE	6
    573       1.4    itojun #define ICMPV6CTL_ND6_DELAY	8
    574       1.4    itojun #define ICMPV6CTL_ND6_UMAXTRIES	9
    575       1.4    itojun #define ICMPV6CTL_ND6_MMAXTRIES		10
    576       1.4    itojun #define ICMPV6CTL_ND6_USELOOPBACK	11
    577       1.5    itojun /*#define ICMPV6CTL_ND6_PROXYALL	12	obsoleted, do not reuse here */
    578       1.4    itojun #define ICMPV6CTL_NODEINFO	13
    579      1.10    itojun #define ICMPV6CTL_ERRPPSLIMIT	14	/* ICMPv6 error pps limitation */
    580      1.10    itojun #define ICMPV6CTL_ND6_MAXNUDHINT	15
    581      1.16    itojun #define ICMPV6CTL_MTUDISC_HIWAT	16
    582      1.16    itojun #define ICMPV6CTL_MTUDISC_LOWAT	17
    583      1.19    itojun #define ICMPV6CTL_ND6_DEBUG	18
    584      1.23    itojun #define ICMPV6CTL_ND6_DRLIST	19
    585      1.23    itojun #define ICMPV6CTL_ND6_PRLIST	20
    586      1.23    itojun #define ICMPV6CTL_MAXID		21
    587       1.4    itojun 
    588       1.4    itojun #define ICMPV6CTL_NAMES { \
    589       1.4    itojun 	{ 0, 0 }, \
    590       1.4    itojun 	{ 0, 0 }, \
    591       1.4    itojun 	{ "rediraccept", CTLTYPE_INT }, \
    592       1.4    itojun 	{ "redirtimeout", CTLTYPE_INT }, \
    593       1.4    itojun 	{ 0, 0 }, \
    594      1.11    itojun 	{ 0, 0 }, \
    595       1.4    itojun 	{ "nd6_prune", CTLTYPE_INT }, \
    596       1.4    itojun 	{ 0, 0 }, \
    597       1.4    itojun 	{ "nd6_delay", CTLTYPE_INT }, \
    598       1.4    itojun 	{ "nd6_umaxtries", CTLTYPE_INT }, \
    599       1.4    itojun 	{ "nd6_mmaxtries", CTLTYPE_INT }, \
    600       1.4    itojun 	{ "nd6_useloopback", CTLTYPE_INT }, \
    601       1.5    itojun 	{ 0, 0 }, \
    602       1.4    itojun 	{ "nodeinfo", CTLTYPE_INT }, \
    603      1.10    itojun 	{ "errppslimit", CTLTYPE_INT }, \
    604      1.10    itojun 	{ "nd6_maxnudhint", CTLTYPE_INT }, \
    605      1.16    itojun 	{ "mtudisc_hiwat", CTLTYPE_INT }, \
    606      1.16    itojun 	{ "mtudisc_lowat", CTLTYPE_INT }, \
    607      1.19    itojun 	{ "nd6_debug", CTLTYPE_INT }, \
    608      1.23    itojun 	{ 0, 0 }, \
    609      1.23    itojun 	{ 0, 0 }, \
    610       1.4    itojun }
    611       1.4    itojun 
    612       1.4    itojun #define RTF_PROBEMTU	RTF_PROTO1
    613       1.4    itojun 
    614       1.4    itojun #ifdef _KERNEL
    615       1.4    itojun struct	rtentry;
    616       1.4    itojun struct	rttimer;
    617       1.4    itojun struct	in6_multi;
    618  1.27.2.1     skrll 
    619  1.27.2.1     skrll void	icmp6_init(void);
    620  1.27.2.1     skrll void	icmp6_paramerror(struct mbuf *, int);
    621  1.27.2.1     skrll void	icmp6_error(struct mbuf *, int, int, int);
    622  1.27.2.1     skrll int	icmp6_input(struct mbuf **, int *, int);
    623  1.27.2.1     skrll void	icmp6_fasttimo(void);
    624  1.27.2.1     skrll void	icmp6_reflect(struct mbuf *, size_t);
    625  1.27.2.1     skrll void	icmp6_prepare(struct mbuf *);
    626  1.27.2.1     skrll void	icmp6_redirect_input(struct mbuf *, int);
    627  1.27.2.1     skrll void	icmp6_redirect_output(struct mbuf *, struct rtentry *);
    628  1.27.2.1     skrll int	icmp6_sysctl(int *, u_int, void *, size_t *, void *, size_t);
    629      1.15    itojun 
    630      1.15    itojun struct	ip6ctlparam;
    631  1.27.2.1     skrll void	icmp6_mtudisc_update(struct ip6ctlparam *, int);
    632  1.27.2.1     skrll void	icmp6_mtudisc_callback_register(void (*)(struct in6_addr *));
    633       1.4    itojun 
    634       1.4    itojun /* XXX: is this the right place for these macros? */
    635       1.4    itojun #define icmp6_ifstat_inc(ifp, tag) \
    636       1.4    itojun do {								\
    637      1.22    itojun 	if (ifp)						\
    638      1.22    itojun 		((struct in6_ifextra *)((ifp)->if_afdata[AF_INET6]))->icmp6_ifstat->tag++; \
    639      1.25     perry } while (/*CONSTCOND*/ 0)
    640       1.4    itojun 
    641       1.4    itojun #define icmp6_ifoutstat_inc(ifp, type, code) \
    642       1.4    itojun do { \
    643       1.4    itojun 		icmp6_ifstat_inc(ifp, ifs6_out_msg); \
    644       1.4    itojun 		switch(type) { \
    645       1.4    itojun 		 case ICMP6_DST_UNREACH: \
    646       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_dstunreach); \
    647       1.4    itojun 			 if (code == ICMP6_DST_UNREACH_ADMIN) \
    648       1.4    itojun 				 icmp6_ifstat_inc(ifp, ifs6_out_adminprohib); \
    649       1.4    itojun 			 break; \
    650       1.4    itojun 		 case ICMP6_PACKET_TOO_BIG: \
    651       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_pkttoobig); \
    652       1.4    itojun 			 break; \
    653       1.4    itojun 		 case ICMP6_TIME_EXCEEDED: \
    654       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_timeexceed); \
    655       1.4    itojun 			 break; \
    656       1.4    itojun 		 case ICMP6_PARAM_PROB: \
    657       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_paramprob); \
    658       1.4    itojun 			 break; \
    659       1.4    itojun 		 case ICMP6_ECHO_REQUEST: \
    660       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_echo); \
    661       1.4    itojun 			 break; \
    662       1.4    itojun 		 case ICMP6_ECHO_REPLY: \
    663       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_echoreply); \
    664       1.4    itojun 			 break; \
    665      1.26    itojun 		 case MLD_LISTENER_QUERY: \
    666       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_mldquery); \
    667       1.4    itojun 			 break; \
    668      1.26    itojun 		 case MLD_LISTENER_REPORT: \
    669       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_mldreport); \
    670       1.4    itojun 			 break; \
    671      1.26    itojun 		 case MLD_LISTENER_DONE: \
    672       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_mlddone); \
    673       1.4    itojun 			 break; \
    674       1.4    itojun 		 case ND_ROUTER_SOLICIT: \
    675       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_routersolicit); \
    676       1.4    itojun 			 break; \
    677       1.4    itojun 		 case ND_ROUTER_ADVERT: \
    678       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_routeradvert); \
    679       1.4    itojun 			 break; \
    680       1.4    itojun 		 case ND_NEIGHBOR_SOLICIT: \
    681       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_neighborsolicit); \
    682       1.4    itojun 			 break; \
    683       1.4    itojun 		 case ND_NEIGHBOR_ADVERT: \
    684       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_neighboradvert); \
    685       1.4    itojun 			 break; \
    686       1.4    itojun 		 case ND_REDIRECT: \
    687       1.4    itojun 			 icmp6_ifstat_inc(ifp, ifs6_out_redirect); \
    688       1.4    itojun 			 break; \
    689       1.4    itojun 		} \
    690      1.25     perry } while (/*CONSTCOND*/ 0)
    691       1.4    itojun 
    692       1.4    itojun extern int	icmp6_rediraccept;	/* accept/process redirects */
    693       1.4    itojun extern int	icmp6_redirtimeout;	/* cache time for redirect routes */
    694       1.4    itojun #endif /* _KERNEL */
    695       1.2    itojun 
    696  1.27.2.5  christos #endif /* !_NETINET_ICMP6_H_ */
    697