X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/3e170ce000f1506b7b5d2c5c7faec85ceabb573d..4d15aeb193b2c68f1d38666c317f8d3734f5f083:/bsd/netinet6/nd6.h diff --git a/bsd/netinet6/nd6.h b/bsd/netinet6/nd6.h index 08b52d26a..bd71a5a9b 100644 --- a/bsd/netinet6/nd6.h +++ b/bsd/netinet6/nd6.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2015 Apple Inc. All rights reserved. + * Copyright (c) 2000-2016 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -57,6 +57,7 @@ #ifndef _NETINET6_ND6_H_ #define _NETINET6_ND6_H_ #include +#include /* see net/route.h, or net/if_inarp.h */ #ifndef RTF_ANNOUNCE @@ -114,6 +115,25 @@ struct llinfo_nd6 { #define ND6_LLINFO_PROBE 4 #ifdef BSD_KERNEL_PRIVATE + +#define ND6_CACHE_STATE_TRANSITION(ln, nstate) do {\ + if (nd6_debug >= 1) {\ + nd6log((LOG_INFO,\ + "[%s:%d]: NDP cache entry changed from %s -> %s",\ + __FILE__,\ + __LINE__,\ + ndcache_state2str((ln)->ln_state),\ + ndcache_state2str(nstate)));\ + if ((ln)->ln_rt)\ + nd6log((LOG_INFO,\ + " for address: %s.\n",\ + ip6_sprintf(&SIN6(rt_key((ln)->ln_rt))->sin6_addr)));\ + else\ + nd6log((LOG_INFO, "\n"));\ + }\ + (ln)->ln_state = nstate;\ +} while(0) + #define ND6_IS_LLINFO_PROBREACH(n) ((n)->ln_state > ND6_LLINFO_INCOMPLETE) #define ND6_LLINFO_PERMANENT(n) \ (((n)->ln_expire == 0) && ((n)->ln_state > ND6_LLINFO_INCOMPLETE)) @@ -177,6 +197,7 @@ struct nd_ifinfo_compat { #define ND6_IFF_INSECURE 0x80 #endif #define ND6_IFF_REPLICATED 0x100 /* sleep proxy registered */ +#define ND6_IFF_DAD 0x200 /* Perform DAD on the interface */ struct in6_nbrinfo { char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */ @@ -249,9 +270,7 @@ struct in6_drlist_64 { #define NDDRF_INSTALLED 0x1 /* installed in the routing table */ #define NDDRF_IFSCOPE 0x2 /* installed as a scoped route */ #define NDDRF_STATIC 0x4 /* for internal use only */ -#ifdef BSD_KERNEL_PRIVATE -#define NDDRF_PROCESSED 0x10 -#endif +#define NDDRF_MAPPED 0x8 /* Default router addr is mapped to a different one for routing */ struct in6_defrouter { struct sockaddr_in6 rtaddr; @@ -506,9 +525,9 @@ struct nd_defrouter { u_char flags; /* flags on RA message */ u_char stateflags; u_short rtlifetime; - unsigned int genid; int err; struct ifnet *ifp; + struct in6_addr rtaddr_mapped; /* Mapped gateway address for routing */ void (*nddr_trace)(struct nd_defrouter *, int); /* trace callback fn */ }; @@ -649,9 +668,6 @@ struct inet6_ndpr_msghdr { #define prm_rrf_decrvalid prm_flags.prf_rr.decrvalid #define prm_rrf_decrprefd prm_flags.prf_rr.decrprefd -#define ifpr2ndpr(ifpr) ((struct nd_prefix *)(ifpr)) -#define ndpr2ifpr(ndpr) ((struct ifprefix *)(ndpr)) - struct nd_pfxrouter { LIST_ENTRY(nd_pfxrouter) pfr_entry; #define pfr_next pfr_entry.le_next @@ -675,14 +691,6 @@ struct kev_nd6_ndalive { struct net_event_data link_data; }; -/* ND6 kernel event subclass value */ -#define KEV_ND6_SUBCLASS 7 - -/* ND6 kernel event action type */ -#define KEV_ND6_RA 1 -#define KEV_ND6_NDFAILURE 2 /* IPv6 neighbor cache entry expiry */ -#define KEV_ND6_NDALIVE 3 /* IPv6 neighbor reachable */ - /* ND6 RA L2 source address length */ #define ND6_ROUTER_LL_SIZE 64 @@ -714,6 +722,18 @@ struct kev_nd6_ra_data { struct nd6_ra_prefix prefix; u_int32_t pad; }; + +struct nd6_lookup_ipv6_args { + char ifname[IFNAMSIZ]; + struct sockaddr_in6 ip6_dest; + u_int32_t ll_dest_len; + union { + char buffer[256]; + struct sockaddr_dl _sdl; + } ll_dest_; +}; +#define ll_dest_sdl ll_dest_._sdl + #endif /* PRIVATE */ #if defined(BSD_KERNEL_PRIVATE) @@ -753,7 +773,7 @@ extern u_int32_t ip6_temp_valid_lifetime; /* seconds */ extern int ip6_temp_regen_advance; /* seconds */ union nd_opts { - struct nd_opt_hdr *nd_opt_array[8]; /* max = target address list */ + struct nd_opt_hdr *nd_opt_array[16]; /* max = target address list */ struct { struct nd_opt_hdr *zero; struct nd_opt_hdr *src_lladdr; @@ -761,6 +781,16 @@ union nd_opts { struct nd_opt_prefix_info *pi_beg; /* multiple opts, start */ struct nd_opt_rd_hdr *rh; struct nd_opt_mtu *mtu; + struct nd_opt_hdr *__res6; + struct nd_opt_hdr *__res7; + struct nd_opt_hdr *__res8; + struct nd_opt_hdr *__res9; + struct nd_opt_hdr *__res10; + struct nd_opt_hdr *__res11; + struct nd_opt_hdr *__res12; + struct nd_opt_hdr *__res13; + struct nd_opt_nonce *nonce; + struct nd_opt_hdr *__res15; struct nd_opt_hdr *search; /* multiple opts */ struct nd_opt_hdr *last; /* multiple opts */ int done; @@ -773,6 +803,7 @@ union nd_opts { #define nd_opts_pi_end nd_opt_each.pi_end #define nd_opts_rh nd_opt_each.rh #define nd_opts_mtu nd_opt_each.mtu +#define nd_opts_nonce nd_opt_each.nonce #define nd_opts_search nd_opt_each.search #define nd_opts_last nd_opt_each.last #define nd_opts_done nd_opt_each.done @@ -810,6 +841,7 @@ extern void nd6_drain(void *); extern void nd6_post_msg(u_int32_t, struct nd_prefix_list *, u_int32_t, u_int32_t, char *, u_int32_t); extern int nd6_setifinfo(struct ifnet *, u_int32_t, u_int32_t); +extern const char *ndcache_state2str(short); extern void ln_setexpire(struct llinfo_nd6 *, uint64_t); /* nd6_nbr.c */ @@ -819,7 +851,7 @@ extern void nd6_na_output(struct ifnet *, const struct in6_addr *, const struct in6_addr *, u_int32_t, int, struct sockaddr *); extern void nd6_ns_input(struct mbuf *, int, int); extern void nd6_ns_output(struct ifnet *, const struct in6_addr *, - const struct in6_addr *, struct llinfo_nd6 *, int); + const struct in6_addr *, struct llinfo_nd6 *, uint8_t *); extern caddr_t nd6_ifptomac(struct ifnet *); extern void nd6_dad_start(struct ifaddr *, int *); extern void nd6_dad_stop(struct ifaddr *); @@ -880,12 +912,13 @@ extern boolean_t nd6_prproxy_isours(struct mbuf *, struct ip6_hdr *, extern void nd6_prproxy_ns_output(struct ifnet *, struct ifnet *, struct in6_addr *, struct in6_addr *, struct llinfo_nd6 *); extern void nd6_prproxy_ns_input(struct ifnet *, struct in6_addr *, - char *, int, struct in6_addr *, struct in6_addr *); + char *, int, struct in6_addr *, struct in6_addr *, uint8_t *nonce); extern void nd6_prproxy_na_input(struct ifnet *, struct in6_addr *, struct in6_addr *, struct in6_addr *, int); extern void nd6_prproxy_sols_reap(struct nd_prefix *); extern void nd6_prproxy_sols_prune(struct nd_prefix *, u_int32_t); extern int nd6_if_disable(struct ifnet *, boolean_t); +void in6_ifaddr_set_dadprogress(struct in6_ifaddr *ia); #endif /* BSD_KERNEL_PRIVATE */ #ifdef KERNEL