/*
- * Copyright (c) 2000-2013 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2017 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#define IPPROTO_SWIPE 53 /* IP with encryption */
#define IPPROTO_NHRP 54 /* Next Hop Resolution */
/* 55-57: Unassigned */
-#define IPPROTO_ICMPV6 58 /* ICMP6 */
-#define IPPROTO_NONE 59 /* IP6 no next header */
-#define IPPROTO_DSTOPTS 60 /* IP6 destination option */
+#define IPPROTO_ICMPV6 58 /* ICMP6 */
+#define IPPROTO_NONE 59 /* IP6 no next header */
+#define IPPROTO_DSTOPTS 60 /* IP6 destination option */
#define IPPROTO_AHIP 61 /* any host internal protocol */
#define IPPROTO_CFTP 62 /* CFTP */
#define IPPROTO_HELLO 63 /* "hello" routing protocol */
(((u_int32_t)(i) & 0xfff00000) == 0xac100000) || \
(((u_int32_t)(i) & 0xffff0000) == 0xc0a80000))
+#ifdef PRIVATE
+#define IN_SHARED_ADDRESS_SPACE(i) ((((u_int32_t)(i)) & (u_int32_t)0xffc00000) \
+ == (u_int32_t)0x64400000)
+
+#define IN_DS_LITE(i) ((((u_int32_t)(i)) & (u_int32_t)0xfffffff8) == (u_int32_t)0xc0000000)
+
+#define IN_6TO4_RELAY_ANYCAST(i) ((((u_int32_t)(i)) & (u_int32_t)IN_CLASSC_NET) == (u_int32_t)0xc0586300)
+#endif
+
#define IN_LOCAL_GROUP(i) (((u_int32_t)(i) & 0xffffff00) == 0xe0000000)
-
+
#define IN_ANY_LOCAL(i) (IN_LINKLOCAL(i) || IN_LOCAL_GROUP(i))
-#endif
+#endif /* __APPLE__ */
#define IN_LOOPBACKNET 127 /* official! */
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
#define IP_BOUND_IF 25 /* int; set/get bound interface */
#define IP_PKTINFO 26 /* get pktinfo on recv socket, set src on sent dgram */
#define IP_RECVPKTINFO IP_PKTINFO /* receive pktinfo w/dgram */
-
+#define IP_RECVTOS 27 /* bool; receive IP TOS w/dgram */
#define IP_FW_ADD 40 /* add a firewall rule to chain */
#define IP_FW_DEL 41 /* delete a firewall rule from chain */
extern boolean_t in_canforward(struct in_addr);
extern u_int32_t in_netof(struct in_addr);
+extern uint32_t os_cpu_in_cksum_mbuf(struct mbuf *m, int len, int off,
+ uint32_t initial_sum);
+
extern uint16_t inet_cksum(struct mbuf *, uint32_t, uint32_t, uint32_t);
+extern uint16_t inet_cksum_buffer(const void *, uint32_t, uint32_t, uint32_t);
extern uint16_t in_addword(uint16_t, uint16_t);
extern uint16_t in_pseudo(uint32_t, uint32_t, uint32_t);
extern uint16_t in_pseudo64(uint64_t, uint64_t, uint64_t);
extern uint16_t in_cksum_hdr_opt(const struct ip *);
extern uint16_t ip_cksum_hdr_dir(struct mbuf *, uint32_t, int);
+extern uint16_t ip_cksum_hdr_dir_buffer(const void *, uint32_t, uint32_t, int);
extern uint32_t in_finalize_cksum(struct mbuf *, uint32_t, uint32_t);
extern uint16_t b_sum16(const void *buf, int len);
+#if DEBUG || DEVELOPMENT
+extern uint32_t in_cksum_mbuf_ref(struct mbuf *, int, int, uint32_t);
+#endif /* DEBUG || DEVELOPMENT */
+
+extern int in_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 *);
#define in_cksum(_m, _l) \
inet_cksum(_m, 0, 0, _l)
+#define in_cksum_buffer(_b, _l) \
+ inet_cksum_buffer(_b, 0, 0, _l)
#define ip_cksum_hdr_in(_m, _l) \
ip_cksum_hdr_dir(_m, _l, 0)
#define ip_cksum_hdr_out(_m, _l) \