/*
- * Copyright (c) 2008-2015 Apple Inc. All rights reserved.
+ * Copyright (c) 2008-2017 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#endif /* PRIVATE */
#ifdef BSD_KERNEL_PRIVATE
+#include <net/if_llatbl.h>
+#include <sys/eventhandler.h>
+
/*
* IP6 route structure
*
* to a 'struct route *'.
*/
struct rtentry *ro_rt;
+ struct llentry *ro_lle;
+
struct ifaddr *ro_srcia;
uint32_t ro_flags; /* route flags */
struct sockaddr_in6 ro_dst;
struct mbuf;
struct ifnet;
struct in6_aliasreq;
+struct lltable;
+extern struct lltable * in6_lltattach(struct ifnet *ifp);
extern uint16_t in6_pseudo(const struct in6_addr *, const struct in6_addr *,
uint32_t);
extern u_int16_t inet6_cksum(struct mbuf *, uint32_t, uint32_t, uint32_t);
+extern u_int16_t inet6_cksum_buffer(const uint8_t *, uint32_t, uint32_t,
+ uint32_t);
-#define in6_cksum(_m, _n, _o, _l) \
+#define in6_cksum(_m, _n, _o, _l) \
inet6_cksum(_m, _n, _o, _l)
+#define in6_cksum_buffer(_b, _n, _o, _l) \
+ inet6_cksum_buffer(_b, _n, _o, _l)
extern int in6_addrscope(struct in6_addr *);
extern struct in6_ifaddr *in6_ifawithscope(struct ifnet *, struct in6_addr *);
((void) in6_finalize_cksum(_m, 0, 0, -1, CSUM_DELAY_IPV6_DATA))
#define in6_delayed_cksum_offset(_m, _o, _s, _p) \
((void) in6_finalize_cksum(_m, _o, _s, _p, CSUM_DELAY_IPV6_DATA))
+
+/* IPv6 protocol events */
+extern struct eventhandler_lists_ctxt in6_evhdlr_ctxt;
+
+/*
+ * XXX Avoid reordering the enum values below.
+ * If the order is changed, please make sure
+ * in6_event2kev_array is also changed to reflect the
+ * change in order of the enums
+ */
+typedef enum {
+ /* Address events */
+ /*
+ * XXX To avoid duplicacy and also for correctness
+ * only report these for link local and stable addresses
+ * NOTE: Link local address can never be marked detached
+ * or duplicated.
+ */
+ IN6_ADDR_MARKED_DUPLICATED,
+ IN6_ADDR_MARKED_DETACHED,
+ IN6_ADDR_MARKED_DEPRECATED,
+
+ /* Expiry events */
+ IN6_NDP_RTR_EXPIRY,
+ IN6_NDP_PFX_EXPIRY,
+ IN6_NDP_ADDR_EXPIRY,
+
+ /* XXX DNS expiry needs to be handled by user-space */
+ /* MAX */
+ IN6_EVENT_MAX,
+} in6_evhdlr_code_t;
+
+struct in6_event2kev {
+ in6_evhdlr_code_t in6_event_code;
+ uint32_t in6_event_kev_subclass;
+ uint32_t in6_event_kev_code;
+ const char *in6_event_str;
+};
+extern struct in6_event2kev in6_event2kev_array[];
+
+extern void in6_eventhdlr_callback(struct eventhandler_entry_arg, in6_evhdlr_code_t,
+ struct ifnet *, struct in6_addr *, uint32_t);
+extern void in6_event_enqueue_nwk_wq_entry(in6_evhdlr_code_t,
+ struct ifnet *, struct in6_addr *, uint32_t);
+
+typedef void (*in6_event_fn) (struct eventhandler_entry_arg, in6_evhdlr_code_t,
+ struct ifnet *, struct in6_addr *, uint32_t);
+EVENTHANDLER_DECLARE(in6_event, in6_event_fn);
#endif /* BSD_KERNEL_PRIVATE */
#ifdef KERNEL_PRIVATE