X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/813fb2f63a553c957e917ede5f119b021d6ce391..a39ff7e25e19b3a8c3020042a3872ca9ec9659f1:/bsd/netinet/in.h diff --git a/bsd/netinet/in.h b/bsd/netinet/in.h index 74918ba34..07732679a 100644 --- a/bsd/netinet/in.h +++ b/bsd/netinet/in.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2013 Apple Inc. All rights reserved. + * Copyright (c) 2000-2017 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -162,9 +162,9 @@ #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 */ @@ -364,10 +364,19 @@ struct in_addr { (((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) */ @@ -851,17 +860,31 @@ extern boolean_t in_broadcast(struct in_addr, struct ifnet *); 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) \