#include <netinet/tcp_private.h>

netinet/tcp_private.h Kernel.framework

54 macros · 8 structs · 5 typedefs · 2 enums

macroTCP_INFO

#define TCP_INFO 0x200
retrieve tcp_info structure

macroTCP_MEASURE_SND_BW

#define TCP_MEASURE_SND_BW 0x202
Measure sender's bandwidth for this connection

macroTCP_MEASURE_BW_BURST

#define TCP_MEASURE_BW_BURST 0x203
Burst size to use for bandwidth measurement

macroTCP_PEER_PID

#define TCP_PEER_PID 0x204
Lookup pid of the process we're connected to

macroTCP_ADAPTIVE_READ_TIMEOUT

#define TCP_ADAPTIVE_READ_TIMEOUT 0x205
Read timeout used as a multiple of RTT

macroTCP_OPTION_UNUSED_0

#define TCP_OPTION_UNUSED_0 0x206
UNUSED

macroTCP_ADAPTIVE_WRITE_TIMEOUT

#define TCP_ADAPTIVE_WRITE_TIMEOUT 0x207
Write timeout used as a multiple of RTT

macroTCP_NOTIMEWAIT

#define TCP_NOTIMEWAIT 0x208
Avoid going into time-wait

macroTCP_DISABLE_BLACKHOLE_DETECTION

#define TCP_DISABLE_BLACKHOLE_DETECTION 0x209
disable PMTU blackhole detection

macroTCP_ECN_MODE

#define TCP_ECN_MODE 0x210
fine grain control for A/B testing

macroTCP_KEEPALIVE_OFFLOAD

#define TCP_KEEPALIVE_OFFLOAD 0x211
offload keep alive processing to firmware

macroECN_MODE_DEFAULT

#define ECN_MODE_DEFAULT 0x0
per interface or system wide default

macroECN_MODE_ENABLE

#define ECN_MODE_ENABLE 0x1
force enable ECN on connection

macroECN_MODE_DISABLE

#define ECN_MODE_DISABLE 0x2
force disable ECN on connection

macroTCP_MAX_NOTIFY_ACK

#define TCP_MAX_NOTIFY_ACK 10

typedeftcp_notify_ack_id_t

typedef u_int32_t tcp_notify_ack_id_t

structtcp_notify_ack_complete

size 48, align 4
u_int32_tnotify_pendingstill pending
u_int32_tnotify_complete_count
tcp_notify_ack_id_t[10]notify_complete_id

macroTCP_NOTIFY_ACKNOWLEDGEMENT

#define TCP_NOTIFY_ACKNOWLEDGEMENT 0x212
Notify when data is acknowledged

macroMPTCP_SERVICE_TYPE

#define MPTCP_SERVICE_TYPE 0x213
MPTCP Service type

macroMPTCP_SVCTYPE_HANDOVER

#define MPTCP_SVCTYPE_HANDOVER 0
Default 0

macroMPTCP_SVCTYPE_INTERACTIVE

#define MPTCP_SVCTYPE_INTERACTIVE 1

macroMPTCP_SVCTYPE_AGGREGATE

#define MPTCP_SVCTYPE_AGGREGATE 2

macroMPTCP_SVCTYPE_TARGET_BASED

#define MPTCP_SVCTYPE_TARGET_BASED 3

macroMPTCP_SVCTYPE_PURE_HANDOVER

#define MPTCP_SVCTYPE_PURE_HANDOVER 4

macroMPTCP_SVCTYPE_MAX

#define MPTCP_SVCTYPE_MAX 5

macroTCP_RXT_MINIMUM_TIMEOUT

Specify minimum time in seconds before which an established TCP connection will not be dropped when there is no response from the peer
#define TCP_RXT_MINIMUM_TIMEOUT 0x215

macroTCP_RXT_MINIMUM_TIMEOUT_LIMIT

#define TCP_RXT_MINIMUM_TIMEOUT_LIMIT (5 * 60)
Limit is 5 minutes

macroMPTCP_ALTERNATE_PORT

#define MPTCP_ALTERNATE_PORT 0x216

macroMPTCP_FORCE_ENABLE

#define MPTCP_FORCE_ENABLE 0x217

macroTCP_FASTOPEN_FORCE_ENABLE

#define TCP_FASTOPEN_FORCE_ENABLE 0x218

macroMPTCP_EXPECTED_PROGRESS_TARGET

#define MPTCP_EXPECTED_PROGRESS_TARGET 0x219

macroMPTCP_FORCE_VERSION

#define MPTCP_FORCE_VERSION 0x21a

macroTCP_ENABLE_L4S

#define TCP_ENABLE_L4S 0x21b
Enable or disable L4S

macroTCPI_OPT_TIMESTAMPS

#define TCPI_OPT_TIMESTAMPS 0x01

macroTCPI_OPT_SACK

#define TCPI_OPT_SACK 0x02

macroTCPI_OPT_WSCALE

#define TCPI_OPT_WSCALE 0x04

macroTCPI_OPT_ECN

#define TCPI_OPT_ECN 0x08

macroTCPI_FLAG_LOSSRECOVERY

#define TCPI_FLAG_LOSSRECOVERY 0x01
Currently in loss recovery

macroTCPI_FLAG_STREAMING_ON

#define TCPI_FLAG_STREAMING_ON 0x02
Streaming detection on - remove when uTCP stops using it

structtcp_conn_status

size 4, align 4

macroTCPINFO_HAS_L4S_

#define TCPINFO_HAS_L4S_ 1

enumtcp_connection_client_accurate_ecn_state_t

underlying type unsigned int
tcp_connection_client_accurate_ecn_invalid0
tcp_connection_client_accurate_ecn_feature_disabled1
tcp_connection_client_accurate_ecn_feature_enabled2
tcp_connection_client_classic_ecn_available3
tcp_connection_client_ecn_not_available4
tcp_connection_client_accurate_ecn_negotiation_blackholed5
tcp_connection_client_accurate_ecn_ace_bleaching_detected6
tcp_connection_client_accurate_ecn_negotiation_success7
tcp_connection_client_accurate_ecn_negotiation_success_ect_mangling_detected8
tcp_connection_client_accurate_ecn_negotiation_success_ect_bleaching_detected9

typedeftcp_connection_client_accurate_ecn_state_t

typedef enum tcp_connection_client_accurate_ecn_state_t tcp_connection_client_accurate_ecn_state_t;

enumtcp_connection_server_accurate_ecn_state_t

underlying type unsigned int
tcp_connection_server_accurate_ecn_invalid0
tcp_connection_server_accurate_ecn_feature_disabled1
tcp_connection_server_accurate_ecn_feature_enabled2
tcp_connection_server_no_ecn_requested3
tcp_connection_server_classic_ecn_requested4
tcp_connection_server_accurate_ecn_requested5
tcp_connection_server_accurate_ecn_negotiation_blackholed6
tcp_connection_server_accurate_ecn_ace_bleaching_detected7
tcp_connection_server_accurate_ecn_negotiation_success8
tcp_connection_server_accurate_ecn_negotiation_success_ect_mangling_detected9
tcp_connection_server_accurate_ecn_negotiation_success_ect_bleaching_detected10

typedeftcp_connection_server_accurate_ecn_state_t

typedef enum tcp_connection_server_accurate_ecn_state_t tcp_connection_server_accurate_ecn_state_t;

structtcp_info

Add new fields to this structure at the end only. This will preserve binary compatibility.
size 424, align 4
u_int8_ttcpi_stateTCP FSM state.
u_int8_ttcpi_optionsOptions enabled on conn.
u_int8_ttcpi_snd_wscaleRFC1323 send shift value.
u_int8_ttcpi_rcv_wscaleRFC1323 recv shift value.
u_int32_ttcpi_flagsextra flags (TCPI_FLAG_xxx)
u_int32_ttcpi_rtoRetransmission timeout in milliseconds
u_int32_ttcpi_snd_mssMax segment size for send.
u_int32_ttcpi_rcv_mssMax segment size for receive.
u_int32_ttcpi_rttcurMost recent value of RTT
u_int32_ttcpi_srttSender's Smoothed RTT
u_int32_ttcpi_rttvarRTT variance
u_int32_ttcpi_rttbestBest RTT we've seen
u_int32_ttcpi_snd_ssthreshSlow start threshold.
u_int32_ttcpi_snd_cwndSend congestion window.
u_int32_ttcpi_rcv_spaceAdvertised recv window.
u_int32_ttcpi_snd_wndAdvertised send window.
u_int32_ttcpi_snd_nxtNext egress seqno
u_int32_ttcpi_rcv_nxtNext ingress seqno
int32_ttcpi_last_outifif_index of interface used to send last
u_int32_ttcpi_snd_sbbytesbytes in snd buffer including data inflight
u_int64_ttcpi_txpacketstotal packets sent
u_int64_ttcpi_txbytes
u_int64_ttcpi_txretransmitbytestotal bytes sent
u_int64_ttcpi_txunackedtotal bytes retransmitted
u_int64_ttcpi_rxpacketscurrent number of bytes not acknowledged total packets received
u_int64_ttcpi_rxbytes
u_int64_ttcpi_rxduplicatebytestotal bytes received
u_int64_ttcpi_rxoutoforderbytestotal duplicate bytes received
u_int64_ttcpi_snd_bwtotal out of order bytes received measured send bandwidth in bits/sec
u_int8_ttcpi_synrexmitsNumber of syn retransmits before connect
u_int8_ttcpi_unused1
u_int16_ttcpi_unused2
u_int64_ttcpi_cell_rxpacketspackets received over cellular
u_int64_ttcpi_cell_rxbytesbytes received over cellular
u_int64_ttcpi_cell_txpacketspackets transmitted over cellular
u_int64_ttcpi_cell_txbytesbytes transmitted over cellular
u_int64_ttcpi_wifi_rxpacketspackets received over Wi-Fi
u_int64_ttcpi_wifi_rxbytesbytes received over Wi-Fi
u_int64_ttcpi_wifi_txpacketspackets transmitted over Wi-Fi
u_int64_ttcpi_wifi_txbytesbytes transmitted over Wi-Fi
u_int64_ttcpi_wired_rxpacketspackets received over Wired
u_int64_ttcpi_wired_rxbytesbytes received over Wired
u_int64_ttcpi_wired_txpacketspackets transmitted over Wired
u_int64_ttcpi_wired_txbytesbytes transmitted over Wired
struct tcp_conn_statustcpi_connstatusstatus of connection probes
u_int16_t:1tcpi_tfo_cookie_reqCookie requested?
u_int16_t:1tcpi_tfo_cookie_rcvCookie received?
u_int16_t:1tcpi_tfo_syn_lossFallback to reg. TCP after SYN-loss
u_int16_t:1tcpi_tfo_syn_data_sentSYN+data has been sent out
u_int16_t:1tcpi_tfo_syn_data_ackedSYN+data has been fully acknowledged
u_int16_t:1tcpi_tfo_syn_data_rcvServer received SYN+data with a valid cookie
u_int16_t:1tcpi_tfo_cookie_req_rcvServer received cookie-request
u_int16_t:1tcpi_tfo_cookie_sentServer announced cookie
u_int16_t:1tcpi_tfo_cookie_invalidServer received an invalid cookie
u_int16_t:1tcpi_tfo_cookie_wrongOur sent cookie was wrong
u_int16_t:1tcpi_tfo_no_cookie_rcvWe did not receive a cookie upon our request
u_int16_t:1tcpi_tfo_heuristics_disableTFO-heuristics disabled it
u_int16_t:1tcpi_tfo_send_blackholeA sending-blackhole got detected
u_int16_t:1tcpi_tfo_recv_blackholeA receiver-blackhole got detected
u_int16_t:1tcpi_tfo_onebyte_proxyA proxy acknowledges all but one byte of the SYN
u_int16_t:1tcpi_ecn_client_setupAttempted ECN setup from client side
u_int16_t:1tcpi_ecn_server_setupAttempted ECN setup from server side
u_int16_t:1tcpi_ecn_successpeer negotiated ECN
u_int16_t:1tcpi_ecn_lost_synLost SYN with ECN setup
u_int16_t:1tcpi_ecn_lost_synackLost SYN-ACK with ECN setup
u_int16_t:1tcpi_local_peerLocal to the host or the subnet
u_int16_t:1tcpi_if_cellInterface is cellular
u_int16_t:1tcpi_if_wifiInterface is WiFi
u_int16_t:1tcpi_if_wiredInterface is wired - ethernet , thunderbolt etc,.
u_int16_t:1tcpi_if_wifi_infraInterface is wifi infrastructure
u_int16_t:1tcpi_if_wifi_awdlInterface is wifi AWDL
u_int16_t:1tcpi_snd_backgroundUsing delay based algorithm on sender side
u_int16_t:1tcpi_rcv_backgroundUsing delay based algorithm on receive side
u_int16_t:1tcpi_l4s_enabledWhether L4S is enabled or not
u_int32_ttcpi_ecn_recv_cePackets received with CE
u_int32_ttcpi_ecn_recv_cwrPackets received with CWR
u_int32_ttcpi_rcvoopackout-of-order packets received
u_int32_ttcpi_pawsdropsegments dropped due to PAWS
u_int32_ttcpi_sack_recovery_episodeSACK recovery episodes
u_int32_ttcpi_reordered_pktspackets reorderd
u_int32_ttcpi_dsack_sentSent DSACK notification
u_int32_ttcpi_dsack_recvdReceived a valid DSACK option
u_int32_ttcpi_flowhashUnique id for the connection
u_int64_ttcpi_txretransmitpackets
uint32_ttcpi_rcv_srttReceiver's Smoothed RTT
uint32_ttcpi_client_accecn_stateClient's Accurate ECN state
uint32_ttcpi_server_accecn_stateServer's Accurate ECN state as seen by clent
uint64_ttcpi_ecn_capable_packets_sentPackets sent with ECT
uint64_ttcpi_ecn_capable_packets_ackedPackets sent with ECT that were ACKed
uint64_ttcpi_ecn_capable_packets_markedPackets sent with ECT that were marked, same as delivered_ce_packets
uint64_ttcpi_ecn_capable_packets_lostPackets sent with ECT that were lost
uint64_ttcpi_received_ce_packets
uint64_ttcpi_received_ect0_bytes
uint64_ttcpi_received_ect1_bytes
uint64_ttcpi_received_ce_bytes
uint64_ttcpi_delivered_ect0_bytes
uint64_ttcpi_delivered_ect1_bytes
uint64_ttcpi_delivered_ce_bytes
uint64_ttcpi_flow_control_total_time
uint64_ttcpi_rcvwnd_limited_total_time
uint64_ttcpi_pacing_rate
uint64_ttcpi_max_pacing_rate

macroTCPINFO_HAS_L4S_STATE

#define TCPINFO_HAS_L4S_STATE 1

macroTCPINFO_HAS_L4S

#define TCPINFO_HAS_L4S 1

macroTCPINFO_HAS_LIMITED_TIME

#define TCPINFO_HAS_LIMITED_TIME 1

macroTCPINFO_HAS_PACING_RATE

#define TCPINFO_HAS_PACING_RATE 1

structtcp_measure_bw_burst

size 8, align 4
u_int32_tmin_burst_sizeMinimum number of packets to use
u_int32_tmax_burst_sizeMaximum number of packets to use

structinfo_tuple

size 60, align 4
u_int8_titpl_proto
unnamed union at Kernel/netinet/tcp_private.h:349:2itpl_localaddr
struct sockaddr_itpl_sa
struct __sockaddr_header_itpl_sah
struct sockaddr_in_itpl_sin
struct sockaddr_in6_itpl_sin6
unnamed union at Kernel/netinet/tcp_private.h:357:2itpl_remoteaddr
struct sockaddr_itpl_sa
struct __sockaddr_header_itpl_sah
struct sockaddr_in_itpl_sin
struct sockaddr_in6_itpl_sin6

macroitpl_local_sa

#define itpl_local_sa itpl_localaddr._itpl_sa

macroitpl_remote_sa

#define itpl_remote_sa itpl_remoteaddr._itpl_sa

macroitpl_local_sah

#define itpl_local_sah itpl_localaddr._itpl_sah

macroitpl_local_sin

#define itpl_local_sin itpl_localaddr._itpl_sin

macroitpl_local_sin6

#define itpl_local_sin6 itpl_localaddr._itpl_sin6

macroitpl_remote_sah

#define itpl_remote_sah itpl_remoteaddr._itpl_sah

macroitpl_remote_sin

#define itpl_remote_sin itpl_remoteaddr._itpl_sin

macroitpl_remote_sin6

#define itpl_remote_sin6 itpl_remoteaddr._itpl_sin6

structconninfo_tcp

TCP connection info auxiliary data (CIAUX_TCP) Do not add new fields to this structure, just add them to tcp_info structure towards the end. This will preserve binary compatibility.
size 424, align 4
struct tcp_infotcpci_tcp_infoTCP info

typedefconninfo_tcp_t

typedef struct conninfo_tcp conninfo_tcp_t;

macroNET_INET_TCP_INFO_ENTITLEMENT

Entitlement for the syctl "net.inet.tcp.info"
#define NET_INET_TCP_INFO_ENTITLEMENT "com.apple.private.network.tcp.info"

structmptcp_itf_stats

size 72, align 8
u_shortifindex
uint16_tswitches
uint32_t:1is_expensive
uint64_tmpis_txbytes
uint64_tmpis_rxbytes
uint64_tmpis_wifi_txbytes
uint64_tmpis_wifi_rxbytes
uint64_tmpis_wired_txbytes
uint64_tmpis_wired_rxbytes
uint64_tmpis_cell_txbytes
uint64_tmpis_cell_rxbytes

macroCONNINFO_MPTCP_VERSION

Version solely used to let libnetcore survive
#define CONNINFO_MPTCP_VERSION 3

structconninfo_multipathtcp

size 336, align 8
uint32_tmptcpci_subflow_count
uint32_tmptcpci_switch_count
sae_connid_t[4]mptcpci_subflow_connids
uint64_tmptcpci_init_rxbytes
uint64_tmptcpci_init_txbytes
struct mptcp_itf_stats[4]mptcpci_itfstats
uint32_tmptcpci_flags

typedefconninfo_multipathtcp_t

typedef struct conninfo_multipathtcp conninfo_multipathtcp_t;

macroMPTCP_ITFSTATS_SIZE

#define MPTCP_ITFSTATS_SIZE 4

macroMPTCPCI_FIRSTPARTY

#define MPTCPCI_FIRSTPARTY 0x01