Path: blob/buildjre8/ios-missing-include/netinet6/nd6.h
861 views
/*1* Copyright (c) 2000-2020 Apple Inc. All rights reserved.2*3* @APPLE_OSREFERENCE_LICENSE_HEADER_START@4*5* This file contains Original Code and/or Modifications of Original Code6* as defined in and that are subject to the Apple Public Source License7* Version 2.0 (the 'License'). You may not use this file except in8* compliance with the License. The rights granted to you under the License9* may not be used to create, or enable the creation or redistribution of,10* unlawful or unlicensed copies of an Apple operating system, or to11* circumvent, violate, or enable the circumvention or violation of, any12* terms of an Apple operating system software license agreement.13*14* Please obtain a copy of the License at15* http://www.opensource.apple.com/apsl/ and read it before using this file.16*17* The Original Code and all software distributed under the License are18* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER19* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,20* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,21* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.22* Please see the License for the specific language governing rights and23* limitations under the License.24*25* @APPLE_OSREFERENCE_LICENSE_HEADER_END@26*/27/*28* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.29* All rights reserved.30*31* Redistribution and use in source and binary forms, with or without32* modification, are permitted provided that the following conditions33* are met:34* 1. Redistributions of source code must retain the above copyright35* notice, this list of conditions and the following disclaimer.36* 2. Redistributions in binary form must reproduce the above copyright37* notice, this list of conditions and the following disclaimer in the38* documentation and/or other materials provided with the distribution.39* 3. Neither the name of the project nor the names of its contributors40* may be used to endorse or promote products derived from this software41* without specific prior written permission.42*43* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND44* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE45* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE46* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE47* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL48* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS49* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)50* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT51* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY52* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF53* SUCH DAMAGE.54*/5556#ifndef _NETINET6_ND6_H_57#define _NETINET6_ND6_H_58#include <sys/appleapiopts.h>59#include <net/net_kev.h>6061/* see net/route.h, or net/if_inarp.h */62#ifndef RTF_ANNOUNCE63#define RTF_ANNOUNCE RTF_PROTO264#endif6566#include <sys/queue.h>676869#define ND6_LLINFO_PURGE -370#define ND6_LLINFO_NOSTATE -271/*72* We don't need the WAITDELETE state any more, but we keep the definition73* in a comment line instead of removing it. This is necessary to avoid74* unintentionally reusing the value for another purpose, which might75* affect backward compatibility with old applications.76* (20000711 [email protected])77*/78/* #define ND6_LLINFO_WAITDELETE -1 */79#define ND6_LLINFO_INCOMPLETE 080#define ND6_LLINFO_REACHABLE 181#define ND6_LLINFO_STALE 282#define ND6_LLINFO_DELAY 383#define ND6_LLINFO_PROBE 4848586struct nd_ifinfo {87u_int32_t linkmtu; /* LinkMTU */88u_int32_t maxmtu; /* Upper bound of LinkMTU */89u_int32_t basereachable; /* BaseReachableTime */90u_int32_t reachable; /* Reachable Time */91u_int32_t retrans; /* Retrans Timer */92u_int32_t flags; /* Flags */93int recalctm; /* BaseReacable re-calculation timer */94u_int8_t chlim; /* CurHopLimit */95u_int8_t receivedra;96/* the following 3 members are for privacy extension for addrconf */97u_int8_t randomseed0[8]; /* upper 64 bits of SHA1 digest */98u_int8_t randomseed1[8]; /* lower 64 bits (usually the EUI64 IFID) */99u_int8_t randomid[8]; /* current random ID */100};101102#define ND6_IFF_PERFORMNUD 0x1103#define ND6_IFF_PROXY_PREFIXES 0x20104#define ND6_IFF_IGNORE_NA 0x40105#define ND6_IFF_REPLICATED 0x100 /* sleep proxy registered */106#define ND6_IFF_DAD 0x200 /* Perform DAD on the interface */107108extern int dad_enhanced;109#define ND6_DAD_ENHANCED_DEFAULT 1110111struct in6_nbrinfo {112char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */113struct in6_addr addr; /* IPv6 address of the neighbor */114long asked; /* # of queries already sent for this addr */115int isrouter; /* if it acts as a router */116int state; /* reachability state */117int expire; /* lifetime for NDP state transition */118};119120121#define DRLSTSIZ 10122#define PRLSTSIZ 10123124struct in6_drlist {125char ifname[IFNAMSIZ];126struct {127struct in6_addr rtaddr;128u_char flags;129u_short rtlifetime;130u_long expire;131u_short if_index;132} defrouter[DRLSTSIZ];133};134135136/* valid values for stateflags */137#define NDDRF_INSTALLED 0x01 /* installed in the routing table */138#define NDDRF_IFSCOPE 0x02 /* installed as a scoped route */139#define NDDRF_STATIC 0x04 /* for internal use only */140#define NDDRF_MAPPED 0x08 /* Default router addr is mapped to a different one for routing */141#define NDDRF_INELIGIBLE 0x10 /* Default router entry is ineligible for default router selection */142143struct in6_defrouter {144struct sockaddr_in6 rtaddr;145u_char flags;146u_char stateflags;147u_short rtlifetime;148u_long expire;149u_short if_index;150};151152153struct in6_prlist {154char ifname[IFNAMSIZ];155struct {156struct in6_addr prefix;157struct prf_ra raflags;158u_char prefixlen;159u_char origin;160u_long vltime;161u_long pltime;162u_long expire;163u_short if_index;164u_short advrtrs; /* number of advertisement routers */165struct in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */166} prefix[PRLSTSIZ];167};168169170struct in6_prefix {171struct sockaddr_in6 prefix;172struct prf_ra raflags;173u_char prefixlen;174u_char origin;175u_long vltime;176u_long pltime;177u_long expire;178u_int32_t flags;179int refcnt;180u_short if_index;181u_short advrtrs; /* number of advertisement routers */182/* struct sockaddr_in6 advrtr[] */183};184185186struct in6_ondireq {187char ifname[IFNAMSIZ];188struct {189u_int32_t linkmtu; /* LinkMTU */190u_int32_t maxmtu; /* Upper bound of LinkMTU */191u_int32_t basereachable; /* BaseReachableTime */192u_int32_t reachable; /* Reachable Time */193u_int32_t retrans; /* Retrans Timer */194u_int32_t flags; /* Flags */195int recalctm; /* BaseReacable re-calculation timer */196u_int8_t chlim; /* CurHopLimit */197/* Number of routers learned on the interface */198u_int8_t receivedra;199/*200* The current collision count value201* being used for secure address generation.202*/203u_int8_t collision_count;204} ndi;205};206207struct in6_ndireq {208char ifname[IFNAMSIZ];209struct nd_ifinfo ndi;210};211212struct in6_ndifreq {213char ifname[IFNAMSIZ];214u_long ifindex;215};216217#define MAX_RTR_SOLICITATION_DELAY 1 /* 1sec */218#define RTR_SOLICITATION_INTERVAL 4 /* 4sec */219220221/* Prefix status */222#define NDPRF_ONLINK 0x1223#define NDPRF_DETACHED 0x2224#define NDPRF_STATIC 0x100225#define NDPRF_IFSCOPE 0x1000226#define NDPRF_PRPROXY 0x2000227228/* protocol constants */229#define MAX_RTR_SOLICITATION_DELAY 1 /* 1sec */230#define RTR_SOLICITATION_INTERVAL 4 /* 4sec */231#define MAX_RTR_SOLICITATIONS 3232233#define ND6_INFINITE_LIFETIME 0xffffffff234#define ND6_MAX_LIFETIME 0x7fffffff235236237238239240/* nd6_send.c */241#endif /* _NETINET6_ND6_H_ */242243244