#include <netinet/tcp_private.h>
netinet/tcp_private.h
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_ADAPTIVE_READ_TIMEOUT
#define TCP_ADAPTIVE_READ_TIMEOUT 0x205
Read timeout used as a multiple of RTT
macroTCP_ADAPTIVE_WRITE_TIMEOUT
#define TCP_ADAPTIVE_WRITE_TIMEOUT 0x207
Write timeout used as a multiple of RTT
macroTCP_DISABLE_BLACKHOLE_DETECTION
#define TCP_DISABLE_BLACKHOLE_DETECTION 0x209
disable PMTU blackhole detection
macroTCP_KEEPALIVE_OFFLOAD
#define TCP_KEEPALIVE_OFFLOAD 0x211
offload keep alive processing to firmware
macroECN_MODE_DEFAULT
TCP_ECN_MODE values
#define ECN_MODE_DEFAULT 0x0
per interface or system wide default
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
| u_int32_t | notify_pending | still pending |
| u_int32_t | notify_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_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
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
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_STREAMING_ON
#define TCPI_FLAG_STREAMING_ON 0x02
Streaming detection on - remove when uTCP stops using it
structtcp_conn_status
macroTCPINFO_HAS_L4S_
#define TCPINFO_HAS_L4S_ 1
enumtcp_connection_client_accurate_ecn_state_t
| tcp_connection_client_accurate_ecn_invalid | 0 | |
| tcp_connection_client_accurate_ecn_feature_disabled | 1 | |
| tcp_connection_client_accurate_ecn_feature_enabled | 2 | |
| tcp_connection_client_classic_ecn_available | 3 | |
| tcp_connection_client_ecn_not_available | 4 | |
| tcp_connection_client_accurate_ecn_negotiation_blackholed | 5 | |
| tcp_connection_client_accurate_ecn_ace_bleaching_detected | 6 | |
| tcp_connection_client_accurate_ecn_negotiation_success | 7 | |
| tcp_connection_client_accurate_ecn_negotiation_success_ect_mangling_detected | 8 | |
| tcp_connection_client_accurate_ecn_negotiation_success_ect_bleaching_detected | 9 |
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
| tcp_connection_server_accurate_ecn_invalid | 0 | |
| tcp_connection_server_accurate_ecn_feature_disabled | 1 | |
| tcp_connection_server_accurate_ecn_feature_enabled | 2 | |
| tcp_connection_server_no_ecn_requested | 3 | |
| tcp_connection_server_classic_ecn_requested | 4 | |
| tcp_connection_server_accurate_ecn_requested | 5 | |
| tcp_connection_server_accurate_ecn_negotiation_blackholed | 6 | |
| tcp_connection_server_accurate_ecn_ace_bleaching_detected | 7 | |
| tcp_connection_server_accurate_ecn_negotiation_success | 8 | |
| tcp_connection_server_accurate_ecn_negotiation_success_ect_mangling_detected | 9 | |
| tcp_connection_server_accurate_ecn_negotiation_success_ect_bleaching_detected | 10 |
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.
| u_int8_t | tcpi_state | TCP FSM state. |
| u_int8_t | tcpi_options | Options enabled on conn. |
| u_int8_t | tcpi_snd_wscale | RFC1323 send shift value. |
| u_int8_t | tcpi_rcv_wscale | RFC1323 recv shift value. |
| u_int32_t | tcpi_flags | extra flags (TCPI_FLAG_xxx) |
| u_int32_t | tcpi_rto | Retransmission timeout in milliseconds |
| u_int32_t | tcpi_snd_mss | Max segment size for send. |
| u_int32_t | tcpi_rcv_mss | Max segment size for receive. |
| u_int32_t | tcpi_rttcur | Most recent value of RTT |
| u_int32_t | tcpi_srtt | Sender's Smoothed RTT |
| u_int32_t | tcpi_rttvar | RTT variance |
| u_int32_t | tcpi_rttbest | Best RTT we've seen |
| u_int32_t | tcpi_snd_ssthresh | Slow start threshold. |
| u_int32_t | tcpi_snd_cwnd | Send congestion window. |
| u_int32_t | tcpi_rcv_space | Advertised recv window. |
| u_int32_t | tcpi_snd_wnd | Advertised send window. |
| u_int32_t | tcpi_snd_nxt | Next egress seqno |
| u_int32_t | tcpi_rcv_nxt | Next ingress seqno |
| int32_t | tcpi_last_outif | if_index of interface used to send last |
| u_int32_t | tcpi_snd_sbbytes | bytes in snd buffer including data inflight |
| u_int64_t | tcpi_txpackets | total packets sent |
| u_int64_t | tcpi_txbytes | |
| u_int64_t | tcpi_txretransmitbytes | total bytes sent |
| u_int64_t | tcpi_txunacked | total bytes retransmitted |
| u_int64_t | tcpi_rxpackets | current number of bytes not acknowledged total packets received |
| u_int64_t | tcpi_rxbytes | |
| u_int64_t | tcpi_rxduplicatebytes | total bytes received |
| u_int64_t | tcpi_rxoutoforderbytes | total duplicate bytes received |
| u_int64_t | tcpi_snd_bw | total out of order bytes received measured send bandwidth in bits/sec |
| u_int8_t | tcpi_synrexmits | Number of syn retransmits before connect |
| u_int8_t | tcpi_unused1 | |
| u_int16_t | tcpi_unused2 | |
| u_int64_t | tcpi_cell_rxpackets | packets received over cellular |
| u_int64_t | tcpi_cell_rxbytes | bytes received over cellular |
| u_int64_t | tcpi_cell_txpackets | packets transmitted over cellular |
| u_int64_t | tcpi_cell_txbytes | bytes transmitted over cellular |
| u_int64_t | tcpi_wifi_rxpackets | packets received over Wi-Fi |
| u_int64_t | tcpi_wifi_rxbytes | bytes received over Wi-Fi |
| u_int64_t | tcpi_wifi_txpackets | packets transmitted over Wi-Fi |
| u_int64_t | tcpi_wifi_txbytes | bytes transmitted over Wi-Fi |
| u_int64_t | tcpi_wired_rxpackets | packets received over Wired |
| u_int64_t | tcpi_wired_rxbytes | bytes received over Wired |
| u_int64_t | tcpi_wired_txpackets | packets transmitted over Wired |
| u_int64_t | tcpi_wired_txbytes | bytes transmitted over Wired |
| struct tcp_conn_status | tcpi_connstatus | status of connection probes |
| u_int16_t:1 | tcpi_tfo_cookie_req | Cookie requested? |
| u_int16_t:1 | tcpi_tfo_cookie_rcv | Cookie received? |
| u_int16_t:1 | tcpi_tfo_syn_loss | Fallback to reg. TCP after SYN-loss |
| u_int16_t:1 | tcpi_tfo_syn_data_sent | SYN+data has been sent out |
| u_int16_t:1 | tcpi_tfo_syn_data_acked | SYN+data has been fully acknowledged |
| u_int16_t:1 | tcpi_tfo_syn_data_rcv | Server received SYN+data with a valid cookie |
| u_int16_t:1 | tcpi_tfo_cookie_req_rcv | Server received cookie-request |
| u_int16_t:1 | tcpi_tfo_cookie_sent | Server announced cookie |
| u_int16_t:1 | tcpi_tfo_cookie_invalid | Server received an invalid cookie |
| u_int16_t:1 | tcpi_tfo_cookie_wrong | Our sent cookie was wrong |
| u_int16_t:1 | tcpi_tfo_no_cookie_rcv | We did not receive a cookie upon our request |
| u_int16_t:1 | tcpi_tfo_heuristics_disable | TFO-heuristics disabled it |
| u_int16_t:1 | tcpi_tfo_send_blackhole | A sending-blackhole got detected |
| u_int16_t:1 | tcpi_tfo_recv_blackhole | A receiver-blackhole got detected |
| u_int16_t:1 | tcpi_tfo_onebyte_proxy | A proxy acknowledges all but one byte of the SYN |
| u_int16_t:1 | tcpi_ecn_client_setup | Attempted ECN setup from client side |
| u_int16_t:1 | tcpi_ecn_server_setup | Attempted ECN setup from server side |
| u_int16_t:1 | tcpi_ecn_success | peer negotiated ECN |
| u_int16_t:1 | tcpi_ecn_lost_syn | Lost SYN with ECN setup |
| u_int16_t:1 | tcpi_ecn_lost_synack | Lost SYN-ACK with ECN setup |
| u_int16_t:1 | tcpi_local_peer | Local to the host or the subnet |
| u_int16_t:1 | tcpi_if_cell | Interface is cellular |
| u_int16_t:1 | tcpi_if_wifi | Interface is WiFi |
| u_int16_t:1 | tcpi_if_wired | Interface is wired - ethernet , thunderbolt etc,. |
| u_int16_t:1 | tcpi_if_wifi_infra | Interface is wifi infrastructure |
| u_int16_t:1 | tcpi_if_wifi_awdl | Interface is wifi AWDL |
| u_int16_t:1 | tcpi_snd_background | Using delay based algorithm on sender side |
| u_int16_t:1 | tcpi_rcv_background | Using delay based algorithm on receive side |
| u_int16_t:1 | tcpi_l4s_enabled | Whether L4S is enabled or not |
| u_int32_t | tcpi_ecn_recv_ce | Packets received with CE |
| u_int32_t | tcpi_ecn_recv_cwr | Packets received with CWR |
| u_int32_t | tcpi_rcvoopack | out-of-order packets received |
| u_int32_t | tcpi_pawsdrop | segments dropped due to PAWS |
| u_int32_t | tcpi_sack_recovery_episode | SACK recovery episodes |
| u_int32_t | tcpi_reordered_pkts | packets reorderd |
| u_int32_t | tcpi_dsack_sent | Sent DSACK notification |
| u_int32_t | tcpi_dsack_recvd | Received a valid DSACK option |
| u_int32_t | tcpi_flowhash | Unique id for the connection |
| u_int64_t | tcpi_txretransmitpackets | |
| uint32_t | tcpi_rcv_srtt | Receiver's Smoothed RTT |
| uint32_t | tcpi_client_accecn_state | Client's Accurate ECN state |
| uint32_t | tcpi_server_accecn_state | Server's Accurate ECN state as seen by clent |
| uint64_t | tcpi_ecn_capable_packets_sent | Packets sent with ECT |
| uint64_t | tcpi_ecn_capable_packets_acked | Packets sent with ECT that were ACKed |
| uint64_t | tcpi_ecn_capable_packets_marked | Packets sent with ECT that were marked, same as delivered_ce_packets |
| uint64_t | tcpi_ecn_capable_packets_lost | Packets sent with ECT that were lost |
| uint64_t | tcpi_received_ce_packets | |
| uint64_t | tcpi_received_ect0_bytes | |
| uint64_t | tcpi_received_ect1_bytes | |
| uint64_t | tcpi_received_ce_bytes | |
| uint64_t | tcpi_delivered_ect0_bytes | |
| uint64_t | tcpi_delivered_ect1_bytes | |
| uint64_t | tcpi_delivered_ce_bytes | |
| uint64_t | tcpi_flow_control_total_time | |
| uint64_t | tcpi_rcvwnd_limited_total_time | |
| uint64_t | tcpi_pacing_rate | |
| uint64_t | tcpi_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
| u_int32_t | min_burst_size | Minimum number of packets to use |
| u_int32_t | max_burst_size | Maximum number of packets to use |
structinfo_tuple
| u_int8_t | itpl_proto | |||||||||||||
| unnamed union at Kernel/netinet/tcp_private.h:349:2 | itpl_localaddr | |||||||||||||
| ||||||||||||||
| unnamed union at Kernel/netinet/tcp_private.h:357:2 | itpl_remoteaddr | |||||||||||||
| ||||||||||||||
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.
| struct tcp_info | tcpci_tcp_info | TCP 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
| u_short | ifindex | |
| uint16_t | switches | |
| uint32_t:1 | is_expensive | |
| uint64_t | mpis_txbytes | |
| uint64_t | mpis_rxbytes | |
| uint64_t | mpis_wifi_txbytes | |
| uint64_t | mpis_wifi_rxbytes | |
| uint64_t | mpis_wired_txbytes | |
| uint64_t | mpis_wired_rxbytes | |
| uint64_t | mpis_cell_txbytes | |
| uint64_t | mpis_cell_rxbytes |
macroCONNINFO_MPTCP_VERSION
Version solely used to let libnetcore survive
#define CONNINFO_MPTCP_VERSION 3
structconninfo_multipathtcp
| uint32_t | mptcpci_subflow_count | |
| uint32_t | mptcpci_switch_count | |
| sae_connid_t[4] | mptcpci_subflow_connids | |
| uint64_t | mptcpci_init_rxbytes | |
| uint64_t | mptcpci_init_txbytes | |
| struct mptcp_itf_stats[4] | mptcpci_itfstats | |
| uint32_t | mptcpci_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