X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/fe8ab488e9161c46dd9885d58fc52996dc0249ff..813fb2f63a553c957e917ede5f119b021d6ce391:/bsd/netinet/in_pcb.h diff --git a/bsd/netinet/in_pcb.h b/bsd/netinet/in_pcb.h index c86c03c6c..11ad54fe2 100644 --- a/bsd/netinet/in_pcb.h +++ b/bsd/netinet/in_pcb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2014 Apple Inc. All rights reserved. + * Copyright (c) 2000-2016 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -220,6 +220,11 @@ struct inpcb { } inp_necp_attributes; struct necp_inpcb_result inp_policyresult; #endif + u_char *inp_keepalive_data; /* for keepalive offload */ + u_int8_t inp_keepalive_datalen; /* keepalive data length */ + u_int8_t inp_keepalive_type; /* type of application */ + u_int16_t inp_keepalive_interval; /* keepalive interval */ + uint32_t inp_nstat_refcnt __attribute__((aligned(4))); struct inp_stat *inp_stat; struct inp_stat *inp_cstat; /* cellular data */ struct inp_stat *inp_wstat; /* Wi-Fi data */ @@ -228,7 +233,6 @@ struct inpcb { u_int8_t inp_cstat_store[sizeof (struct inp_stat) + sizeof (u_int64_t)]; u_int8_t inp_wstat_store[sizeof (struct inp_stat) + sizeof (u_int64_t)]; u_int8_t inp_Wstat_store[sizeof (struct inp_stat) + sizeof (u_int64_t)]; - uint32_t inp_nstat_refcnt __attribute__((aligned(4))); }; #define INP_ADD_STAT(_inp, _cnt_cellular, _cnt_wifi, _cnt_wired, _a, _n)\ @@ -494,6 +498,15 @@ struct xinpgen { #if IPSEC #define in6p_sp inp_sp #endif /* IPSEC */ +#define INP_INC_IFNET_STAT(_inp_, _stat_) { \ + if ((_inp_)->inp_last_outifp != NULL) { \ + if ((_inp_)->inp_vflag & INP_IPV6) { \ + (_inp_)->inp_last_outifp->if_ipv6_stat->_stat_++;\ + } else { \ + (_inp_)->inp_last_outifp->if_ipv4_stat->_stat_++;\ + }\ + }\ +} struct inpcbport { LIST_ENTRY(inpcbport) phd_hash; @@ -581,6 +594,9 @@ struct inpcbinfo { lck_attr_t *ipi_lock_attr; lck_grp_t *ipi_lock_grp; lck_grp_attr_t *ipi_lock_grp_attr; + +#define INPCBINFO_UPDATE_MSS 0x1 + u_int32_t ipi_flags; }; #define INP_PCBHASH(faddr, lport, fport, mask) \ @@ -602,6 +618,8 @@ struct inpcbinfo { ((_inp)->inp_flags2 & INP2_NO_IFF_EXPENSIVE) #define INP_AWDL_UNRESTRICTED(_inp) \ ((_inp)->inp_flags2 & INP2_AWDL_UNRESTRICTED) +#define INP_INTCOPROC_ALLOWED(_inp) \ + ((_inp)->inp_flags2 & INP2_INTCOPROC_ALLOWED) #endif /* BSD_KERNEL_PRIVATE */ @@ -645,6 +663,7 @@ struct inpcbinfo { #define IN6P_RTHDR 0x00100000 /* receive routing header */ #define IN6P_RTHDRDSTOPTS 0x00200000 /* receive dstoptions before rthdr */ #define IN6P_TCLASS 0x00400000 /* receive traffic class value */ +#define INP_RECVTOS IN6P_TCLASS /* receive incoming IP TOS */ #define IN6P_AUTOFLOWLABEL 0x00800000 /* attach flowlabel automatically */ #endif /* BSD_KERNEL_PRIVATE */ @@ -678,6 +697,8 @@ struct inpcbinfo { #define INP2_NO_IFF_EXPENSIVE 0x00000008 /* do not use expensive interface */ #define INP2_INHASHLIST 0x00000010 /* pcb is in inp_hash list */ #define INP2_AWDL_UNRESTRICTED 0x00000020 /* AWDL restricted mode allowed */ +#define INP2_KEEPALIVE_OFFLOAD 0x00000040 /* Enable UDP or TCP keepalive offload */ +#define INP2_INTCOPROC_ALLOWED 0x00000080 /* Allow communication via internal co-processor interfaces */ /* * Flags passed to in_pcblookup*() functions. @@ -734,7 +755,7 @@ extern void in_pcbdispose(struct inpcb *); extern void in_pcbdisconnect(struct inpcb *); extern int in_pcbinshash(struct inpcb *, int); extern int in_pcbladdr(struct inpcb *, struct sockaddr *, struct in_addr *, - unsigned int, struct ifnet **); + unsigned int, struct ifnet **, int); extern struct inpcb *in_pcblookup_local(struct inpcbinfo *, struct in_addr, u_int, int); extern struct inpcb *in_pcblookup_local_and_cleanup(struct inpcbinfo *, @@ -754,9 +775,14 @@ extern int in_pcb_checkstate(struct inpcb *, int, int); extern void in_pcbremlists(struct inpcb *); extern void inpcb_to_compat(struct inpcb *, struct inpcb_compat *); extern void inpcb_to_xinpcb64(struct inpcb *, struct xinpcb64 *); + extern int get_pcblist_n(short, struct sysctl_req *, struct inpcbinfo *); -#define INPCB_GET_PORTS_USED_WILDCARDOK 0x1 -#define INPCB_GET_PORTS_USED_NOWAKEUPOK 0x2 +#define INPCB_GET_PORTS_USED_WILDCARDOK 0x01 +#define INPCB_GET_PORTS_USED_NOWAKEUPOK 0x02 +#define INPCB_GET_PORTS_USED_RECVANYIFONLY 0x04 +#define INPCB_GET_PORTS_USED_EXTBGIDLEONLY 0x08 +#define INPCB_GET_PORTS_USED_ACTIVEONLY 0x10 + extern void inpcb_get_ports_used(u_int32_t, int, u_int32_t, bitstr_t *, struct inpcbinfo *); #define INPCB_OPPORTUNISTIC_THROTTLEON 0x0001 @@ -773,6 +799,9 @@ extern void inp_set_noexpensive(struct inpcb *); extern void inp_set_awdl_unrestricted(struct inpcb *); extern boolean_t inp_get_awdl_unrestricted(struct inpcb *); extern void inp_clear_awdl_unrestricted(struct inpcb *); +extern void inp_set_intcoproc_allowed(struct inpcb *); +extern boolean_t inp_get_intcoproc_allowed(struct inpcb *); +extern void inp_clear_intcoproc_allowed(struct inpcb *); #if NECP extern void inp_update_necp_policy(struct inpcb *, struct sockaddr *, struct sockaddr *, u_int); extern void inp_set_want_app_policy(struct inpcb *); @@ -789,6 +818,13 @@ extern void inp_get_soprocinfo(struct inpcb *, struct so_procinfo *); extern int inp_update_policy(struct inpcb *); extern boolean_t inp_restricted_recv(struct inpcb *, struct ifnet *); extern boolean_t inp_restricted_send(struct inpcb *, struct ifnet *); +extern void inp_incr_sndbytes_total(struct socket *, int); +extern void inp_decr_sndbytes_total(struct socket *, int); +extern void inp_count_sndbytes(struct inpcb *, u_int32_t); +extern void inp_incr_sndbytes_unsent(struct socket *, int32_t); +extern void inp_decr_sndbytes_unsent(struct socket *, int32_t); +extern int32_t inp_get_sndbytes_allunsent(struct socket *, u_int32_t); +extern void inp_decr_sndbytes_allunsent(struct socket *, u_int32_t); #endif /* BSD_KERNEL_PRIVATE */ #ifdef KERNEL_PRIVATE /* exported for PPP */