summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6/in6.h')
-rw-r--r--sys/netinet6/in6.h319
1 files changed, 161 insertions, 158 deletions
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index 424c319..edcbe62 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -1,3 +1,6 @@
+/* $FreeBSD$ */
+/* $KAME: in6.h,v 1.48 2000/06/26 15:55:32 itojun Exp $ */
+
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
@@ -60,25 +63,24 @@
* SUCH DAMAGE.
*
* @(#)in.h 8.3 (Berkeley) 1/3/94
- * $FreeBSD$
*/
-#ifndef _NETINET6_IN6_H_
-#define _NETINET6_IN6_H_
-
-#if !defined(_KERNEL) && !defined(__KAME_NETINET_IN_H_INCLUDED_)
+#ifndef __KAME_NETINET_IN_H_INCLUDED_
#error "do not include netinet6/in6.h directly, include netinet/in.h"
#endif
-#if !defined(_XOPEN_SOURCE)
+#ifndef _NETINET6_IN6_H_
+#define _NETINET6_IN6_H_
+
+#ifndef _XOPEN_SOURCE
#include <sys/queue.h>
#endif
/*
* Identification of the network protocol stack
*/
-#define __KAME__
-#define __KAME_VERSION "SNAP 19991101"
+#define __KAME__
+#define __KAME_VERSION "20000701/FreeBSD-current"
/*
* Local port number conventions:
@@ -89,7 +91,7 @@
* When a user does a bind(2) or connect(2) with a port number of zero,
* a non-conflicting local port address is chosen.
*
- * The default range is IPPORT_ANONMIX to IPPORT_ANONMAX, although
+ * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although
* that is settable by sysctl(3); net.inet.ip.anonportmin and
* net.inet.ip.anonportmax respectively.
*
@@ -119,33 +121,33 @@
*/
struct in6_addr {
union {
- u_int8_t __u6_addr8[16];
- u_int16_t __u6_addr16[8];
- u_int32_t __u6_addr32[4];
+ u_int8_t __u6_addr8[16];
+ u_int16_t __u6_addr16[8];
+ u_int32_t __u6_addr32[4];
} __u6_addr; /* 128-bit IP6 address */
};
-#define s6_addr __u6_addr.__u6_addr8
+#define s6_addr __u6_addr.__u6_addr8
#ifdef _KERNEL /*XXX nonstandard*/
-#define s6_addr8 __u6_addr.__u6_addr8
-#define s6_addr16 __u6_addr.__u6_addr16
-#define s6_addr32 __u6_addr.__u6_addr32
+#define s6_addr8 __u6_addr.__u6_addr8
+#define s6_addr16 __u6_addr.__u6_addr16
+#define s6_addr32 __u6_addr.__u6_addr32
#endif
-#define INET6_ADDRSTRLEN 46
+#define INET6_ADDRSTRLEN 46
/*
* Socket address for IPv6
*/
-#if !defined(_XOPEN_SOURCE)
-#define SIN6_LEN
+#ifndef _XOPEN_SOURCE
+#define SIN6_LEN
#endif
struct sockaddr_in6 {
- u_char sin6_len; /* length of this struct(sa_family_t)*/
- u_char sin6_family; /* AF_INET6 (sa_family_t) */
+ u_int8_t sin6_len; /* length of this struct(sa_family_t)*/
+ u_int8_t sin6_family; /* AF_INET6 (sa_family_t) */
u_int16_t sin6_port; /* Transport layer port # (in_port_t)*/
u_int32_t sin6_flowinfo; /* IP6 flow information */
- struct in6_addr sin6_addr; /* IP6 address */
+ struct in6_addr sin6_addr; /* IP6 address */
u_int32_t sin6_scope_id; /* intface scope id */
};
@@ -153,14 +155,14 @@ struct sockaddr_in6 {
* Local definition for masks
*/
#ifdef _KERNEL /*XXX nonstandard*/
-#define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}}
-#define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \
+#define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}}
+#define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
-#define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+#define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
-#define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+#define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}}
-#define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+#define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}}
#endif
@@ -177,42 +179,42 @@ extern const struct in6_addr in6mask128;
*/
#ifdef _KERNEL /*XXX nonstandard*/
#if BYTE_ORDER == BIG_ENDIAN
-#define IPV6_ADDR_INT32_ONE 1
-#define IPV6_ADDR_INT32_TWO 2
-#define IPV6_ADDR_INT32_MNL 0xff010000
-#define IPV6_ADDR_INT32_MLL 0xff020000
-#define IPV6_ADDR_INT32_SMP 0x0000ffff
-#define IPV6_ADDR_INT16_ULL 0xfe80
-#define IPV6_ADDR_INT16_USL 0xfec0
-#define IPV6_ADDR_INT16_MLL 0xff02
+#define IPV6_ADDR_INT32_ONE 1
+#define IPV6_ADDR_INT32_TWO 2
+#define IPV6_ADDR_INT32_MNL 0xff010000
+#define IPV6_ADDR_INT32_MLL 0xff020000
+#define IPV6_ADDR_INT32_SMP 0x0000ffff
+#define IPV6_ADDR_INT16_ULL 0xfe80
+#define IPV6_ADDR_INT16_USL 0xfec0
+#define IPV6_ADDR_INT16_MLL 0xff02
#elif BYTE_ORDER == LITTLE_ENDIAN
-#define IPV6_ADDR_INT32_ONE 0x01000000
-#define IPV6_ADDR_INT32_TWO 0x02000000
-#define IPV6_ADDR_INT32_MNL 0x000001ff
-#define IPV6_ADDR_INT32_MLL 0x000002ff
-#define IPV6_ADDR_INT32_SMP 0xffff0000
-#define IPV6_ADDR_INT16_ULL 0x80fe
-#define IPV6_ADDR_INT16_USL 0xc0fe
-#define IPV6_ADDR_INT16_MLL 0x02ff
+#define IPV6_ADDR_INT32_ONE 0x01000000
+#define IPV6_ADDR_INT32_TWO 0x02000000
+#define IPV6_ADDR_INT32_MNL 0x000001ff
+#define IPV6_ADDR_INT32_MLL 0x000002ff
+#define IPV6_ADDR_INT32_SMP 0xffff0000
+#define IPV6_ADDR_INT16_ULL 0x80fe
+#define IPV6_ADDR_INT16_USL 0xc0fe
+#define IPV6_ADDR_INT16_MLL 0x02ff
#endif
#endif
/*
* Definition of some useful macros to handle IP6 addresses
*/
-#define IN6ADDR_ANY_INIT \
+#define IN6ADDR_ANY_INIT \
{{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
-#define IN6ADDR_LOOPBACK_INIT \
+#define IN6ADDR_LOOPBACK_INIT \
{{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
-#define IN6ADDR_NODELOCAL_ALLNODES_INIT \
+#define IN6ADDR_NODELOCAL_ALLNODES_INIT \
{{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
-#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \
+#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \
{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
-#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
+#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}}
@@ -229,17 +231,17 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
* in ANSI standard.
*/
#ifdef _KERNEL
-#define IN6_ARE_ADDR_EQUAL(a, b) \
- (bcmp((a), (b), sizeof(struct in6_addr)) == 0)
+#define IN6_ARE_ADDR_EQUAL(a, b) \
+ (bcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)
#else
-#define IN6_ARE_ADDR_EQUAL(a, b) \
- (memcmp((a), (b), sizeof(struct in6_addr)) == 0)
+#define IN6_ARE_ADDR_EQUAL(a, b) \
+ (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)
#endif
/*
* Unspecified
*/
-#define IN6_IS_ADDR_UNSPECIFIED(a) \
+#define IN6_IS_ADDR_UNSPECIFIED(a) \
((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \
(*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \
(*(u_int32_t *)(&(a)->s6_addr[8]) == 0) && \
@@ -248,7 +250,7 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
/*
* Loopback
*/
-#define IN6_IS_ADDR_LOOPBACK(a) \
+#define IN6_IS_ADDR_LOOPBACK(a) \
((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \
(*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \
(*(u_int32_t *)(&(a)->s6_addr[8]) == 0) && \
@@ -257,7 +259,7 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
/*
* IPv4 compatible
*/
-#define IN6_IS_ADDR_V4COMPAT(a) \
+#define IN6_IS_ADDR_V4COMPAT(a) \
((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \
(*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \
(*(u_int32_t *)(&(a)->s6_addr[8]) == 0) && \
@@ -267,7 +269,7 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
/*
* Mapped
*/
-#define IN6_IS_ADDR_V4MAPPED(a) \
+#define IN6_IS_ADDR_V4MAPPED(a) \
((*(u_int32_t *)(&(a)->s6_addr[0]) == 0) && \
(*(u_int32_t *)(&(a)->s6_addr[4]) == 0) && \
(*(u_int32_t *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
@@ -277,26 +279,26 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
*/
#ifdef _KERNEL /*XXX nonstandard*/
-#define IPV6_ADDR_SCOPE_NODELOCAL 0x01
-#define IPV6_ADDR_SCOPE_LINKLOCAL 0x02
-#define IPV6_ADDR_SCOPE_SITELOCAL 0x05
-#define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */
-#define IPV6_ADDR_SCOPE_GLOBAL 0x0e
+#define IPV6_ADDR_SCOPE_NODELOCAL 0x01
+#define IPV6_ADDR_SCOPE_LINKLOCAL 0x02
+#define IPV6_ADDR_SCOPE_SITELOCAL 0x05
+#define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */
+#define IPV6_ADDR_SCOPE_GLOBAL 0x0e
#else
-#define __IPV6_ADDR_SCOPE_NODELOCAL 0x01
-#define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02
-#define __IPV6_ADDR_SCOPE_SITELOCAL 0x05
-#define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */
-#define __IPV6_ADDR_SCOPE_GLOBAL 0x0e
+#define __IPV6_ADDR_SCOPE_NODELOCAL 0x01
+#define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02
+#define __IPV6_ADDR_SCOPE_SITELOCAL 0x05
+#define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */
+#define __IPV6_ADDR_SCOPE_GLOBAL 0x0e
#endif
/*
* Unicast Scope
* Note that we must check topmost 10 bits only, not 16 bits (see RFC2373).
*/
-#define IN6_IS_ADDR_LINKLOCAL(a) \
+#define IN6_IS_ADDR_LINKLOCAL(a) \
(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
-#define IN6_IS_ADDR_SITELOCAL(a) \
+#define IN6_IS_ADDR_SITELOCAL(a) \
(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
/*
@@ -305,44 +307,44 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
#ifdef _KERNEL /*XXX nonstandard*/
-#define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
+#define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
#else
-#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
+#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
#endif
/*
* Multicast Scope
*/
#ifdef _KERNEL /*refers nonstandard items */
-#define IN6_IS_ADDR_MC_NODELOCAL(a) \
+#define IN6_IS_ADDR_MC_NODELOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_NODELOCAL))
-#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
+#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL))
-#define IN6_IS_ADDR_MC_SITELOCAL(a) \
+#define IN6_IS_ADDR_MC_SITELOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_SITELOCAL))
-#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
+#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_ORGLOCAL))
-#define IN6_IS_ADDR_MC_GLOBAL(a) \
+#define IN6_IS_ADDR_MC_GLOBAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_GLOBAL))
#else
-#define IN6_IS_ADDR_MC_NODELOCAL(a) \
+#define IN6_IS_ADDR_MC_NODELOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL))
-#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
+#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL))
-#define IN6_IS_ADDR_MC_SITELOCAL(a) \
+#define IN6_IS_ADDR_MC_SITELOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL))
-#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
+#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL))
-#define IN6_IS_ADDR_MC_GLOBAL(a) \
+#define IN6_IS_ADDR_MC_GLOBAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL))
#endif
@@ -351,7 +353,7 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
* KAME Scope
*/
#ifdef _KERNEL /*nonstandard*/
-#define IN6_IS_SCOPE_LINKLOCAL(a) \
+#define IN6_IS_SCOPE_LINKLOCAL(a) \
((IN6_IS_ADDR_LINKLOCAL(a)) || \
(IN6_IS_ADDR_MC_LINKLOCAL(a)))
#endif
@@ -359,7 +361,7 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
/*
* IP6 route structure
*/
-#if !defined(_XOPEN_SOURCE)
+#ifndef _XOPEN_SOURCE
struct route_in6 {
struct rtentry *ro_rt;
struct sockaddr_in6 ro_dst;
@@ -370,66 +372,68 @@ struct route_in6 {
* Options for use with [gs]etsockopt at the IPV6 level.
* First word of comment is data type; bool is stored in int.
*/
-#define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */
/* no hdrincl */
-#define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */
-#define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */
-#define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */
-#define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */
-#define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */
-#define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */
-#define IPV6_MULTICAST_IF 9 /* u_char; set/get IP6 multicast i/f */
-#define IPV6_MULTICAST_HOPS 10 /* u_char; set/get IP6 multicast hops */
-#define IPV6_MULTICAST_LOOP 11 /* u_char; set/get IP6 multicast loopback */
-#define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */
-#define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */
-#define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */
-#define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */
-#define IPV6_PKTINFO 19 /* bool; send/rcv if, src/dst addr */
-#define IPV6_HOPLIMIT 20 /* bool; hop limit */
-#define IPV6_NEXTHOP 21 /* bool; next hop addr */
-#define IPV6_HOPOPTS 22 /* bool; hop-by-hop option */
-#define IPV6_DSTOPTS 23 /* bool; destination option */
-#define IPV6_RTHDR 24 /* bool; routing header */
-#define IPV6_PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */
-#define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */
-#define IPV6_BINDV6ONLY 27 /* bool; only bind INET6 at null bind */
+#if 0 /* the followings are relic in IPv4 and hence are disabled */
+#define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */
+#define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */
+#define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */
+#define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */
+#define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */
+#endif
+#define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */
+#define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */
+#define IPV6_MULTICAST_IF 9 /* u_char; set/get IP6 multicast i/f */
+#define IPV6_MULTICAST_HOPS 10 /* u_char; set/get IP6 multicast hops */
+#define IPV6_MULTICAST_LOOP 11 /* u_char; set/get IP6 multicast loopback */
+#define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */
+#define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */
+#define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */
+#define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */
+#define IPV6_PKTINFO 19 /* bool; send/rcv if, src/dst addr */
+#define IPV6_HOPLIMIT 20 /* bool; hop limit */
+#define IPV6_NEXTHOP 21 /* bool; next hop addr */
+#define IPV6_HOPOPTS 22 /* bool; hop-by-hop option */
+#define IPV6_DSTOPTS 23 /* bool; destination option */
+#define IPV6_RTHDR 24 /* bool; routing header */
+#define IPV6_PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */
+#define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */
+#define IPV6_BINDV6ONLY 27 /* bool; only bind INET6 at null bind */
/* for IPsec */
-#define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */
-#define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */
+#define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */
+#define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */
/* for IPV6FIREWALL */
-#define IPV6_FW_ADD 30 /* add a firewall rule to chain */
-#define IPV6_FW_DEL 31 /* delete a firewall rule from chain */
-#define IPV6_FW_FLUSH 32 /* flush firewall rule chain */
-#define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */
-#define IPV6_FW_GET 34 /* get entire firewall rule chain */
+#define IPV6_FW_ADD 30 /* add a firewall rule to chain */
+#define IPV6_FW_DEL 31 /* delete a firewall rule from chain */
+#define IPV6_FW_FLUSH 32 /* flush firewall rule chain */
+#define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */
+#define IPV6_FW_GET 34 /* get entire firewall rule chain */
-#define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */
-#define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */
-#define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */
+#define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */
+#define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */
+#define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */
/*
* Defaults and limits for options
*/
-#define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */
-#define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
+#define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */
+#define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
/*
* Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP.
*/
struct ipv6_mreq {
- struct in6_addr ipv6mr_multiaddr;
- u_int ipv6mr_interface;
+ struct in6_addr ipv6mr_multiaddr;
+ unsigned int ipv6mr_interface;
};
/*
* IPV6_PKTINFO: Packet information(RFC2292 sec 5)
*/
struct in6_pktinfo {
- struct in6_addr ipi6_addr; /* src/dst IPv6 address */
- u_int ipi6_ifindex; /* send/recv interface index */
+ struct in6_addr ipi6_addr; /* src/dst IPv6 address */
+ unsigned int ipi6_ifindex; /* send/recv interface index */
};
/*
@@ -440,16 +444,16 @@ struct in6_pktinfo {
#define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
#define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
-#if !defined(_XOPEN_SOURCE)
+#ifndef _XOPEN_SOURCE
/*
* Definitions for inet6 sysctl operations.
*
* Third level is protocol number.
* Fourth level is desired variable within that protocol.
*/
-#define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */
+#define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */
-#define CTL_IPV6PROTO_NAMES { \
+#define CTL_IPV6PROTO_NAMES { \
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
{ 0, 0 }, \
{ "tcp6", CTLTYPE_NODE }, \
@@ -499,51 +503,50 @@ struct in6_pktinfo {
/*
* Names for IP sysctl objects
*/
-#define IPV6CTL_FORWARDING 1 /* act as router */
-#define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding*/
-#define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */
+#define IPV6CTL_FORWARDING 1 /* act as router */
+#define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding*/
+#define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */
#ifdef notyet
-#define IPV6CTL_DEFMTU 4 /* default MTU */
+#define IPV6CTL_DEFMTU 4 /* default MTU */
#endif
-#define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */
-#define IPV6CTL_STATS 6 /* stats */
-#define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */
-#define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */
-#define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */
-#define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */
-#define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */
-#define IPV6CTL_ACCEPT_RTADV 12
-#define IPV6CTL_KEEPFAITH 13
-#define IPV6CTL_LOG_INTERVAL 14
-#define IPV6CTL_HDRNESTLIMIT 15
-#define IPV6CTL_DAD_COUNT 16
-#define IPV6CTL_AUTO_FLOWLABEL 17
-#define IPV6CTL_DEFMCASTHLIM 18
-#define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */
-#define IPV6CTL_KAME_VERSION 20
-#define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */
-#define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */
-#define IPV6CTL_MAPPED_ADDR 23
+#define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */
+#define IPV6CTL_STATS 6 /* stats */
+#define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */
+#define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */
+#define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */
+#define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */
+#define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */
+#define IPV6CTL_ACCEPT_RTADV 12
+#define IPV6CTL_KEEPFAITH 13
+#define IPV6CTL_LOG_INTERVAL 14
+#define IPV6CTL_HDRNESTLIMIT 15
+#define IPV6CTL_DAD_COUNT 16
+#define IPV6CTL_AUTO_FLOWLABEL 17
+#define IPV6CTL_DEFMCASTHLIM 18
+#define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */
+#define IPV6CTL_KAME_VERSION 20
+#define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */
+#define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */
+#define IPV6CTL_MAPPED_ADDR 23
/* New entries should be added here from current IPV6CTL_MAXID value. */
-#define IPV6CTL_MAXID 24
+#define IPV6CTL_MAXID 24
#endif /* !_XOPEN_SOURCE */
/*
* Redefinition of mbuf flags
*/
-#define M_ANYCAST6 M_PROTO1
-#define M_AUTHIPHDR M_PROTO2
-#define M_DECRYPTED M_PROTO3
-#define M_LOOP M_PROTO4
-#define M_AUTHIPDGM M_PROTO5
+#define M_ANYCAST6 M_PROTO1
+#define M_AUTHIPHDR M_PROTO2
+#define M_DECRYPTED M_PROTO3
+#define M_LOOP M_PROTO4
+#define M_AUTHIPDGM M_PROTO5
#ifdef _KERNEL
struct cmsghdr;
struct mbuf;
struct ifnet;
-int in6_canforward __P((struct in6_addr *, struct in6_addr *));
-int in6_cksum __P((struct mbuf *, u_int8_t, int, int));
+int in6_cksum __P((struct mbuf *, u_int8_t, u_int32_t, u_int32_t));
int in6_localaddr __P((struct in6_addr *));
int in6_addrscope __P((struct in6_addr *));
struct in6_ifaddr *in6_ifawithscope __P((struct ifnet *, struct in6_addr *));
@@ -558,9 +561,9 @@ void in6_sin_2_v4mapsin6 __P((struct sockaddr_in *sin,
void in6_sin6_2_sin_in_sock __P((struct sockaddr *nam));
void in6_sin_2_v4mapsin6_in_sock __P((struct sockaddr **nam));
-#define satosin6(sa) ((struct sockaddr_in6 *)(sa))
-#define sin6tosa(sin6) ((struct sockaddr *)(sin6))
-#define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa))
+#define satosin6(sa) ((struct sockaddr_in6 *)(sa))
+#define sin6tosa(sin6) ((struct sockaddr *)(sin6))
+#define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa))
#endif /* _KERNEL */
__BEGIN_DECLS
OpenPOWER on IntegriCloud