1139826Simp/*- 253541Sshin * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 353541Sshin * All rights reserved. 453541Sshin * 553541Sshin * Redistribution and use in source and binary forms, with or without 653541Sshin * modification, are permitted provided that the following conditions 753541Sshin * are met: 853541Sshin * 1. Redistributions of source code must retain the above copyright 953541Sshin * notice, this list of conditions and the following disclaimer. 1053541Sshin * 2. Redistributions in binary form must reproduce the above copyright 1153541Sshin * notice, this list of conditions and the following disclaimer in the 1253541Sshin * documentation and/or other materials provided with the distribution. 1353541Sshin * 3. Neither the name of the project nor the names of its contributors 1453541Sshin * may be used to endorse or promote products derived from this software 1553541Sshin * without specific prior written permission. 1653541Sshin * 1753541Sshin * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 1853541Sshin * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1953541Sshin * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2053541Sshin * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 2153541Sshin * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2253541Sshin * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2353541Sshin * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2453541Sshin * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2553541Sshin * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2653541Sshin * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2753541Sshin * SUCH DAMAGE. 28174510Sobrien * 29174510Sobrien * $KAME: nd6.h,v 1.76 2001/12/18 02:10:31 itojun Exp $ 30174510Sobrien * $FreeBSD$ 3153541Sshin */ 3253541Sshin 3353541Sshin#ifndef _NETINET6_ND6_H_ 3462587Sitojun#define _NETINET6_ND6_H_ 3553541Sshin 3662587Sitojun/* see net/route.h, or net/if_inarp.h */ 3762587Sitojun#ifndef RTF_ANNOUNCE 3862587Sitojun#define RTF_ANNOUNCE RTF_PROTO2 3962587Sitojun#endif 4062587Sitojun 4153541Sshin#include <sys/queue.h> 4278064Sume#include <sys/callout.h> 4353541Sshin 44186119Sqinglistruct llentry; 45151539Ssuz 4662587Sitojun#define ND6_LLINFO_NOSTATE -2 4778064Sume/* 4878064Sume * We don't need the WAITDELETE state any more, but we keep the definition 4978064Sume * in a comment line instead of removing it. This is necessary to avoid 5078064Sume * unintentionally reusing the value for another purpose, which might 5178064Sume * affect backward compatibility with old applications. 5278064Sume * (20000711 jinmei@kame.net) 5378064Sume */ 5478064Sume/* #define ND6_LLINFO_WAITDELETE -1 */ 5562587Sitojun#define ND6_LLINFO_INCOMPLETE 0 5662587Sitojun#define ND6_LLINFO_REACHABLE 1 5762587Sitojun#define ND6_LLINFO_STALE 2 5862587Sitojun#define ND6_LLINFO_DELAY 3 5962587Sitojun#define ND6_LLINFO_PROBE 4 6053541Sshin 6162587Sitojun#define ND6_IS_LLINFO_PROBREACH(n) ((n)->ln_state > ND6_LLINFO_INCOMPLETE) 62186119Sqingli#define ND6_LLINFO_PERMANENT(n) (((n)->la_expire == 0) && ((n)->ln_state > ND6_LLINFO_INCOMPLETE)) 6362587Sitojun 6453541Sshinstruct nd_ifinfo { 6562587Sitojun u_int32_t linkmtu; /* LinkMTU */ 6662587Sitojun u_int32_t maxmtu; /* Upper bound of LinkMTU */ 6762587Sitojun u_int32_t basereachable; /* BaseReachableTime */ 6862587Sitojun u_int32_t reachable; /* Reachable Time */ 6962587Sitojun u_int32_t retrans; /* Retrans Timer */ 7062587Sitojun u_int32_t flags; /* Flags */ 7162587Sitojun int recalctm; /* BaseReacable re-calculation timer */ 7262587Sitojun u_int8_t chlim; /* CurHopLimit */ 73121161Sume u_int8_t initialized; /* Flag to see the entry is initialized */ 7495023Ssuz /* the following 3 members are for privacy extension for addrconf */ 7578064Sume u_int8_t randomseed0[8]; /* upper 64 bits of MD5 digest */ 7678064Sume u_int8_t randomseed1[8]; /* lower 64 bits (usually the EUI64 IFID) */ 7778064Sume u_int8_t randomid[8]; /* current random ID */ 7853541Sshin}; 7953541Sshin 8062587Sitojun#define ND6_IFF_PERFORMNUD 0x1 81118498Sume#define ND6_IFF_ACCEPT_RTADV 0x2 82238273Shrs#define ND6_IFF_PREFER_SOURCE 0x4 /* Not used in FreeBSD. */ 83151474Ssuz#define ND6_IFF_IFDISABLED 0x8 /* IPv6 operation is disabled due to 84151474Ssuz * DAD failure. (XXX: not ND-specific) 85151474Ssuz */ 86151539Ssuz#define ND6_IFF_DONT_SET_IFROUTE 0x10 87197138Shrs#define ND6_IFF_AUTO_LINKLOCAL 0x20 88222728Shrs#define ND6_IFF_NO_RADR 0x40 89245230Sume#define ND6_IFF_NO_PREFER_IFACE 0x80 /* XXX: not related to ND. */ 9062587Sitojun 91186119Sqingli#define ND6_CREATE LLE_CREATE 92186119Sqingli#define ND6_EXCLUSIVE LLE_EXCLUSIVE 93186119Sqingli 94121161Sume#ifdef _KERNEL 95121161Sume#define ND_IFINFO(ifp) \ 96121161Sume (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->nd_ifinfo) 97121161Sume#define IN6_LINKMTU(ifp) \ 98121161Sume ((ND_IFINFO(ifp)->linkmtu && ND_IFINFO(ifp)->linkmtu < (ifp)->if_mtu) \ 99121161Sume ? ND_IFINFO(ifp)->linkmtu \ 100121161Sume : ((ND_IFINFO(ifp)->maxmtu && ND_IFINFO(ifp)->maxmtu < (ifp)->if_mtu) \ 101121161Sume ? ND_IFINFO(ifp)->maxmtu : (ifp)->if_mtu)) 102121161Sume#endif 103121161Sume 10453541Sshinstruct in6_nbrinfo { 10562587Sitojun char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */ 10662587Sitojun struct in6_addr addr; /* IPv6 address of the neighbor */ 10753541Sshin long asked; /* number of queries already sent for this addr */ 10853541Sshin int isrouter; /* if it acts as a router */ 10953541Sshin int state; /* reachability state */ 11053541Sshin int expire; /* lifetime for NDP state transition */ 11153541Sshin}; 11253541Sshin 11362587Sitojun#define DRLSTSIZ 10 11462587Sitojun#define PRLSTSIZ 10 11553541Sshinstruct in6_drlist { 11662587Sitojun char ifname[IFNAMSIZ]; 11753541Sshin struct { 11853541Sshin struct in6_addr rtaddr; 11953541Sshin u_char flags; 12053541Sshin u_short rtlifetime; 12153541Sshin u_long expire; 12262587Sitojun u_short if_index; 12353541Sshin } defrouter[DRLSTSIZ]; 12453541Sshin}; 12553541Sshin 12678064Sumestruct in6_defrouter { 12778064Sume struct sockaddr_in6 rtaddr; 12878064Sume u_char flags; 12978064Sume u_short rtlifetime; 13078064Sume u_long expire; 13178064Sume u_short if_index; 13281369Ssimokawa}; 13378064Sume 134121472Sume#ifdef _KERNEL 135121472Sumestruct in6_oprlist { 136121472Sume char ifname[IFNAMSIZ]; 137121472Sume struct { 138121472Sume struct in6_addr prefix; 139121472Sume struct prf_ra raflags; 140121472Sume u_char prefixlen; 141121472Sume u_char origin; 142121472Sume u_long vltime; 143121472Sume u_long pltime; 144121472Sume u_long expire; 145121472Sume u_short if_index; 146121472Sume u_short advrtrs; /* number of advertisement routers */ 147121472Sume struct in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */ 148121472Sume } prefix[PRLSTSIZ]; 149121472Sume}; 150121472Sume#endif 151121472Sume 15253541Sshinstruct in6_prlist { 15362587Sitojun char ifname[IFNAMSIZ]; 15453541Sshin struct { 15553541Sshin struct in6_addr prefix; 15662587Sitojun struct prf_ra raflags; 15753541Sshin u_char prefixlen; 15862587Sitojun u_char origin; 15995023Ssuz u_int32_t vltime; 16095023Ssuz u_int32_t pltime; 16195023Ssuz time_t expire; 16262587Sitojun u_short if_index; 16362587Sitojun u_short advrtrs; /* number of advertisement routers */ 16453541Sshin struct in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */ 16553541Sshin } prefix[PRLSTSIZ]; 16653541Sshin}; 16753541Sshin 16878064Sumestruct in6_prefix { 16978064Sume struct sockaddr_in6 prefix; 17078064Sume struct prf_ra raflags; 17178064Sume u_char prefixlen; 17278064Sume u_char origin; 173121472Sume u_int32_t vltime; 174121472Sume u_int32_t pltime; 175121472Sume time_t expire; 17678064Sume u_int32_t flags; 17778064Sume int refcnt; 17878064Sume u_short if_index; 17978064Sume u_short advrtrs; /* number of advertisement routers */ 18078064Sume /* struct sockaddr_in6 advrtr[] */ 18181369Ssimokawa}; 18278064Sume 18378064Sume#ifdef _KERNEL 18478064Sumestruct in6_ondireq { 18578064Sume char ifname[IFNAMSIZ]; 18678064Sume struct { 18778064Sume u_int32_t linkmtu; /* LinkMTU */ 18878064Sume u_int32_t maxmtu; /* Upper bound of LinkMTU */ 18978064Sume u_int32_t basereachable; /* BaseReachableTime */ 19078064Sume u_int32_t reachable; /* Reachable Time */ 19178064Sume u_int32_t retrans; /* Retrans Timer */ 19278064Sume u_int32_t flags; /* Flags */ 19378064Sume int recalctm; /* BaseReacable re-calculation timer */ 19478064Sume u_int8_t chlim; /* CurHopLimit */ 19578064Sume u_int8_t receivedra; 19678064Sume } ndi; 19778064Sume}; 19878064Sume#endif 19978064Sume 20053541Sshinstruct in6_ndireq { 20162587Sitojun char ifname[IFNAMSIZ]; 20262587Sitojun struct nd_ifinfo ndi; 20353541Sshin}; 20453541Sshin 20562587Sitojunstruct in6_ndifreq { 20662587Sitojun char ifname[IFNAMSIZ]; 20762587Sitojun u_long ifindex; 20862587Sitojun}; 20962587Sitojun 21078064Sume/* Prefix status */ 21178064Sume#define NDPRF_ONLINK 0x1 21278064Sume#define NDPRF_DETACHED 0x2 21362587Sitojun 21453541Sshin/* protocol constants */ 21595023Ssuz#define MAX_RTR_SOLICITATION_DELAY 1 /* 1sec */ 21695023Ssuz#define RTR_SOLICITATION_INTERVAL 4 /* 4sec */ 21762587Sitojun#define MAX_RTR_SOLICITATIONS 3 21853541Sshin 21962587Sitojun#define ND6_INFINITE_LIFETIME 0xffffffff 22053541Sshin 22153541Sshin#ifdef _KERNEL 22253541Sshin/* node constants */ 22362587Sitojun#define MAX_REACHABLE_TIME 3600000 /* msec */ 22462587Sitojun#define REACHABLE_TIME 30000 /* msec */ 22562587Sitojun#define RETRANS_TIMER 1000 /* msec */ 22662587Sitojun#define MIN_RANDOM_FACTOR 512 /* 1024 * 0.5 */ 22762587Sitojun#define MAX_RANDOM_FACTOR 1536 /* 1024 * 1.5 */ 22878064Sume#define DEF_TEMP_VALID_LIFETIME 604800 /* 1 week */ 22978064Sume#define DEF_TEMP_PREFERRED_LIFETIME 86400 /* 1 day */ 23078064Sume#define TEMPADDR_REGEN_ADVANCE 5 /* sec */ 23178064Sume#define MAX_TEMP_DESYNC_FACTOR 600 /* 10 min */ 23262587Sitojun#define ND_COMPUTE_RTIME(x) \ 233121807Sume (((MIN_RANDOM_FACTOR * (x >> 10)) + (arc4random() & \ 23453541Sshin ((MAX_RANDOM_FACTOR - MIN_RANDOM_FACTOR) * (x >> 10)))) /1000) 23553541Sshin 23662587SitojunTAILQ_HEAD(nd_drhead, nd_defrouter); 23753541Sshinstruct nd_defrouter { 23862587Sitojun TAILQ_ENTRY(nd_defrouter) dr_entry; 23953541Sshin struct in6_addr rtaddr; 24095023Ssuz u_char flags; /* flags on RA message */ 24153541Sshin u_short rtlifetime; 24253541Sshin u_long expire; 24362587Sitojun struct ifnet *ifp; 244151539Ssuz int installed; /* is installed into kernel routing table */ 24553541Sshin}; 24653541Sshin 247151539Ssuzstruct nd_prefixctl { 248151539Ssuz struct ifnet *ndpr_ifp; 249151539Ssuz 250151539Ssuz /* prefix */ 251151539Ssuz struct sockaddr_in6 ndpr_prefix; 252151539Ssuz u_char ndpr_plen; 253151539Ssuz 254151539Ssuz u_int32_t ndpr_vltime; /* advertised valid lifetime */ 255151539Ssuz u_int32_t ndpr_pltime; /* advertised preferred lifetime */ 256151539Ssuz 257151539Ssuz struct prf_ra ndpr_flags; 258151539Ssuz}; 259151539Ssuz 260151539Ssuz 26153541Sshinstruct nd_prefix { 26262587Sitojun struct ifnet *ndpr_ifp; 26360938Sjake LIST_ENTRY(nd_prefix) ndpr_entry; 26462587Sitojun struct sockaddr_in6 ndpr_prefix; /* prefix */ 26562587Sitojun struct in6_addr ndpr_mask; /* netmask derived from the prefix */ 266151539Ssuz 26762587Sitojun u_int32_t ndpr_vltime; /* advertised valid lifetime */ 26862587Sitojun u_int32_t ndpr_pltime; /* advertised preferred lifetime */ 269151539Ssuz 27062587Sitojun time_t ndpr_expire; /* expiration time of the prefix */ 27162587Sitojun time_t ndpr_preferred; /* preferred time of the prefix */ 272151539Ssuz time_t ndpr_lastupdate; /* reception time of last advertisement */ 273151539Ssuz 27462587Sitojun struct prf_ra ndpr_flags; 27578064Sume u_int32_t ndpr_stateflags; /* actual state flags */ 27653541Sshin /* list of routers that advertise the prefix: */ 27760938Sjake LIST_HEAD(pr_rtrhead, nd_pfxrouter) ndpr_advrtrs; 27853541Sshin u_char ndpr_plen; 27978064Sume int ndpr_refcnt; /* reference couter from addresses */ 28053541Sshin}; 28153541Sshin 28262587Sitojun#define ndpr_raf ndpr_flags 28362587Sitojun#define ndpr_raf_onlink ndpr_flags.onlink 28462587Sitojun#define ndpr_raf_auto ndpr_flags.autonomous 285151539Ssuz#define ndpr_raf_router ndpr_flags.router 28653541Sshin 28753541Sshin/* 28853541Sshin * Message format for use in obtaining information about prefixes 28953541Sshin * from inet6 sysctl function 29053541Sshin */ 29153541Sshinstruct inet6_ndpr_msghdr { 29253541Sshin u_short inpm_msglen; /* to skip over non-understood messages */ 29372093Sasmodai u_char inpm_version; /* future binary compatibility */ 29453541Sshin u_char inpm_type; /* message type */ 29562587Sitojun struct in6_addr inpm_prefix; 29653541Sshin u_long prm_vltim; 29753541Sshin u_long prm_pltime; 29853541Sshin u_long prm_expire; 29953541Sshin u_long prm_preferred; 30062587Sitojun struct in6_prflags prm_flags; 30153541Sshin u_short prm_index; /* index for associated ifp */ 30253541Sshin u_char prm_plen; /* length of prefix in bits */ 30353541Sshin}; 30453541Sshin 30562587Sitojun#define prm_raf_onlink prm_flags.prf_ra.onlink 30662587Sitojun#define prm_raf_auto prm_flags.prf_ra.autonomous 30753541Sshin 30862587Sitojun#define prm_statef_onlink prm_flags.prf_state.onlink 30953541Sshin 31062587Sitojun#define prm_rrf_decrvalid prm_flags.prf_rr.decrvalid 31162587Sitojun#define prm_rrf_decrprefd prm_flags.prf_rr.decrprefd 31253541Sshin 31353541Sshinstruct nd_pfxrouter { 31460938Sjake LIST_ENTRY(nd_pfxrouter) pfr_entry; 31562587Sitojun struct nd_defrouter *router; 31653541Sshin}; 31753541Sshin 31860938SjakeLIST_HEAD(nd_prhead, nd_prefix); 31953541Sshin 32053541Sshin/* nd6.c */ 321195699SrwatsonVNET_DECLARE(int, nd6_prune); 322195699SrwatsonVNET_DECLARE(int, nd6_delay); 323195699SrwatsonVNET_DECLARE(int, nd6_umaxtries); 324195699SrwatsonVNET_DECLARE(int, nd6_mmaxtries); 325195699SrwatsonVNET_DECLARE(int, nd6_useloopback); 326195699SrwatsonVNET_DECLARE(int, nd6_maxnudhint); 327195699SrwatsonVNET_DECLARE(int, nd6_gctimer); 328195699SrwatsonVNET_DECLARE(struct nd_drhead, nd_defrouter); 329195699SrwatsonVNET_DECLARE(struct nd_prhead, nd_prefix); 330195699SrwatsonVNET_DECLARE(int, nd6_debug); 331195699SrwatsonVNET_DECLARE(int, nd6_onlink_ns_rfc4861); 332195727Srwatson#define V_nd6_prune VNET(nd6_prune) 333195727Srwatson#define V_nd6_delay VNET(nd6_delay) 334195727Srwatson#define V_nd6_umaxtries VNET(nd6_umaxtries) 335195727Srwatson#define V_nd6_mmaxtries VNET(nd6_mmaxtries) 336195727Srwatson#define V_nd6_useloopback VNET(nd6_useloopback) 337195727Srwatson#define V_nd6_maxnudhint VNET(nd6_maxnudhint) 338195727Srwatson#define V_nd6_gctimer VNET(nd6_gctimer) 339195727Srwatson#define V_nd_defrouter VNET(nd_defrouter) 340195727Srwatson#define V_nd_prefix VNET(nd_prefix) 341195727Srwatson#define V_nd6_debug VNET(nd6_debug) 342195727Srwatson#define V_nd6_onlink_ns_rfc4861 VNET(nd6_onlink_ns_rfc4861) 343207369Sbz 344207369Sbz#define nd6log(x) do { if (V_nd6_debug) log x; } while (/*CONSTCOND*/ 0) 345207369Sbz 346207369SbzVNET_DECLARE(struct callout, nd6_timer_ch); 347195727Srwatson#define V_nd6_timer_ch VNET(nd6_timer_ch) 34878064Sume 34962587Sitojun/* nd6_rtr.c */ 350195699SrwatsonVNET_DECLARE(int, nd6_defifindex); 351195699SrwatsonVNET_DECLARE(int, ip6_desync_factor); /* seconds */ 352195699SrwatsonVNET_DECLARE(u_int32_t, ip6_temp_preferred_lifetime); /* seconds */ 353195699SrwatsonVNET_DECLARE(u_int32_t, ip6_temp_valid_lifetime); /* seconds */ 354195699SrwatsonVNET_DECLARE(int, ip6_temp_regen_advance); /* seconds */ 355195727Srwatson#define V_nd6_defifindex VNET(nd6_defifindex) 356195727Srwatson#define V_ip6_desync_factor VNET(ip6_desync_factor) 357195727Srwatson#define V_ip6_temp_preferred_lifetime VNET(ip6_temp_preferred_lifetime) 358195727Srwatson#define V_ip6_temp_valid_lifetime VNET(ip6_temp_valid_lifetime) 359195727Srwatson#define V_ip6_temp_regen_advance VNET(ip6_temp_regen_advance) 360195699Srwatson 36153541Sshinunion nd_opts { 362121575Sume struct nd_opt_hdr *nd_opt_array[8]; /* max = target address list */ 36353541Sshin struct { 36462587Sitojun struct nd_opt_hdr *zero; 36562587Sitojun struct nd_opt_hdr *src_lladdr; 36662587Sitojun struct nd_opt_hdr *tgt_lladdr; 36795023Ssuz struct nd_opt_prefix_info *pi_beg; /* multiple opts, start */ 36862587Sitojun struct nd_opt_rd_hdr *rh; 36962587Sitojun struct nd_opt_mtu *mtu; 37062587Sitojun struct nd_opt_hdr *search; /* multiple opts */ 37162587Sitojun struct nd_opt_hdr *last; /* multiple opts */ 37262587Sitojun int done; 37362587Sitojun struct nd_opt_prefix_info *pi_end;/* multiple opts, end */ 37453541Sshin } nd_opt_each; 37553541Sshin}; 37662587Sitojun#define nd_opts_src_lladdr nd_opt_each.src_lladdr 37762587Sitojun#define nd_opts_tgt_lladdr nd_opt_each.tgt_lladdr 37862587Sitojun#define nd_opts_pi nd_opt_each.pi_beg 37962587Sitojun#define nd_opts_pi_end nd_opt_each.pi_end 38062587Sitojun#define nd_opts_rh nd_opt_each.rh 38162587Sitojun#define nd_opts_mtu nd_opt_each.mtu 38262587Sitojun#define nd_opts_search nd_opt_each.search 38362587Sitojun#define nd_opts_last nd_opt_each.last 38462587Sitojun#define nd_opts_done nd_opt_each.done 38553541Sshin 38653541Sshin/* XXX: need nd6_var.h?? */ 38753541Sshin/* nd6.c */ 388241916Sdelphijvoid nd6_init(void); 389193731Szec#ifdef VIMAGE 390241916Sdelphijvoid nd6_destroy(void); 391193731Szec#endif 392241916Sdelphijstruct nd_ifinfo *nd6_ifattach(struct ifnet *); 393241916Sdelphijvoid nd6_ifdetach(struct nd_ifinfo *); 394241916Sdelphijint nd6_is_addr_neighbor(struct sockaddr_in6 *, struct ifnet *); 395241916Sdelphijvoid nd6_option_init(void *, int, union nd_opts *); 396241916Sdelphijstruct nd_opt_hdr *nd6_option(union nd_opts *); 397241916Sdelphijint nd6_options(union nd_opts *); 398241916Sdelphijstruct llentry *nd6_lookup(struct in6_addr *, int, struct ifnet *); 399241916Sdelphijvoid nd6_setmtu(struct ifnet *); 400241916Sdelphijvoid nd6_llinfo_settimer(struct llentry *, long); 401241916Sdelphijvoid nd6_llinfo_settimer_locked(struct llentry *, long); 402241916Sdelphijvoid nd6_timer(void *); 403241916Sdelphijvoid nd6_purge(struct ifnet *); 404241916Sdelphijvoid nd6_nud_hint(struct rtentry *, struct in6_addr *, int); 405241916Sdelphijint nd6_resolve(struct ifnet *, struct rtentry *, struct mbuf *, 406241916Sdelphij struct sockaddr *, u_char *); 407241916Sdelphijvoid nd6_rtrequest(int, struct rtentry *, struct rt_addrinfo *); 408241916Sdelphijint nd6_ioctl(u_long, caddr_t, struct ifnet *); 409241916Sdelphijstruct llentry *nd6_cache_lladdr(struct ifnet *, struct in6_addr *, 410241916Sdelphij char *, int, int, int); 411241916Sdelphijint nd6_output(struct ifnet *, struct ifnet *, struct mbuf *, 412241916Sdelphij struct sockaddr_in6 *, struct rtentry *); 413241916Sdelphijint nd6_output_lle(struct ifnet *, struct ifnet *, struct mbuf *, 414186119Sqingli struct sockaddr_in6 *, struct rtentry *, struct llentry *, 415241916Sdelphij struct mbuf **); 416241916Sdelphijint nd6_output_flush(struct ifnet *, struct ifnet *, struct mbuf *, 417241916Sdelphij struct sockaddr_in6 *, struct route *); 418241916Sdelphijint nd6_need_cache(struct ifnet *); 419241916Sdelphijint nd6_storelladdr(struct ifnet *, struct mbuf *, 420249925Sglebius const struct sockaddr *, u_char *, struct llentry **); 42153541Sshin 42253541Sshin/* nd6_nbr.c */ 423241916Sdelphijvoid nd6_na_input(struct mbuf *, int, int); 424241916Sdelphijvoid nd6_na_output(struct ifnet *, const struct in6_addr *, 425241916Sdelphij const struct in6_addr *, u_long, int, struct sockaddr *); 426241916Sdelphijvoid nd6_ns_input(struct mbuf *, int, int); 427241916Sdelphijvoid nd6_ns_output(struct ifnet *, const struct in6_addr *, 428241916Sdelphij const struct in6_addr *, struct llentry *, int); 429241916Sdelphijcaddr_t nd6_ifptomac(struct ifnet *); 430241916Sdelphijvoid nd6_dad_start(struct ifaddr *, int); 431241916Sdelphijvoid nd6_dad_stop(struct ifaddr *); 432241916Sdelphijvoid nd6_dad_duplicated(struct ifaddr *); 43353541Sshin 43453541Sshin/* nd6_rtr.c */ 435241916Sdelphijvoid nd6_rs_input(struct mbuf *, int, int); 436241916Sdelphijvoid nd6_ra_input(struct mbuf *, int, int); 437241916Sdelphijvoid prelist_del(struct nd_prefix *); 438241916Sdelphijvoid defrouter_reset(void); 439241916Sdelphijvoid defrouter_select(void); 440241916Sdelphijvoid defrtrlist_del(struct nd_defrouter *); 441241916Sdelphijvoid prelist_remove(struct nd_prefix *); 442241916Sdelphijint nd6_prelist_add(struct nd_prefixctl *, struct nd_defrouter *, 443241916Sdelphij struct nd_prefix **); 444241916Sdelphijvoid pfxlist_onlink_check(void); 445241916Sdelphijstruct nd_defrouter *defrouter_lookup(struct in6_addr *, struct ifnet *); 446241916Sdelphijstruct nd_prefix *nd6_prefix_lookup(struct nd_prefixctl *); 447241916Sdelphijvoid rt6_flush(struct in6_addr *, struct ifnet *); 448241916Sdelphijint nd6_setdefaultiface(int); 449241916Sdelphijint in6_tmpifadd(const struct in6_ifaddr *, int, int); 45053541Sshin 45153541Sshin#endif /* _KERNEL */ 45253541Sshin 45353541Sshin#endif /* _NETINET6_ND6_H_ */ 454