X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/316670eb35587141e969394ae8537d66b9211e80..813fb2f63a553c957e917ede5f119b021d6ce391:/bsd/netinet6/ip6_var.h diff --git a/bsd/netinet6/ip6_var.h b/bsd/netinet6/ip6_var.h index 9507c904b..e04dee46a 100644 --- a/bsd/netinet6/ip6_var.h +++ b/bsd/netinet6/ip6_var.h @@ -1,8 +1,8 @@ /* - * Copyright (c) 2000-2012 Apple Inc. All rights reserved. + * Copyright (c) 2000-2016 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,13 +22,10 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ -/* $FreeBSD: src/sys/netinet6/ip6_var.h,v 1.2.2.2 2001/07/03 11:01:54 ume Exp $ */ -/* $KAME: ip6_var.h,v 1.62 2001/05/03 14:51:48 itojun Exp $ */ - /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. @@ -94,10 +91,12 @@ */ #ifndef _NETINET6_IP6_VAR_H_ -#define _NETINET6_IP6_VAR_H_ +#define _NETINET6_IP6_VAR_H_ #include -#ifdef XNU_KERNEL_PRIVATE +#ifdef BSD_KERNEL_PRIVATE +#include + /* * IP6 reassembly queue structure. Each fragment * being reassembled is attached to one of these structures. @@ -113,10 +112,12 @@ struct ip6q { struct ip6q *ip6q_next; struct ip6q *ip6q_prev; int ip6q_unfrglen; /* len of unfragmentable part */ -#if notyet +#ifdef notyet u_char *ip6q_nxtp; #endif int ip6q_nfrag; /* # of fragments */ + uint32_t ip6q_csum_flags; /* checksum flags */ + uint32_t ip6q_csum; /* partial checksum value */ }; struct ip6asfrag { @@ -129,7 +130,7 @@ struct ip6asfrag { u_int16_t ip6af_mff; /* more fragment bit in frag off */ }; -#define IP6_REASS_MBUF(ip6af) (*(struct mbuf **)&((ip6af)->ip6af_m)) +#define IP6_REASS_MBUF(ip6af) (*(struct mbuf **)&((ip6af)->ip6af_m)) struct ip6_moptions { decl_lck_mtx_data(, im6o_lock); @@ -181,6 +182,7 @@ struct ip6_exthdrs { struct mbuf *ip6e_dest1; struct mbuf *ip6e_rthdr; struct mbuf *ip6e_dest2; + boolean_t merged; }; /* @@ -192,16 +194,16 @@ struct ip6po_rhinfo { struct ip6_rthdr *ip6po_rhi_rthdr; /* Routing header */ struct route_in6 ip6po_rhi_route; /* Route to the 1st hop */ }; -#define ip6po_rthdr ip6po_rhinfo.ip6po_rhi_rthdr -#define ip6po_route ip6po_rhinfo.ip6po_rhi_route +#define ip6po_rthdr ip6po_rhinfo.ip6po_rhi_rthdr +#define ip6po_route ip6po_rhinfo.ip6po_rhi_route /* Nexthop related info */ struct ip6po_nhinfo { struct sockaddr *ip6po_nhi_nexthop; struct route_in6 ip6po_nhi_route; /* Route to the nexthop */ }; -#define ip6po_nexthop ip6po_nhinfo.ip6po_nhi_nexthop -#define ip6po_nextroute ip6po_nhinfo.ip6po_nhi_route +#define ip6po_nexthop ip6po_nhinfo.ip6po_nhi_nexthop +#define ip6po_nextroute ip6po_nhinfo.ip6po_nhi_route struct ip6_pktopts { struct mbuf *ip6po_m; /* Pointer to mbuf storing the data */ @@ -227,29 +229,33 @@ struct ip6_pktopts { int ip6po_tclass; /* traffic class */ int ip6po_minmtu; /* fragment vs PMTU discovery policy */ -#define IP6PO_MINMTU_MCASTONLY -1 /* default; send at min MTU for multicast*/ -#define IP6PO_MINMTU_DISABLE 0 /* always perform pmtu disc */ -#define IP6PO_MINMTU_ALL 1 /* always send at min MTU */ +#define IP6PO_MINMTU_MCASTONLY -1 /* default; send at min MTU for multicast */ +#define IP6PO_MINMTU_DISABLE 0 /* always perform pmtu disc */ +#define IP6PO_MINMTU_ALL 1 /* always send at min MTU */ + + /* whether temporary addresses are preferred as source address */ + int ip6po_prefer_tempaddr; - int ip6po_prefer_tempaddr; /* whether temporary addresses are - preferred as source address */ -#define IP6PO_TEMPADDR_SYSTEM -1 /* follow the system default */ -#define IP6PO_TEMPADDR_NOTPREFER 0 /* not prefer temporary address */ -#define IP6PO_TEMPADDR_PREFER 1 /* prefer temporary address */ +#define IP6PO_TEMPADDR_SYSTEM -1 /* follow the system default */ +#define IP6PO_TEMPADDR_NOTPREFER 0 /* not prefer temporary address */ +#define IP6PO_TEMPADDR_PREFER 1 /* prefer temporary address */ int ip6po_flags; #if 0 /* parameters in this block is obsolete. do not reuse the values. */ -#define IP6PO_REACHCONF 0x01 /* upper-layer reachability confirmation. */ -#define IP6PO_MINMTU 0x02 /* use minimum MTU (IPV6_USE_MIN_MTU) */ +#define IP6PO_REACHCONF 0x01 /* upper-layer reachability confirmation. */ +#define IP6PO_MINMTU 0x02 /* use minimum MTU (IPV6_USE_MIN_MTU) */ #endif -#define IP6PO_DONTFRAG 0x04 /* disable fragmentation (IPV6_DONTFRAG) */ -#define IP6PO_USECOA 0x08 /* use care of address */ +#define IP6PO_DONTFRAG 0x04 /* no fragmentation (IPV6_DONTFRAG) */ +#define IP6PO_USECOA 0x08 /* use care of address */ }; /* * Control options for incoming packets */ -#endif /* XNU_KERNEL_PRIVATE */ +#endif /* BSD_KERNEL_PRIVATE */ + +#define IP6S_SRCRULE_COUNT 16 +#include struct ip6stat { u_quad_t ip6s_total; /* total packets received */ @@ -262,10 +268,11 @@ struct ip6stat { u_quad_t ip6s_forward; /* packets forwarded */ u_quad_t ip6s_cantforward; /* packets rcvd for unreachable dest */ u_quad_t ip6s_redirectsent; /* packets forwarded on same net */ - u_quad_t ip6s_delivered; /* datagrams delivered to upper level*/ + u_quad_t ip6s_delivered; /* datagrams delivered to upper level */ u_quad_t ip6s_localout; /* total ip packets generated here */ u_quad_t ip6s_odropped; /* lost packets due to nobufs, etc. */ u_quad_t ip6s_reassembled; /* total packets reassembled ok */ + u_quad_t ip6s_atmfrag_rcvd; /* atomic fragments received */ u_quad_t ip6s_fragmented; /* datagrams successfully fragmented */ u_quad_t ip6s_ofragments; /* output fragments created */ u_quad_t ip6s_cantfrag; /* don't fragment flag was set, etc. */ @@ -287,66 +294,84 @@ struct ip6stat { /* * statistics for improvement of the source address selection * algorithm: - * XXX: hardcoded 16 = # of ip6 multicast scope types + 1 */ /* number of times that address selection fails */ u_quad_t ip6s_sources_none; /* number of times that an address on the outgoing I/F is chosen */ - u_quad_t ip6s_sources_sameif[16]; + u_quad_t ip6s_sources_sameif[SCOPE6_ID_MAX]; /* number of times that an address on a non-outgoing I/F is chosen */ - u_quad_t ip6s_sources_otherif[16]; + u_quad_t ip6s_sources_otherif[SCOPE6_ID_MAX]; /* * number of times that an address that has the same scope * from the destination is chosen. */ - u_quad_t ip6s_sources_samescope[16]; + u_quad_t ip6s_sources_samescope[SCOPE6_ID_MAX]; /* * number of times that an address that has a different scope * from the destination is chosen. */ - u_quad_t ip6s_sources_otherscope[16]; + u_quad_t ip6s_sources_otherscope[SCOPE6_ID_MAX]; /* number of times that a deprecated address is chosen */ - u_quad_t ip6s_sources_deprecated[16]; + u_quad_t ip6s_sources_deprecated[SCOPE6_ID_MAX]; u_quad_t ip6s_forward_cachehit; u_quad_t ip6s_forward_cachemiss; /* number of times that each rule of source selection is applied. */ - u_quad_t ip6s_sources_rule[16]; -#ifdef PRIVATE - u_quad_t ip6s_pktdropcntrl; /* pkt dropped, no mbufs for control data */ -#endif /* PRIVATE */ + u_quad_t ip6s_sources_rule[IP6S_SRCRULE_COUNT]; + + /* number of times we ignored address on expensive secondary interfaces */ + u_quad_t ip6s_sources_skip_expensive_secondary_if; + + /* pkt dropped, no mbufs for control data */ + u_quad_t ip6s_pktdropcntrl; + + /* total packets trimmed/adjusted */ + u_quad_t ip6s_adj; + /* hwcksum info discarded during adjustment */ + u_quad_t ip6s_adj_hwcsum_clr; + + /* duplicate address detection collisions */ + u_quad_t ip6s_dad_collide; + + /* DAD NS looped back */ + u_quad_t ip6s_dad_loopcount; +}; + +enum ip6s_sources_rule_index { + IP6S_SRCRULE_0, IP6S_SRCRULE_1, IP6S_SRCRULE_2, IP6S_SRCRULE_3, IP6S_SRCRULE_4, + IP6S_SRCRULE_5, IP6S_SRCRULE_5_5, IP6S_SRCRULE_6, IP6S_SRCRULE_7, + IP6S_SRCRULE_7x, IP6S_SRCRULE_8 }; -#ifdef KERNEL_PRIVATE -#ifdef KERNEL +#ifdef BSD_KERNEL_PRIVATE /* * IPv6 onion peeling state. - * it will be initialized when we come into ip6_input(). - * XXX do not make it a kitchen sink! + * + * This is currently allocated for packets destined to the all-nodes + * multicast address over Ethernet. IPv6 destination address information + * is now stored in the mbuf itself. */ struct ip6aux { u_int32_t ip6a_flags; -#define IP6A_SWAP 0x01 /* swapped home/care-of on packet */ -#define IP6A_HASEEN 0x02 /* HA was present */ -#define IP6A_BRUID 0x04 /* BR Unique Identifier was present */ -#define IP6A_RTALERTSEEN 0x08 /* rtalert present */ +#define IP6A_HASEEN 0x01 /* HA was present */ + +#ifdef notyet +#define IP6A_SWAP 0x02 /* swapped home/care-of on packet */ +#define IP6A_BRUID 0x04 /* BR Unique Identifier was present */ +#define IP6A_RTALERTSEEN 0x08 /* rtalert present */ /* ip6.ip6_src */ struct in6_addr ip6a_careof; /* care-of address of the peer */ struct in6_addr ip6a_home; /* home address of the peer */ u_int16_t ip6a_bruid; /* BR unique identifier */ - /* ip6.ip6_dst */ - struct in6_ifaddr *ip6a_dstia6; /* my ifaddr that matches ip6_dst */ - /* rtalert */ u_int16_t ip6a_rtalert; /* rtalert option value */ +#endif /* notyet */ - /* - * decapsulation history will be here. - * with IPsec it may not be accurate. - */ + /* ether source address if all-nodes multicast destination */ + u_char ip6a_ehsrc[ETHER_ADDR_LEN]; }; /* flags passed to ip6_output as last parameter */ @@ -356,8 +381,8 @@ struct ip6aux { #define IPV6_FLAG_NOSRCIFSEL 0x80 /* bypas source address selection */ #define IPV6_OUTARGS 0x100 /* has ancillary output info */ -#ifdef XNU_KERNEL_PRIVATE -#define IP6_HDR_ALIGNED_P(_ip6) ((((uintptr_t)(_ip6)) & ((uintptr_t)3)) == 0) +#ifdef BSD_KERNEL_PRIVATE +#define IP6_HDR_ALIGNED_P(_ip6) ((((uintptr_t)(_ip6)) & ((uintptr_t)3)) == 0) /* * On platforms which require strict alignment (currently for anything but @@ -374,7 +399,7 @@ struct ip6aux { } \ } while (0) #endif /* !__i386__ && !__x86_64__ */ -#endif /* XNU_KERNEL_PRIVATE */ +#endif /* BSD_KERNEL_PRIVATE */ #include @@ -389,141 +414,141 @@ struct ip6_out_args { #define IP6OAF_BOUND_IF 0x00000002 /* boundif value is valid */ #define IP6OAF_BOUND_SRCADDR 0x00000004 /* bound to src address */ #define IP6OAF_NO_CELLULAR 0x00000010 /* skip IFT_CELLULAR */ +#define IP6OAF_NO_EXPENSIVE 0x00000020 /* skip IFEF_EXPENSIVE */ +#define IP6OAF_AWDL_UNRESTRICTED 0x00000040 /* privileged AWDL */ +#define IP6OAF_QOSMARKING_ALLOWED 0x00000080 /* policy allows Fastlane DSCP marking */ +#define IP6OAF_INTCOPROC_ALLOWED 0x00000100 /* access to internal coproc interfaces */ + u_int32_t ip6oa_retflags; /* IP6OARF return flags (see below) */ +#define IP6OARF_IFDENIED 0x00000001 /* denied access to interface */ + int ip6oa_sotc; /* traffic class for Fastlane DSCP mapping */ + int ip6oa_netsvctype; }; -extern struct ip6stat ip6stat; /* statistics */ -extern u_int32_t ip6_id; /* fragment identifier */ -extern int ip6_defhlim; /* default hop limit */ -extern int ip6_defmcasthlim; /* default multicast hop limit */ -extern int ip6_forwarding; /* act as router? */ -extern int ip6_forward_srcrt; /* forward src-routed? */ -extern int ip6_gif_hlim; /* Hop limit for gif encap packet */ -extern int ip6_use_deprecated; /* allow deprecated addr as source */ -extern int ip6_rr_prune; /* router renumbering prefix - * walk list every 5 sec. */ -extern int ip6_mcast_pmtu; /* enable pMTU discovery for multicast? */ -#define ip6_mapped_addr_on (!ip6_v6only) -extern int ip6_v6only; - -extern int ip6_neighborgcthresh; /* Threshold # of NDP entries for GC */ -extern int ip6_maxifprefixes; /* Max acceptable prefixes via RA per IF */ -extern int ip6_maxifdefrouters; /* Max acceptable def routers via RA */ -extern int ip6_maxdynroutes; /* Max # of routes created via redirect */ -#if MROUTING -extern struct socket *ip6_mrouter; /* multicast routing daemon */ -#endif -extern int ip6_sendredirects; /* send IP redirects when forwarding? */ -extern int ip6_maxfragpackets; /* Maximum packets in reassembly queue */ -extern int ip6_maxfrags; /* Maximum fragments in reassembly queue */ -extern int ip6_sourcecheck; /* Verify source interface */ -extern int ip6_sourcecheck_interval; /* Interval between log messages */ -extern int ip6_accept_rtadv; /* deprecated */ -extern int ip6_log_interval; -extern time_t ip6_log_time; -extern int ip6_hdrnestlimit; /* upper limit of # of extension headers */ -extern int ip6_dad_count; /* DupAddrDetectionTransmits */ -extern int ip6_only_allow_rfc4193_prefix; /* RFC4193 Unique Local Unicast Prefixes only */ - -extern u_int32_t ip6_flow_seq; +extern struct ip6stat ip6stat; /* statistics */ +extern int ip6_defhlim; /* default hop limit */ +extern int ip6_defmcasthlim; /* default multicast hop limit */ +extern int ip6_forwarding; /* act as router? */ +extern int ip6_gif_hlim; /* Hop limit for gif encap packet */ +extern int ip6_use_deprecated; /* allow deprecated addr as source */ +extern int ip6_rr_prune; /* router renumbering prefix */ + /* walk list every 5 sec. */ +extern int ip6_mcast_pmtu; /* enable pMTU discovery for multicast? */ +#define ip6_mapped_addr_on (!ip6_v6only) +extern int ip6_v6only; + +extern int ip6_neighborgcthresh; /* Threshold # of NDP entries for GC */ +extern int ip6_maxifprefixes; /* Max acceptable prefixes via RA per IF */ +extern int ip6_maxifdefrouters; /* Max acceptable def routers via RA */ +extern int ip6_maxdynroutes; /* Max # of routes created via redirect */ +extern int ip6_sendredirects; /* send IP redirects when forwarding? */ +extern int ip6_accept_rtadv; /* deprecated */ +extern int ip6_log_interval; +extern uint64_t ip6_log_time; +extern int ip6_hdrnestlimit; /* upper limit of # of extension headers */ +extern int ip6_dad_count; /* DupAddrDetectionTransmits */ + +/* RFC4193 Unique Local Unicast Prefixes only */ +extern int ip6_only_allow_rfc4193_prefix; + extern int ip6_auto_flowlabel; extern int ip6_auto_linklocal; -extern int ip6_anonportmin; /* minimum ephemeral port */ -extern int ip6_anonportmax; /* maximum ephemeral port */ -extern int ip6_lowportmin; /* minimum reserved port */ -extern int ip6_lowportmax; /* maximum reserved port */ +extern int ip6_anonportmin; /* minimum ephemeral port */ +extern int ip6_anonportmax; /* maximum ephemeral port */ +extern int ip6_lowportmin; /* minimum reserved port */ +extern int ip6_lowportmax; /* maximum reserved port */ -extern int ip6_use_tempaddr; /* whether to use temporary addresses. */ -extern int ip6_prefer_tempaddr; /* whether to prefer temporary addresses - in the source address selection */ -extern int ip6_use_defzone; /* whether to use the default scope zone - when unspecified */ +extern int ip6_use_tempaddr; /* whether to use temporary addresses. */ -extern struct pr_usrreqs rip6_usrreqs; -extern struct pr_usrreqs icmp6_dgram_usrreqs; +/* whether to prefer temporary addresses in the source address selection */ +extern int ip6_prefer_tempaddr; -extern int ip6_doscopedroute; -extern int ip6_restrictrecvif; +/* whether to use the default scope zone when unspecified */ +extern int ip6_use_defzone; -struct sockopt; +extern struct pr_usrreqs rip6_usrreqs; +extern struct pr_usrreqs icmp6_dgram_usrreqs; +struct sockopt; struct inpcb; - -int icmp6_ctloutput(struct socket *, struct sockopt *); -int icmp6_dgram_ctloutput(struct socket *, struct sockopt *); -int icmp6_dgram_send(struct socket *, int , struct mbuf *, struct sockaddr *, struct mbuf *, struct proc *); -int icmp6_dgram_attach(struct socket *, int , struct proc *); - - struct in6_ifaddr; -void ip6_init(void); -void ip6_input(struct mbuf *); -struct in6_ifaddr *ip6_getdstifaddr(struct mbuf *); -void ip6_freepcbopts(struct ip6_pktopts *); -int ip6_unknown_opt(u_int8_t *, struct mbuf *, int); -char * ip6_get_prevhdr(struct mbuf *, int); -int ip6_nexthdr(struct mbuf *, int, int, int *); -int ip6_lasthdr(struct mbuf *, int, int, int *); +struct ip6protosw; +struct domain; + +extern int icmp6_ctloutput(struct socket *, struct sockopt *); +extern int icmp6_dgram_ctloutput(struct socket *, struct sockopt *); +extern int icmp6_dgram_send(struct socket *, int, struct mbuf *, + struct sockaddr *, struct mbuf *, struct proc *); +extern int icmp6_dgram_attach(struct socket *, int, struct proc *); + +extern void ip6_init(struct ip6protosw *, struct domain *); +extern void ip6_input(struct mbuf *); +extern void ip6_setsrcifaddr_info(struct mbuf *, uint32_t, struct in6_ifaddr *); +extern void ip6_setdstifaddr_info(struct mbuf *, uint32_t, struct in6_ifaddr *); +extern int ip6_getsrcifaddr_info(struct mbuf *, uint32_t *, uint32_t *); +extern int ip6_getdstifaddr_info(struct mbuf *, uint32_t *, uint32_t *); +extern void ip6_freepcbopts(struct ip6_pktopts *); +extern int ip6_unknown_opt(u_int8_t *, struct mbuf *, int); +extern char *ip6_get_prevhdr(struct mbuf *, int); +extern int ip6_nexthdr(struct mbuf *, int, int, int *); +extern int ip6_lasthdr(struct mbuf *, int, int, int *); extern void ip6_moptions_init(void); extern struct ip6_moptions *ip6_allocmoptions(int); extern void im6o_addref(struct ip6_moptions *, int); extern void im6o_remref(struct ip6_moptions *); -struct ip6aux *ip6_addaux(struct mbuf *); -struct ip6aux *ip6_findaux(struct mbuf *); -void ip6_delaux(struct mbuf *); -extern void ip6_destroyaux(struct ip6aux *); -extern void ip6_copyaux(struct ip6aux *, struct ip6aux *); - -int ip6_mforward(struct ip6_hdr *, struct ifnet *, struct mbuf *); -int ip6_process_hopopts(struct mbuf *, u_int8_t *, int, u_int32_t *, - u_int32_t *); -struct mbuf **ip6_savecontrol_v4(struct inpcb *, struct mbuf *, - struct mbuf **, int *); -int ip6_savecontrol(struct inpcb *, struct mbuf *, struct mbuf **); -struct mbuf *ip6_forward(struct mbuf *, struct route_in6 *, int); -void ip6_notify_pmtu __P((struct inpcb *, struct sockaddr_in6 *, - u_int32_t *)); -void ip6_mloopback(struct ifnet *, struct mbuf *, struct sockaddr_in6 *); -int ip6_output(struct mbuf *, struct ip6_pktopts *, struct route_in6 *, - int, struct ip6_moptions *, struct ifnet **, struct ip6_out_args *); -int ip6_output_list(struct mbuf *, int, struct ip6_pktopts *, - struct route_in6 *, int, struct ip6_moptions *, struct ifnet **, - struct ip6_out_args *); -int ip6_ctloutput(struct socket *, struct sockopt *sopt); -void ip6_initpktopts(struct ip6_pktopts *); -int ip6_setpktoptions(struct mbuf *, struct ip6_pktopts *, int, int); -void ip6_clearpktopts(struct ip6_pktopts *, int); -struct ip6_pktopts *ip6_copypktopts(struct ip6_pktopts *, int); -int ip6_optlen(struct inpcb *); - -int route6_input(struct mbuf **, int *, int); - -void frag6_init(void); -int frag6_input(struct mbuf **, int *, int); -void frag6_slowtimo(void); -void frag6_drain(void); - -int rip6_input(struct mbuf **, int *, int); -void rip6_ctlinput(int, struct sockaddr *, void *); -int rip6_ctloutput(struct socket *so, struct sockopt *sopt); -int rip6_output(struct mbuf *, struct socket *, struct sockaddr_in6 *, struct mbuf *, int); - -int dest6_input(struct mbuf **, int *, int); +extern struct ip6aux *ip6_addaux(struct mbuf *); +extern struct ip6aux *ip6_findaux(struct mbuf *); +extern void ip6_delaux(struct mbuf *); + +extern int ip6_process_hopopts(struct mbuf *, u_int8_t *, int, u_int32_t *, + u_int32_t *); +extern struct mbuf **ip6_savecontrol_v4(struct inpcb *, struct mbuf *, + struct mbuf **, int *); +extern int ip6_savecontrol(struct inpcb *, struct mbuf *, struct mbuf **); +extern struct mbuf *ip6_forward(struct mbuf *, struct route_in6 *, int); +extern void ip6_notify_pmtu(struct inpcb *, struct sockaddr_in6 *, u_int32_t *); +extern void ip6_mloopback(struct ifnet *, struct ifnet *, struct mbuf *, + struct sockaddr_in6 *, uint32_t, int32_t); +extern int ip6_output(struct mbuf *, struct ip6_pktopts *, struct route_in6 *, + int, struct ip6_moptions *, struct ifnet **, struct ip6_out_args *); +extern int ip6_output_list(struct mbuf *, int, struct ip6_pktopts *, + struct route_in6 *, int, struct ip6_moptions *, struct ifnet **, + struct ip6_out_args *); +extern int ip6_ctloutput(struct socket *, struct sockopt *); +extern int ip6_raw_ctloutput(struct socket *, struct sockopt *); +extern void ip6_initpktopts(struct ip6_pktopts *); +extern int ip6_setpktoptions(struct mbuf *, struct ip6_pktopts *, int, int); +extern void ip6_clearpktopts(struct ip6_pktopts *, int); +extern struct ip6_pktopts *ip6_copypktopts(struct ip6_pktopts *, int); +extern int ip6_optlen(struct inpcb *); +extern void ip6_drain(void); + +extern int route6_input(struct mbuf **, int *, int); + +extern void frag6_init(void); +extern int frag6_input(struct mbuf **, int *, int); +extern void frag6_drain(void); + +extern int rip6_input(struct mbuf **, int *, int); +extern void rip6_ctlinput(int, struct sockaddr *, void *); +extern int rip6_ctloutput(struct socket *so, struct sockopt *sopt); +extern int rip6_output(struct mbuf *, struct socket *, struct sockaddr_in6 *, + struct mbuf *, int); + +extern int dest6_input(struct mbuf **, int *, int); extern struct in6_addr *in6_selectsrc(struct sockaddr_in6 *, - struct ip6_pktopts *, struct inpcb *, struct route_in6 *, - struct ifnet **, struct in6_addr *, unsigned int, int *); -extern struct in6_addrpolicy * - in6_addrsel_lookup_policy(struct sockaddr_in6 *); -int in6_selectroute(struct sockaddr_in6 *, struct sockaddr_in6 *, - struct ip6_pktopts *, struct ip6_moptions *, struct route_in6 *, - struct ifnet **, struct rtentry **, int, const struct ip6_out_args *); -int ip6_setpktopts(struct mbuf *control, struct ip6_pktopts *opt, struct ip6_pktopts *stickyopt, int uproto); -u_int32_t ip6_randomid(void); -u_int32_t ip6_randomflowlabel(void); - -#endif /* KERNEL */ -#endif /* KERNEL_PRIVATE */ - + struct ip6_pktopts *, struct inpcb *, struct route_in6 *, + struct ifnet **, struct in6_addr *, unsigned int, int *); +extern struct in6_addrpolicy *in6_addrsel_lookup_policy(struct sockaddr_in6 *); +extern int in6_selectroute(struct sockaddr_in6 *, struct sockaddr_in6 *, + struct ip6_pktopts *, struct ip6_moptions *, struct in6_ifaddr **, + struct route_in6 *, struct ifnet **, struct rtentry **, int, + struct ip6_out_args *); +extern int ip6_setpktopts(struct mbuf *control, struct ip6_pktopts *opt, + struct ip6_pktopts *stickyopt, int uproto); +extern u_int32_t ip6_randomid(void); +extern u_int32_t ip6_randomflowlabel(void); +#endif /* BSD_KERNEL_PRIVATE */ #endif /* !_NETINET6_IP6_VAR_H_ */