#include <net/if_var_private.h>
net/if_var_private.h Kernel.framework 52 macros · 17 structs · 1 enum · 1 typedef
size 160, align 8
u_int64_t ifi_ibepackets TC_BE packets received on interface u_int64_t ifi_ibebytes TC_BE bytes received on interface u_int64_t ifi_obepackets TC_BE packet sent on interface u_int64_t ifi_obebytes TC_BE bytes sent on interface u_int64_t ifi_ibkpackets TC_BK packets received on interface u_int64_t ifi_ibkbytes TC_BK bytes received on interface u_int64_t ifi_obkpackets TC_BK packet sent on interface u_int64_t ifi_obkbytes TC_BK bytes sent on interface u_int64_t ifi_ivipackets TC_VI packets received on interface u_int64_t ifi_ivibytes TC_VI bytes received on interface u_int64_t ifi_ovipackets TC_VI packets sent on interface u_int64_t ifi_ovibytes TC_VI bytes sent on interface u_int64_t ifi_ivopackets TC_VO packets received on interface u_int64_t ifi_ivobytes TC_VO bytes received on interface u_int64_t ifi_ovopackets TC_VO packets sent on interface u_int64_t ifi_ovobytes TC_VO bytes sent on interface u_int64_t ifi_ipvpackets TC priv packets received on interface u_int64_t ifi_ipvbytes TC priv bytes received on interface u_int64_t ifi_opvpackets TC priv packets sent on interface u_int64_t ifi_opvbytes TC priv bytes sent on interface
Structure to report link heuristics
size 144, align 8
u_int64_t iflh_link_heuristics_cnt Count of congested link indications u_int64_t iflh_link_heuristics_time Duration of congested link indications (msec) u_int64_t iflh_congested_link_cnt Count of congested link indications u_int64_t iflh_congested_link_time Duration of congested link indications (msec) u_int64_t iflh_lqm_good_cnt Count of LQM good u_int64_t iflh_lqm_good_time Duration of LQM good (msec) u_int64_t iflh_lqm_poor_cnt Count of LQM poor u_int64_t iflh_lqm_poor_time Duration of LQM poor (msec) u_int64_t iflh_lqm_min_viable_cnt Count of LQM minimally viable u_int64_t iflh_lqm_min_viable_time Duration of LQM minimally viable (msec) u_int64_t iflh_lqm_bad_cnt Count of LQM bad u_int64_t iflh_lqm_bad_time Duration of LQM bad (msec) u_int64_t iflh_tcp_linkheur_stealthdrop u_int64_t iflh_tcp_linkheur_noackpri u_int64_t iflh_tcp_linkheur_comprxmt u_int64_t iflh_tcp_linkheur_synrxmt u_int64_t iflh_tcp_linkheur_rxmtfloor u_int64_t iflh_udp_linkheur_stealthdrop
Structure to report LPW (Low Power Wake) statistics
#define HAS_IF_LPW_STATS 1 size 32, align 8
u_int64_t iflpw_ipackets packets received in LPW mode u_int64_t iflpw_opackets packets sent in LPW mode u_int64_t iflpw_magic_pkt_checked Count of packet_has_magic_pattern invocations u_int64_t iflpw_magic_pkt_found Count of magic packets found
size 16, align 8
uint64_t eff_bw effective bandwidth uint64_t max_bw maximum theoretical bandwidth
underlying type unsigned int
IF_NETEM_MODEL_NULL 0 IF_NETEM_MODEL_NLC 1
typedef enum if_netem_model_t if_netem_model_t; #define IF_NETEM_PARAMS_PSCALE 100000 size 72, align 8
if_netem_model_t ifnetem_model packet scheduler model uint64_t ifnetem_bandwidth_bps bandwidth limit uint32_t ifnetem_latency_ms latency (normal distribution with jitter as stdev) uint32_t ifnetem_jitter_ms uint32_t ifnetem_corruption_p NetEm probabilistic model parameters has a scaling factor of 100,000
for 5 digits precision. For instance, probability 12.345% is
expressed as uint32_t fixed point 12345 in ifnet_*_p variable below.
random packet corruption uint32_t ifnetem_duplication_p random packet duplication uint32_t ifnetem_loss_p_gr_gl 4 state Markov loss model P( gap_loss | gap_rx ) uint32_t ifnetem_loss_p_gr_bl P( burst_loss | gap_rx ) uint32_t ifnetem_loss_p_bl_br P( burst_rx | burst_loss ) uint32_t ifnetem_loss_p_bl_gr P( gap_rx | burst_loss ) uint32_t ifnetem_loss_p_br_bl P( burst_loss | burst_rx ) uint32_t ifnetem_loss_recovery_ms time to recovery loss uint32_t ifnetem_reordering_p random packet reordering reorder probability uint32_t ifnetem_reordering_ms reorder delay in ms uint32_t ifnetem_output_ival_ms NetEm output scheduler by default is waken up upon input event as
well as timer interval to avoid excessive delay. If
ifnetem_output_ival is set to non-zero value, it overrides the
default output interval as well as disables output scheduler wakeup
upon input events. output interval
size 104, align 8
u_int32_t ifi_poll_off_req total # of POLL_OFF reqs u_int32_t ifi_poll_off_err total # of POLL_OFF errors u_int32_t ifi_poll_on_req total # of POLL_ON reqs u_int32_t ifi_poll_on_err total # of POLL_ON errors u_int32_t ifi_poll_wakeups_avg avg # of wakeup reqs u_int32_t ifi_poll_wakeups_lowat wakeups low watermark u_int32_t ifi_poll_wakeups_hiwat wakeups high watermark u_int64_t ifi_poll_packets total # of polled packets u_int32_t ifi_poll_packets_avg average polled packets u_int32_t ifi_poll_packets_min smallest polled packets u_int32_t ifi_poll_packets_max largest polled packets u_int32_t ifi_poll_packets_lowat packets low watermark u_int32_t ifi_poll_packets_hiwat packets high watermark u_int64_t ifi_poll_bytes total # of polled bytes u_int32_t ifi_poll_bytes_avg average polled bytes u_int32_t ifi_poll_bytes_min smallest polled bytes u_int32_t ifi_poll_bytes_max largest polled bytes u_int32_t ifi_poll_bytes_lowat bytes low watermark u_int32_t ifi_poll_bytes_hiwat bytes high watermark u_int32_t ifi_poll_packets_limit max packets per poll call u_int64_t ifi_poll_interval_time poll interval (nsec)
size 64, align 8
u_int64_t ifn_rx_mit_interval rx mitigation ival (nsec) u_int32_t ifn_rx_mit_mode 0: static, 1: dynamic u_int32_t ifn_rx_mit_packets_avg average # of packets u_int32_t ifn_rx_mit_packets_min smallest # of packets u_int32_t ifn_rx_mit_packets_max largest # of packets u_int32_t ifn_rx_mit_bytes_avg average # of bytes u_int32_t ifn_rx_mit_bytes_min smallest # of bytes u_int32_t ifn_rx_mit_bytes_max largest # of bytes u_int32_t ifn_rx_mit_cfg_idx current config selector u_int32_t ifn_rx_mit_cfg_packets_lowat pkts low watermark u_int32_t ifn_rx_mit_cfg_packets_hiwat pkts high watermark u_int32_t ifn_rx_mit_cfg_bytes_lowat bytes low watermark u_int32_t ifn_rx_mit_cfg_bytes_hiwat bytes high watermark u_int32_t ifn_rx_mit_cfg_interval delay interval (nsec)
size 128, align 8
u_int64_t lim_dl_max_bandwidth bits per second u_int64_t lim_ul_max_bandwidth bits per second u_int64_t lim_total_txpkts Total transmit packets, count u_int64_t lim_total_rxpkts Total receive packets, count u_int64_t lim_total_retxpkts Total retransmit packets u_int64_t lim_packet_loss_percent Packet loss rate u_int64_t lim_total_oopkts Total out-of-order packets u_int64_t lim_packet_ooo_percent Out-of-order packet rate u_int64_t lim_rtt_variance RTT variance, milliseconds u_int64_t lim_rtt_average RTT average, milliseconds u_int64_t lim_rtt_min RTT minimum, milliseconds u_int64_t lim_conn_timeouts connection timeouts u_int64_t lim_conn_attempts connection attempts u_int64_t lim_conn_timeout_percent Rate of connection timeouts u_int64_t lim_bk_txpkts Transmit packets with BK service class, that use delay based algorithms u_int64_t :1lim_dl_detected Low internet u_int64_t :1lim_ul_detected
#define IF_VAR_H_HAS_IFNET_STATS_PER_FLOW 1 #define IF_VAR_H_HAS_IFNET_STATS_PER_FLOW_LINKHEUR 1 size 4, align 1
u_int8_t valid_bitmask The bitmask tells which of the fields
to consider:
- When setting, to control which fields
are being modified;
- When getting, it tells which fields are set. u_int8_t rrc_state Valid only for cellular interface int8_t lqm_state Values normalized to the edge of the following values
that are defined on <net/if.h>:
IFNET_LQM_THRESH_BAD
IFNET_LQM_THRESH_POOR
IFNET_LQM_THRESH_GOOD u_int8_t interface_availability Indicate if the underlying link is currently
available
#define IF_INTERFACE_STATE_RRC_STATE_VALID 0x1 #define IF_INTERFACE_STATE_LQM_STATE_VALID 0x2 #define IF_INTERFACE_STATE_INTERFACE_AVAILABILITY_VALID 0x4 #define IF_INTERFACE_STATE_RRC_STATE_IDLE 0x0 #define IF_INTERFACE_STATE_RRC_STATE_CONNECTED 0x1 #define IF_INTERFACE_STATE_INTERFACE_AVAILABLE 0x0 #define IF_INTERFACE_STATE_INTERFACE_UNAVAILABLE 0x1 size 40, align 8
uint64_t cls_one uint64_t cls_two uint64_t cls_three uint64_t cls_four uint64_t cls_five_or_more
#define if_typelen if_data .ifi_typelen #define if_physical if_data .ifi_physical #define if_addrlen if_data .ifi_addrlen #define if_hdrlen if_data .ifi_hdrlen #define if_metric if_data .ifi_metric #define if_baudrate if_data .ifi_baudrate #define if_hwassist if_data .ifi_hwassist #define if_ipackets if_data .ifi_ipackets #define if_ierrors if_data .ifi_ierrors #define if_opackets if_data .ifi_opackets #define if_oerrors if_data .ifi_oerrors #define if_collisions if_data .ifi_collisions #define if_ibytes if_data .ifi_ibytes #define if_obytes if_data .ifi_obytes #define if_imcasts if_data .ifi_imcasts #define if_omcasts if_data .ifi_omcasts #define if_iqdrops if_data .ifi_iqdrops #define if_noproto if_data .ifi_noproto #define if_lastchange if_data .ifi_lastchange #define if_recvquota if_data .ifi_recvquota #define if_xmitquota if_data .ifi_xmitquota All of the following IF_HWASSIST_* flags are defined in kpi_interface.h as
IFNET_* flags. These are redefined here as constants to avoid failures to
build user level programs that can not include kpi_interface.h. It is
important to keep this in sync with the definitions in kpi_interface.h.
The corresponding constant for each definition is mentioned in the comment.
Bottom 16 bits reserved for hardware checksum
#define IF_HWASSIST_CSUM_IP 0x0001 #define IF_HWASSIST_CSUM_TCP 0x0002 #define IF_HWASSIST_CSUM_UDP 0x0004 #define IF_HWASSIST_CSUM_IP_FRAGS 0x0008 #define IF_HWASSIST_CSUM_FRAGMENT 0x0010 #define IF_HWASSIST_CSUM_TCPIPV6 0x0020 #define IF_HWASSIST_CSUM_UDPIPV6 0x0040 #define IF_HWASSIST_CSUM_FRAGMENT_IPV6 0x0080 #define IF_HWASSIST_CSUM_PARTIAL 0x1000 simple Sum16 computation, IFNET_CSUM_PARTIAL
#define IF_HWASSIST_CSUM_ZERO_INVERT 0x2000 capable of inverting csum of 0 to -0 (0xffff)
#define IF_HWASSIST_CSUM_MASK 0xffff VLAN support
#define IF_HWASSIST_VLAN_TAGGING 0x00010000 #define IF_HWASSIST_VLAN_MTU 0x00020000 #define IF_HWASSIST_TSO_V4 0x00200000 #define IF_HWASSIST_TSO_V6 0x00400000 #define IFXNAMSIZ (IFNAMSIZ + 8) external name (name + unit)
#define IFNET_NETWORK_ID_LEN 32 Generated 2026-09-08 from the headers of one specific machine (macOS 26.4.1, SDK 26.4, arm64) — not official documentation. About & caveats