nd6.h revision 195727
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: head/sys/netinet6/nd6.h 195727 2009-07-16 21:13:04Z rwatson $ 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 82151474Ssuz#define ND6_IFF_PREFER_SOURCE 0x4 /* XXX: not related to ND. */ 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 8762587Sitojun 88186119Sqingli#define ND6_CREATE LLE_CREATE 89186119Sqingli#define ND6_EXCLUSIVE LLE_EXCLUSIVE 90186119Sqingli 91121161Sume#ifdef _KERNEL 92121161Sume#define ND_IFINFO(ifp) \ 93121161Sume (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->nd_ifinfo) 94121161Sume#define IN6_LINKMTU(ifp) \ 95121161Sume ((ND_IFINFO(ifp)->linkmtu && ND_IFINFO(ifp)->linkmtu < (ifp)->if_mtu) \ 96121161Sume ? ND_IFINFO(ifp)->linkmtu \ 97121161Sume : ((ND_IFINFO(ifp)->maxmtu && ND_IFINFO(ifp)->maxmtu < (ifp)->if_mtu) \ 98121161Sume ? ND_IFINFO(ifp)->maxmtu : (ifp)->if_mtu)) 99121161Sume#endif 100121161Sume 10153541Sshinstruct in6_nbrinfo { 10262587Sitojun char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */ 10362587Sitojun struct in6_addr addr; /* IPv6 address of the neighbor */ 10453541Sshin long asked; /* number of queries already sent for this addr */ 10553541Sshin int isrouter; /* if it acts as a router */ 10653541Sshin int state; /* reachability state */ 10753541Sshin int expire; /* lifetime for NDP state transition */ 10853541Sshin}; 10953541Sshin 11062587Sitojun#define DRLSTSIZ 10 11162587Sitojun#define PRLSTSIZ 10 11253541Sshinstruct in6_drlist { 11362587Sitojun char ifname[IFNAMSIZ]; 11453541Sshin struct { 11553541Sshin struct in6_addr rtaddr; 11653541Sshin u_char flags; 11753541Sshin u_short rtlifetime; 11853541Sshin u_long expire; 11962587Sitojun u_short if_index; 12053541Sshin } defrouter[DRLSTSIZ]; 12153541Sshin}; 12253541Sshin 12378064Sumestruct in6_defrouter { 12478064Sume struct sockaddr_in6 rtaddr; 12578064Sume u_char flags; 12678064Sume u_short rtlifetime; 12778064Sume u_long expire; 12878064Sume u_short if_index; 12981369Ssimokawa}; 13078064Sume 131121472Sume#ifdef _KERNEL 132121472Sumestruct in6_oprlist { 133121472Sume char ifname[IFNAMSIZ]; 134121472Sume struct { 135121472Sume struct in6_addr prefix; 136121472Sume struct prf_ra raflags; 137121472Sume u_char prefixlen; 138121472Sume u_char origin; 139121472Sume u_long vltime; 140121472Sume u_long pltime; 141121472Sume u_long expire; 142121472Sume u_short if_index; 143121472Sume u_short advrtrs; /* number of advertisement routers */ 144121472Sume struct in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */ 145121472Sume } prefix[PRLSTSIZ]; 146121472Sume}; 147121472Sume#endif 148121472Sume 14953541Sshinstruct in6_prlist { 15062587Sitojun char ifname[IFNAMSIZ]; 15153541Sshin struct { 15253541Sshin struct in6_addr prefix; 15362587Sitojun struct prf_ra raflags; 15453541Sshin u_char prefixlen; 15562587Sitojun u_char origin; 15695023Ssuz u_int32_t vltime; 15795023Ssuz u_int32_t pltime; 15895023Ssuz time_t expire; 15962587Sitojun u_short if_index; 16062587Sitojun u_short advrtrs; /* number of advertisement routers */ 16153541Sshin struct in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */ 16253541Sshin } prefix[PRLSTSIZ]; 16353541Sshin}; 16453541Sshin 16578064Sumestruct in6_prefix { 16678064Sume struct sockaddr_in6 prefix; 16778064Sume struct prf_ra raflags; 16878064Sume u_char prefixlen; 16978064Sume u_char origin; 170121472Sume u_int32_t vltime; 171121472Sume u_int32_t pltime; 172121472Sume time_t expire; 17378064Sume u_int32_t flags; 17478064Sume int refcnt; 17578064Sume u_short if_index; 17678064Sume u_short advrtrs; /* number of advertisement routers */ 17778064Sume /* struct sockaddr_in6 advrtr[] */ 17881369Ssimokawa}; 17978064Sume 18078064Sume#ifdef _KERNEL 18178064Sumestruct in6_ondireq { 18278064Sume char ifname[IFNAMSIZ]; 18378064Sume struct { 18478064Sume u_int32_t linkmtu; /* LinkMTU */ 18578064Sume u_int32_t maxmtu; /* Upper bound of LinkMTU */ 18678064Sume u_int32_t basereachable; /* BaseReachableTime */ 18778064Sume u_int32_t reachable; /* Reachable Time */ 18878064Sume u_int32_t retrans; /* Retrans Timer */ 18978064Sume u_int32_t flags; /* Flags */ 19078064Sume int recalctm; /* BaseReacable re-calculation timer */ 19178064Sume u_int8_t chlim; /* CurHopLimit */ 19278064Sume u_int8_t receivedra; 19378064Sume } ndi; 19478064Sume}; 19578064Sume#endif 19678064Sume 19753541Sshinstruct in6_ndireq { 19862587Sitojun char ifname[IFNAMSIZ]; 19962587Sitojun struct nd_ifinfo ndi; 20053541Sshin}; 20153541Sshin 20262587Sitojunstruct in6_ndifreq { 20362587Sitojun char ifname[IFNAMSIZ]; 20462587Sitojun u_long ifindex; 20562587Sitojun}; 20662587Sitojun 20778064Sume/* Prefix status */ 20878064Sume#define NDPRF_ONLINK 0x1 20978064Sume#define NDPRF_DETACHED 0x2 21062587Sitojun 21153541Sshin/* protocol constants */ 21295023Ssuz#define MAX_RTR_SOLICITATION_DELAY 1 /* 1sec */ 21395023Ssuz#define RTR_SOLICITATION_INTERVAL 4 /* 4sec */ 21462587Sitojun#define MAX_RTR_SOLICITATIONS 3 21553541Sshin 21662587Sitojun#define ND6_INFINITE_LIFETIME 0xffffffff 21753541Sshin 21853541Sshin#ifdef _KERNEL 21953541Sshin/* node constants */ 22062587Sitojun#define MAX_REACHABLE_TIME 3600000 /* msec */ 22162587Sitojun#define REACHABLE_TIME 30000 /* msec */ 22262587Sitojun#define RETRANS_TIMER 1000 /* msec */ 22362587Sitojun#define MIN_RANDOM_FACTOR 512 /* 1024 * 0.5 */ 22462587Sitojun#define MAX_RANDOM_FACTOR 1536 /* 1024 * 1.5 */ 22578064Sume#define DEF_TEMP_VALID_LIFETIME 604800 /* 1 week */ 22678064Sume#define DEF_TEMP_PREFERRED_LIFETIME 86400 /* 1 day */ 22778064Sume#define TEMPADDR_REGEN_ADVANCE 5 /* sec */ 22878064Sume#define MAX_TEMP_DESYNC_FACTOR 600 /* 10 min */ 22962587Sitojun#define ND_COMPUTE_RTIME(x) \ 230121807Sume (((MIN_RANDOM_FACTOR * (x >> 10)) + (arc4random() & \ 23153541Sshin ((MAX_RANDOM_FACTOR - MIN_RANDOM_FACTOR) * (x >> 10)))) /1000) 23253541Sshin 23362587SitojunTAILQ_HEAD(nd_drhead, nd_defrouter); 23453541Sshinstruct nd_defrouter { 23562587Sitojun TAILQ_ENTRY(nd_defrouter) dr_entry; 23653541Sshin struct in6_addr rtaddr; 23795023Ssuz u_char flags; /* flags on RA message */ 23853541Sshin u_short rtlifetime; 23953541Sshin u_long expire; 24062587Sitojun struct ifnet *ifp; 241151539Ssuz int installed; /* is installed into kernel routing table */ 24253541Sshin}; 24353541Sshin 244151539Ssuzstruct nd_prefixctl { 245151539Ssuz struct ifnet *ndpr_ifp; 246151539Ssuz 247151539Ssuz /* prefix */ 248151539Ssuz struct sockaddr_in6 ndpr_prefix; 249151539Ssuz u_char ndpr_plen; 250151539Ssuz 251151539Ssuz u_int32_t ndpr_vltime; /* advertised valid lifetime */ 252151539Ssuz u_int32_t ndpr_pltime; /* advertised preferred lifetime */ 253151539Ssuz 254151539Ssuz struct prf_ra ndpr_flags; 255151539Ssuz}; 256151539Ssuz 257151539Ssuz 25853541Sshinstruct nd_prefix { 25962587Sitojun struct ifnet *ndpr_ifp; 26060938Sjake LIST_ENTRY(nd_prefix) ndpr_entry; 26162587Sitojun struct sockaddr_in6 ndpr_prefix; /* prefix */ 26262587Sitojun struct in6_addr ndpr_mask; /* netmask derived from the prefix */ 263151539Ssuz 26462587Sitojun u_int32_t ndpr_vltime; /* advertised valid lifetime */ 26562587Sitojun u_int32_t ndpr_pltime; /* advertised preferred lifetime */ 266151539Ssuz 26762587Sitojun time_t ndpr_expire; /* expiration time of the prefix */ 26862587Sitojun time_t ndpr_preferred; /* preferred time of the prefix */ 269151539Ssuz time_t ndpr_lastupdate; /* reception time of last advertisement */ 270151539Ssuz 27162587Sitojun struct prf_ra ndpr_flags; 27278064Sume u_int32_t ndpr_stateflags; /* actual state flags */ 27353541Sshin /* list of routers that advertise the prefix: */ 27460938Sjake LIST_HEAD(pr_rtrhead, nd_pfxrouter) ndpr_advrtrs; 27553541Sshin u_char ndpr_plen; 27678064Sume int ndpr_refcnt; /* reference couter from addresses */ 27753541Sshin}; 27853541Sshin 27962587Sitojun#define ndpr_next ndpr_entry.le_next 28053541Sshin 28162587Sitojun#define ndpr_raf ndpr_flags 28262587Sitojun#define ndpr_raf_onlink ndpr_flags.onlink 28362587Sitojun#define ndpr_raf_auto ndpr_flags.autonomous 284151539Ssuz#define ndpr_raf_router ndpr_flags.router 28553541Sshin 28653541Sshin/* 28753541Sshin * Message format for use in obtaining information about prefixes 28853541Sshin * from inet6 sysctl function 28953541Sshin */ 29053541Sshinstruct inet6_ndpr_msghdr { 29153541Sshin u_short inpm_msglen; /* to skip over non-understood messages */ 29272093Sasmodai u_char inpm_version; /* future binary compatibility */ 29353541Sshin u_char inpm_type; /* message type */ 29462587Sitojun struct in6_addr inpm_prefix; 29553541Sshin u_long prm_vltim; 29653541Sshin u_long prm_pltime; 29753541Sshin u_long prm_expire; 29853541Sshin u_long prm_preferred; 29962587Sitojun struct in6_prflags prm_flags; 30053541Sshin u_short prm_index; /* index for associated ifp */ 30153541Sshin u_char prm_plen; /* length of prefix in bits */ 30253541Sshin}; 30353541Sshin 30462587Sitojun#define prm_raf_onlink prm_flags.prf_ra.onlink 30562587Sitojun#define prm_raf_auto prm_flags.prf_ra.autonomous 30653541Sshin 30762587Sitojun#define prm_statef_onlink prm_flags.prf_state.onlink 30853541Sshin 30962587Sitojun#define prm_rrf_decrvalid prm_flags.prf_rr.decrvalid 31062587Sitojun#define prm_rrf_decrprefd prm_flags.prf_rr.decrprefd 31153541Sshin 31253541Sshinstruct nd_pfxrouter { 31360938Sjake LIST_ENTRY(nd_pfxrouter) pfr_entry; 31462587Sitojun#define pfr_next pfr_entry.le_next 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); 332195699SrwatsonVNET_DECLARE(struct callout, nd6_timer_ch); 33353541Sshin 334195727Srwatson#define V_nd6_prune VNET(nd6_prune) 335195727Srwatson#define V_nd6_delay VNET(nd6_delay) 336195727Srwatson#define V_nd6_umaxtries VNET(nd6_umaxtries) 337195727Srwatson#define V_nd6_mmaxtries VNET(nd6_mmaxtries) 338195727Srwatson#define V_nd6_useloopback VNET(nd6_useloopback) 339195727Srwatson#define V_nd6_maxnudhint VNET(nd6_maxnudhint) 340195727Srwatson#define V_nd6_gctimer VNET(nd6_gctimer) 341195727Srwatson#define V_nd_defrouter VNET(nd_defrouter) 342195727Srwatson#define V_nd_prefix VNET(nd_prefix) 343195727Srwatson#define V_nd6_debug VNET(nd6_debug) 344195727Srwatson#define V_nd6_onlink_ns_rfc4861 VNET(nd6_onlink_ns_rfc4861) 345195727Srwatson#define V_nd6_timer_ch VNET(nd6_timer_ch) 34678064Sume 34762587Sitojun/* nd6_rtr.c */ 348195699SrwatsonVNET_DECLARE(int, nd6_defifindex); 349195699SrwatsonVNET_DECLARE(int, ip6_desync_factor); /* seconds */ 350195699SrwatsonVNET_DECLARE(u_int32_t, ip6_temp_preferred_lifetime); /* seconds */ 351195699SrwatsonVNET_DECLARE(u_int32_t, ip6_temp_valid_lifetime); /* seconds */ 352195699SrwatsonVNET_DECLARE(int, ip6_temp_regen_advance); /* seconds */ 35362587Sitojun 354195727Srwatson#define V_nd6_defifindex VNET(nd6_defifindex) 355195727Srwatson#define V_ip6_desync_factor VNET(ip6_desync_factor) 356195727Srwatson#define V_ip6_temp_preferred_lifetime VNET(ip6_temp_preferred_lifetime) 357195727Srwatson#define V_ip6_temp_valid_lifetime VNET(ip6_temp_valid_lifetime) 358195727Srwatson#define V_ip6_temp_regen_advance VNET(ip6_temp_regen_advance) 359195699Srwatson 360185937Sbz#define nd6log(x) do { if (V_nd6_debug) log x; } while (/*CONSTCOND*/ 0) 361185937Sbz 36253541Sshinunion nd_opts { 363121575Sume struct nd_opt_hdr *nd_opt_array[8]; /* max = target address list */ 36453541Sshin struct { 36562587Sitojun struct nd_opt_hdr *zero; 36662587Sitojun struct nd_opt_hdr *src_lladdr; 36762587Sitojun struct nd_opt_hdr *tgt_lladdr; 36895023Ssuz struct nd_opt_prefix_info *pi_beg; /* multiple opts, start */ 36962587Sitojun struct nd_opt_rd_hdr *rh; 37062587Sitojun struct nd_opt_mtu *mtu; 37162587Sitojun struct nd_opt_hdr *search; /* multiple opts */ 37262587Sitojun struct nd_opt_hdr *last; /* multiple opts */ 37362587Sitojun int done; 37462587Sitojun struct nd_opt_prefix_info *pi_end;/* multiple opts, end */ 37553541Sshin } nd_opt_each; 37653541Sshin}; 37762587Sitojun#define nd_opts_src_lladdr nd_opt_each.src_lladdr 37862587Sitojun#define nd_opts_tgt_lladdr nd_opt_each.tgt_lladdr 37962587Sitojun#define nd_opts_pi nd_opt_each.pi_beg 38062587Sitojun#define nd_opts_pi_end nd_opt_each.pi_end 38162587Sitojun#define nd_opts_rh nd_opt_each.rh 38262587Sitojun#define nd_opts_mtu nd_opt_each.mtu 38362587Sitojun#define nd_opts_search nd_opt_each.search 38462587Sitojun#define nd_opts_last nd_opt_each.last 38562587Sitojun#define nd_opts_done nd_opt_each.done 38653541Sshin 38753541Sshin/* XXX: need nd6_var.h?? */ 38853541Sshin/* nd6.c */ 38962587Sitojunvoid nd6_init __P((void)); 390193731Szec#ifdef VIMAGE 391193731Szecvoid nd6_destroy __P((void)); 392193731Szec#endif 393121161Sumestruct nd_ifinfo *nd6_ifattach __P((struct ifnet *)); 394121161Sumevoid nd6_ifdetach __P((struct nd_ifinfo *)); 39562587Sitojunint nd6_is_addr_neighbor __P((struct sockaddr_in6 *, struct ifnet *)); 39662587Sitojunvoid nd6_option_init __P((void *, int, union nd_opts *)); 39762587Sitojunstruct nd_opt_hdr *nd6_option __P((union nd_opts *)); 39862587Sitojunint nd6_options __P((union nd_opts *)); 399186119Sqinglistruct llentry *nd6_lookup __P((struct in6_addr *, int, struct ifnet *)); 40062587Sitojunvoid nd6_setmtu __P((struct ifnet *)); 401186119Sqinglivoid nd6_llinfo_settimer __P((struct llentry *, long)); 402186119Sqinglivoid nd6_llinfo_settimer_locked __P((struct llentry *, long)); 40362587Sitojunvoid nd6_timer __P((void *)); 40462587Sitojunvoid nd6_purge __P((struct ifnet *)); 40562587Sitojunvoid nd6_nud_hint __P((struct rtentry *, struct in6_addr *, int)); 406120941Sumeint nd6_resolve __P((struct ifnet *, struct rtentry *, struct mbuf *, 407120941Sume struct sockaddr *, u_char *)); 40862587Sitojunint nd6_ioctl __P((u_long, caddr_t, struct ifnet *)); 409186119Sqinglistruct llentry *nd6_cache_lladdr __P((struct ifnet *, struct in6_addr *, 41062587Sitojun char *, int, int, int)); 41162587Sitojunint nd6_output __P((struct ifnet *, struct ifnet *, struct mbuf *, 412120941Sume struct sockaddr_in6 *, struct rtentry *)); 413186119Sqingliint nd6_output_lle __P((struct ifnet *, struct ifnet *, struct mbuf *, 414186119Sqingli struct sockaddr_in6 *, struct rtentry *, struct llentry *, 415186119Sqingli struct mbuf **)); 416186119Sqingliint nd6_output_flush __P((struct ifnet *, struct ifnet *, struct mbuf *, 417191148Skmacy struct sockaddr_in6 *, struct route *)); 418151539Ssuzint nd6_need_cache __P((struct ifnet *)); 419186215Sqingliint nd6_storelladdr __P((struct ifnet *, struct mbuf *, 420186119Sqingli struct sockaddr *, u_char *, struct llentry **)); 42153541Sshin 42253541Sshin/* nd6_nbr.c */ 42362587Sitojunvoid nd6_na_input __P((struct mbuf *, int, int)); 42478064Sumevoid nd6_na_output __P((struct ifnet *, const struct in6_addr *, 42578064Sume const struct in6_addr *, u_long, int, struct sockaddr *)); 42662587Sitojunvoid nd6_ns_input __P((struct mbuf *, int, int)); 42778064Sumevoid nd6_ns_output __P((struct ifnet *, const struct in6_addr *, 428186119Sqingli const struct in6_addr *, struct llentry *, int)); 42962587Sitojuncaddr_t nd6_ifptomac __P((struct ifnet *)); 430151539Ssuzvoid nd6_dad_start __P((struct ifaddr *, int)); 43178064Sumevoid nd6_dad_stop __P((struct ifaddr *)); 43262587Sitojunvoid nd6_dad_duplicated __P((struct ifaddr *)); 43353541Sshin 43453541Sshin/* nd6_rtr.c */ 43562587Sitojunvoid nd6_rs_input __P((struct mbuf *, int, int)); 43662587Sitojunvoid nd6_ra_input __P((struct mbuf *, int, int)); 43762587Sitojunvoid prelist_del __P((struct nd_prefix *)); 43862587Sitojunvoid defrouter_addreq __P((struct nd_defrouter *)); 439151539Ssuzvoid defrouter_reset __P((void)); 44062587Sitojunvoid defrouter_select __P((void)); 44162587Sitojunvoid defrtrlist_del __P((struct nd_defrouter *)); 44262587Sitojunvoid prelist_remove __P((struct nd_prefix *)); 443151539Ssuzint nd6_prelist_add __P((struct nd_prefixctl *, struct nd_defrouter *, 444120941Sume struct nd_prefix **)); 44578064Sumeint nd6_prefix_onlink __P((struct nd_prefix *)); 44678064Sumeint nd6_prefix_offlink __P((struct nd_prefix *)); 44762587Sitojunvoid pfxlist_onlink_check __P((void)); 448120941Sumestruct nd_defrouter *defrouter_lookup __P((struct in6_addr *, struct ifnet *)); 449151539Ssuzstruct nd_prefix *nd6_prefix_lookup __P((struct nd_prefixctl *)); 45062587Sitojunvoid rt6_flush __P((struct in6_addr *, struct ifnet *)); 45162587Sitojunint nd6_setdefaultiface __P((int)); 452151539Ssuzint in6_tmpifadd __P((const struct in6_ifaddr *, int, int)); 45353541Sshin 45453541Sshin#endif /* _KERNEL */ 45553541Sshin 45653541Sshin#endif /* _NETINET6_ND6_H_ */ 457