-#define IN6_NEXT_MULTI(step, in6m) \
-/* struct in6_multistep step; */ \
-/* struct in6_multi *in6m; */ \
-do { \
- if (((in6m) = (step).i_in6m) != NULL) \
- (step).i_in6m = (step).i_in6m->in6m_entry.le_next; \
-} while(0)
-
-#define IN6_FIRST_MULTI(step, in6m) \
-/* struct in6_multistep step; */ \
-/* struct in6_multi *in6m */ \
-do { \
- (step).i_in6m = in6_multihead.lh_first; \
- IN6_NEXT_MULTI((step), (in6m)); \
-} while(0)
-
-struct in6_multi *in6_addmulti __P((struct in6_addr *, struct ifnet *,
- int *, int));
-void in6_delmulti __P((struct in6_multi *, int));
-extern int in6_ifindex2scopeid __P((int));
-extern int in6_mask2len __P((struct in6_addr *, u_char *));
-extern void in6_len2mask __P((struct in6_addr *, int));
-int in6_control __P((struct socket *,
- u_long, caddr_t, struct ifnet *, struct proc *));
-int in6_update_ifa __P((struct ifnet *, struct in6_aliasreq *,
- struct in6_ifaddr *));
-void in6_purgeaddr __P((struct ifaddr *, int));
-int in6if_do_dad __P((struct ifnet *));
-void in6_purgeif __P((struct ifnet *));
-void in6_savemkludge __P((struct in6_ifaddr *));
-void in6_setmaxmtu __P((void));
-void in6_restoremkludge __P((struct in6_ifaddr *, struct ifnet *));
-void in6_purgemkludge __P((struct ifnet *));
-struct in6_ifaddr *in6ifa_ifpforlinklocal __P((struct ifnet *, int));
-struct in6_ifaddr *in6ifa_ifpwithaddr __P((struct ifnet *,
- struct in6_addr *));
-char *ip6_sprintf __P((const struct in6_addr *));
-int in6_addr2scopeid __P((struct ifnet *, struct in6_addr *));
-int in6_matchlen __P((struct in6_addr *, struct in6_addr *));
-int in6_are_prefix_equal __P((struct in6_addr *p1, struct in6_addr *p2,
- int len));
-void in6_prefixlen2mask __P((struct in6_addr *maskp, int len));
-int in6_prefix_ioctl __P((struct socket *so, u_long cmd, caddr_t data,
- struct ifnet *ifp));
-int in6_prefix_add_ifid __P((int iilen, struct in6_ifaddr *ia));
-void in6_prefix_remove_ifid __P((int iilen, struct in6_ifaddr *ia));
-void in6_purgeprefix __P((struct ifnet *));
-
-int in6_is_addr_deprecated __P((struct sockaddr_in6 *));
-struct inpcb;
-int in6_embedscope __P((struct in6_addr *, const struct sockaddr_in6 *,
- struct inpcb *, struct ifnet **));
-int in6_recoverscope __P((struct sockaddr_in6 *, const struct in6_addr *,
- struct ifnet *));
-void in6_clearscope __P((struct in6_addr *));
-#endif KERNEL_PRIVATE
-
-#endif _NETINET6_IN6_VAR_H_
+#define IN6_NEXT_MULTI(step, in6m) \
+ /* struct in6_multistep step; */ \
+ /* struct in6_multi *in6m; */ \
+do { \
+ in6_multihead_lock_assert(LCK_RW_ASSERT_HELD); \
+ if (((in6m) = (step).i_in6m) != NULL) \
+ (step).i_in6m = (step).i_in6m->in6m_entry.le_next; \
+} while (0)
+
+#define IN6_FIRST_MULTI(step, in6m) \
+ /* struct in6_multistep step; */ \
+ /* struct in6_multi *in6m */ \
+do { \
+ in6_multihead_lock_assert(LCK_RW_ASSERT_HELD); \
+ (step).i_in6m = in6_multihead.lh_first; \
+ IN6_NEXT_MULTI((step), (in6m)); \
+} while (0)
+
+extern lck_mtx_t *inet6_domain_mutex;
+extern struct domain *inet6domain;
+
+struct ip6_pktopts;
+
+/* Multicast private KPIs. */
+extern int im6o_mc_filter(const struct ip6_moptions *, const struct ifnet *,
+ const struct sockaddr_in6 *, const struct sockaddr_in6 *);
+extern int in6_mc_join(struct ifnet *, const struct in6_addr *,
+ struct in6_mfilter *, struct in6_multi **, int);
+extern int in6_mc_leave(struct in6_multi *, struct in6_mfilter *);
+extern void in6m_clear_recorded(struct in6_multi *);
+extern void in6m_commit(struct in6_multi *);
+extern void in6m_purge(struct in6_multi *);
+extern void in6m_print(const struct in6_multi *);
+extern int in6m_record_source(struct in6_multi *, const struct in6_addr *);
+extern int ip6_getmoptions(struct inpcb *, struct sockopt *);
+extern int ip6_setmoptions(struct inpcb *, struct sockopt *);
+/* Legacy KAME multicast private KPIs. */
+extern struct in6_multi_mship *in6_joingroup(struct ifnet *,
+ struct in6_addr *, int *, int);
+extern int in6_leavegroup(struct in6_multi_mship *);
+extern void in6_multi_init(void);
+extern void in6m_addref(struct in6_multi *, int);
+extern void in6m_remref(struct in6_multi *, int);
+extern int in6_multi_detach(struct in6_multi *);
+extern int in6_ifindex2scopeid(int);
+extern int in6_mask2len(struct in6_addr *, u_char *);
+extern void in6_len2mask(struct in6_addr *, int);
+extern int in6_control(struct socket *, u_long, caddr_t, struct ifnet *,
+ struct proc *);
+extern int in6_update_ifa(struct ifnet *, struct in6_aliasreq *, int,
+ struct in6_ifaddr **);
+extern void in6_purgeaddr(struct ifaddr *);
+extern int in6if_do_dad(struct ifnet *);
+extern void in6_purgeif(struct ifnet *);
+extern void in6_savemkludge(struct in6_ifaddr *);
+extern void in6_setmaxmtu(void);
+extern void in6_restoremkludge(struct in6_ifaddr *, struct ifnet *);
+extern void in6_purgemkludge(struct ifnet *);
+extern struct in6_ifaddr *in6ifa_ifpforlinklocal(struct ifnet *, int);
+extern struct in6_ifaddr *in6ifa_ifpwithaddr(struct ifnet *, struct in6_addr *);
+extern struct in6_ifaddr *in6ifa_prproxyaddr(struct in6_addr *);
+extern void in6ifa_getlifetime(struct in6_ifaddr *,
+ struct in6_addrlifetime *, int);
+extern void in6ifa_setlifetime(struct in6_ifaddr *, struct in6_addrlifetime *);
+extern char *ip6_sprintf(const struct in6_addr *);
+extern int in6_addr2scopeid(struct ifnet *, struct in6_addr *);
+extern int in6_matchlen(struct in6_addr *, struct in6_addr *);
+extern int in6_are_prefix_equal(struct in6_addr *p1, struct in6_addr *p2,
+ int len);
+extern void in6_prefixlen2mask(struct in6_addr *maskp, int len);
+extern int in6_prefix_add_ifid(int iilen, struct in6_ifaddr *ia);
+extern void in6_prefix_remove_ifid(int iilen, struct in6_ifaddr *ia);
+extern void in6_purgeprefix(struct ifnet *);
+extern void in6_purgeaddrs(struct ifnet *);
+extern uint8_t im6s_get_mode(const struct in6_multi *,
+ const struct ip6_msource *, uint8_t);
+extern void im6f_leave(struct in6_mfilter *);
+extern void im6f_purge(struct in6_mfilter *);
+extern int in6_embedscope(struct in6_addr *, const struct sockaddr_in6 *,
+ struct inpcb *, struct ifnet **, struct ip6_pktopts *);
+extern int in6_recoverscope(struct sockaddr_in6 *, const struct in6_addr *,
+ struct ifnet *);
+extern void in6_aliasreq_64_to_32(struct in6_aliasreq_64 *,
+ struct in6_aliasreq_32 *);
+extern void in6_aliasreq_32_to_64(struct in6_aliasreq_32 *,
+ struct in6_aliasreq_64 *);
+extern void in6_ifaddr_init(void);
+extern int in6_inithead(void **, int);
+extern void in6_rtqdrain(void);
+extern struct radix_node *in6_validate(struct radix_node *);
+extern int in6_if2idlen(struct ifnet *);
+extern int in6_src_ioctl(u_long, caddr_t);
+extern void in6_multihead_lock_exclusive(void);
+extern void in6_multihead_lock_shared(void);
+extern void in6_multihead_lock_assert(int);
+extern void in6_multihead_lock_done(void);
+
+extern void in6_cga_init(void);
+extern void in6_cga_node_lock(void);
+extern void in6_cga_node_unlock(void);
+extern void in6_cga_query(struct in6_cga_nodecfg *);
+extern int in6_cga_start(const struct in6_cga_nodecfg *);
+extern int in6_cga_stop(void);
+extern ssize_t in6_cga_parameters_prepare(void *, size_t,
+ const struct in6_addr *, u_int8_t, const struct in6_cga_modifier *);
+extern int in6_cga_generate(struct in6_cga_prepare *, u_int8_t,
+ struct in6_addr *);
+extern int in6_getconninfo(struct socket *, sae_connid_t, uint32_t *,
+ uint32_t *, int32_t *, user_addr_t, socklen_t *,
+ user_addr_t, socklen_t *, uint32_t *, user_addr_t, uint32_t *);
+extern void in6_ip6_to_sockaddr(const struct in6_addr *ip6, u_int16_t port,
+ struct sockaddr_in6 *sin6, u_int32_t maxlen);
+
+#endif /* BSD_KERNEL_PRIVATE */
+#endif /* _NETINET6_IN6_VAR_H_ */