#include <net/if_var_status.h>
net/if_var_status.h 71 macros · 16 structs · 7 enums · 1 union · 1 typedef
Interface link status report -- includes statistics related to
the link layer technology sent by the driver. The driver will monitor
these statistics over an interval (3-4 secs) and will generate a report
to the network stack. This will give first-hand information about the
status of the first hop of the network path. The version and
length values should be correct for the data to be processed correctly.
The definitions are different for different kind of interfaces like
Wifi, Cellular etc,.
#define IF_CELLULAR_STATUS_REPORT_VERSION_1 1 #define IF_WIFI_STATUS_REPORT_VERSION_1 1 For cellular interface --
There is no way to share common headers between the Baseband and
the kernel. Any changes to this structure will need to be communicated
to the Baseband team. It is better to use reserved space instead of
changing the size or existing fields in the structure.
size 104, align 1 · packed
u_int32_t valid_bitmask indicates which fields are valid u_int32_t link_quality_metric u_int32_t ul_effective_bandwidth Measured uplink bandwidth based on current activity (bps) u_int32_t ul_max_bandwidth Maximum supported uplink bandwidth (bps) u_int32_t ul_min_latency min expected uplink latency for first hop (ms) u_int32_t ul_effective_latency current expected uplink latency for first hop (ms) u_int32_t ul_max_latency max expected uplink latency first hop (ms) u_int32_t ul_retxt_level Retransmission metric u_int32_t ul_bytes_lost % of total bytes lost on uplink in Q10 format u_int32_t ul_min_queue_size minimum bytes in queue u_int32_t ul_avg_queue_size average bytes in queue u_int32_t ul_max_queue_size maximum bytes in queue u_int32_t dl_effective_bandwidth Measured downlink bandwidth based on current activity (bps) u_int32_t dl_max_bandwidth Maximum supported downlink bandwidth (bps) u_int32_t config_inactivity_time ms u_int32_t config_backoff_time new connections backoff time in ms u_int16_t mss_recommended u_int16_t reserved_1 u_int32_t reserved_2 u_int64_t reserved_3 u_int64_t reserved_4 u_int64_t reserved_5 u_int64_t reserved_6
#define IF_CELL_LINK_QUALITY_METRIC_VALID 0x1 #define IF_CELL_UL_EFFECTIVE_BANDWIDTH_VALID 0x2 #define IF_CELL_UL_MAX_BANDWIDTH_VALID 0x4 #define IF_CELL_UL_MIN_LATENCY_VALID 0x8 #define IF_CELL_UL_EFFECTIVE_LATENCY_VALID 0x10 #define IF_CELL_UL_MAX_LATENCY_VALID 0x20 #define IF_CELL_UL_RETXT_LEVEL_VALID 0x40 #define IF_CELL_UL_BYTES_LOST_VALID 0x80 #define IF_CELL_UL_MIN_QUEUE_SIZE_VALID 0x100 #define IF_CELL_UL_AVG_QUEUE_SIZE_VALID 0x200 #define IF_CELL_UL_MAX_QUEUE_SIZE_VALID 0x400 #define IF_CELL_DL_EFFECTIVE_BANDWIDTH_VALID 0x800 #define IF_CELL_DL_MAX_BANDWIDTH_VALID 0x1000 #define IF_CELL_CONFIG_INACTIVITY_TIME_VALID 0x2000 #define IF_CELL_CONFIG_BACKOFF_TIME_VALID 0x4000 #define IF_CELL_UL_MSS_RECOMMENDED_VALID 0x8000 #define IF_CELL_UL_RETXT_LEVEL_NONE 1 #define IF_CELL_UL_RETXT_LEVEL_LOW 2 #define IF_CELL_UL_RETXT_LEVEL_MEDIUM 3 #define IF_CELL_UL_RETXT_LEVEL_HIGH 4 #define IF_CELL_UL_MSS_RECOMMENDED_NONE 0x0 Use default
#define IF_CELL_UL_MSS_RECOMMENDED_MEDIUM 0x1 1200 byte MSS
#define IF_CELL_UL_MSS_RECOMMENDED_LOW 0x2 512 byte MSS
size 104, align 1
unnamed union at net/if_var_status.h:146:2 if_cell_u
size 112, align 1 · packed
u_int32_t valid_bitmask u_int32_t link_quality_metric link quality metric u_int32_t ul_effective_bandwidth Measured uplink bandwidth based on current activity (bps) u_int32_t ul_max_bandwidth Maximum supported uplink bandwidth (bps) u_int32_t ul_min_latency min expected uplink latency for first hop (ms) u_int32_t ul_effective_latency current expected uplink latency for first hop (ms) u_int32_t ul_max_latency max expected uplink latency for first hop (ms) u_int32_t ul_retxt_level Retransmission metric u_int32_t ul_bytes_lost % of total bytes lost on uplink in Q10 format u_int32_t ul_error_rate % of bytes dropped on uplink after many retransmissions in Q10 format u_int32_t dl_effective_bandwidth Measured downlink bandwidth based on current activity (bps) u_int32_t dl_max_bandwidth Maximum supported downlink bandwidth (bps) u_int32_t dl_min_latency The download latency values indicate the time AP may have to wait for the
driver to receive the packet. These values give the range of expected latency
mainly due to co-existence events and channel hopping where the interface
becomes unavailable. min expected latency for first hop in ms u_int32_t dl_effective_latency current expected latency for first hop in ms u_int32_t dl_max_latency max expected latency for first hop in ms u_int32_t dl_error_rate % of CRC or other errors in Q10 format u_int32_t config_frequency 2.4 or 5 GHz u_int32_t config_multicast_rate bps u_int32_t scan_count scan count during the previous period u_int32_t scan_duration scan duration in ms u_int64_t reserved_1 u_int64_t reserved_2 u_int64_t reserved_3 u_int64_t reserved_4
#define IF_WIFI_LINK_QUALITY_METRIC_VALID 0x1 #define IF_WIFI_UL_EFFECTIVE_BANDWIDTH_VALID 0x2 #define IF_WIFI_UL_MAX_BANDWIDTH_VALID 0x4 #define IF_WIFI_UL_MIN_LATENCY_VALID 0x8 #define IF_WIFI_UL_EFFECTIVE_LATENCY_VALID 0x10 #define IF_WIFI_UL_MAX_LATENCY_VALID 0x20 #define IF_WIFI_UL_RETXT_LEVEL_VALID 0x40 #define IF_WIFI_UL_ERROR_RATE_VALID 0x80 #define IF_WIFI_UL_BYTES_LOST_VALID 0x100 #define IF_WIFI_DL_EFFECTIVE_BANDWIDTH_VALID 0x200 #define IF_WIFI_DL_MAX_BANDWIDTH_VALID 0x400 #define IF_WIFI_DL_MIN_LATENCY_VALID 0x800 #define IF_WIFI_DL_EFFECTIVE_LATENCY_VALID 0x1000 #define IF_WIFI_DL_MAX_LATENCY_VALID 0x2000 #define IF_WIFI_DL_ERROR_RATE_VALID 0x4000 #define IF_WIFI_CONFIG_FREQUENCY_VALID 0x8000 #define IF_WIFI_CONFIG_MULTICAST_RATE_VALID 0x10000 #define IF_WIFI_CONFIG_SCAN_COUNT_VALID 0x20000 #define IF_WIFI_CONFIG_SCAN_DURATION_VALID 0x40000 #define IF_WIFI_UL_RETXT_LEVEL_NONE 1 #define IF_WIFI_UL_RETXT_LEVEL_LOW 2 #define IF_WIFI_UL_RETXT_LEVEL_MEDIUM 3 #define IF_WIFI_UL_RETXT_LEVEL_HIGH 4 #define IF_WIFI_CONFIG_FREQUENCY_2_4_GHZ 1 #define IF_WIFI_CONFIG_FREQUENCY_5_0_GHZ 2 size 112, align 1
unnamed union at net/if_var_status.h:217:2 if_wifi_u
size 120, align 4
u_int32_t ifsr_version version of this report u_int32_t ifsr_len length of the following struct unnamed union at net/if_var_status.h:225:2 ifsr_u
This structure is used to define the parameters for advisory notifications
on an interface.
underlying type uint8_t
IF_INTERFACE_ADVISORY_VERSION_1 1 Initial version with interface advisory report for WiFi interface. IF_INTERFACE_ADVISORY_VERSION_2 2 Reorganized the interface advisory structure to separate out
WiFi and Cellular interface specific reports. IF_INTERFACE_ADVISORY_VERSION_CURRENT 2
underlying type uint8_t
IF_INTERFACE_ADVISORY_DIRECTION_TX 1 IF_INTERFACE_ADVISORY_DIRECTION_RX 2
underlying type uint8_t
IF_INTERFACE_ADVISORY_INTERFACE_TYPE_WIFI 1 IF_INTERFACE_ADVISORY_INTERFACE_TYPE_CELL 2
underlying type uint8_t
IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_CELLULAR_DEFAULT 0 Reserved for MAV platform IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_CELLULAR_UPLINK_CRA 1 Used when sending Codec Rate Adaptation related notifications IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_CELLULAR_MEASUREMENT_UPDATE 2 Used when sending periodic measurement of parameters (RSRP,RSSI etc.)
during VoLTE/VoNR calls IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_CELLULAR_BANDWIDTH_LIMITATION_EVENT 3 Used when a TTI bundle enable/disable occurs during VoLTE/VoNR calls IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_CELLULAR_DISCONTINUOUS_RECEPTION_EVENT 4 Used when a configuration change occurs in CDRx during VoLTE/VoNR calls IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_CELLULAR_OUTAGE_EVENT 5 Used when a handover start/end occurs during VoLTE/VoNR calls IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_CELLULAR_THERMAL_CRA_EVENT 6 Used for Thermal Codec Rate Adaptation Events
underlying type uint8_t
IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_WIFI_UNDEFINED 0 Unused for now
typedef union ifnet_interface_advisory_notification_type_t ifnet_interface_advisory_notification_type_t; underlying type int32_t
IF_INTERFACE_ADVISORY_RATE_SUGGESTION_RAMP_UP 2147483647 IF_INTERFACE_ADVISORY_RATE_SUGGESTION_RAMP_DOWN -2147483648 IF_INTERFACE_ADVISORY_RATE_SUGGESTION_RAMP_NEUTRAL 0
size 48, align 1
enum ifnet_interface_advisory_rate_trend rate_trend_suggestion suggestion for data rate change to keep the latency low.
unit: bits per second (bps)
NOTE: if the interface cannot provide suggestions in
terms of bps, it should use the following values:
INT32_MAX : ramp up
INT32_MIN : ramp down
0 : neutral uint64_t timestamp Time of the issue of advisory.
Timestamp should be in the host domain.
unit: mach absolute time uint64_t max_bandwidth Maximum theoretical bandwidth of the interface.
unit: bits per second (bps) uint64_t total_byte_count Total bytes sent or received on the interface.
wrap around possible and the application should account for that.
unit: byte uint64_t average_throughput average throughput observed at the driver stack.
unit: bits per second (bps) uint32_t flushable_queue_size flushable queue size at the driver.
should be set to UINT32_MAX if not available.
unit: byte uint32_t non_flushable_queue_size non flushable queue size at the driver.
should be set to UINT32_MAX if not available.
unit: byte uint32_t average_delay average delay observed at the interface.
unit: milliseconds (ms)
underlying type uint8_t
IF_INTERFACE_ADVISORY_FREQ_BAND_NOT_AVAIL 0 IF_INTERFACE_ADVISORY_FREQ_BAND_WIFI_24GHZ 1 IF_INTERFACE_ADVISORY_FREQ_BAND_WIFI_5GHZ 2 IF_INTERFACE_ADVISORY_FREQ_BAND_WIFI_6GHZ 3
This structure is used to define the parameters for advisory notifications
that are specific for WiFi interface.
size 37, align 1
enum ifnet_interface_advisory_wifi_freq_band frequency_band Current frequency band (enumeration). uint8_t intermittent_state Intermittent WiFi state [true(1)/false(0)] uint16_t estimated_intermittent_period Estimated period for which intermittent state is expected to last.
1 tick -> 1 ms UNDEF => UINT16_MAX uint16_t single_outage_period Expected wifi outage period during intermittent state
1 tick -> 1 ms UNDEF => UINT16_MAX uint8_t bt_coex WiFi-BT coexistence, 1-ON, 0-OFF uint8_t quality_score_delay on scale of 1 to 5 uint8_t quality_score_loss on scale of 1 to 5 uint8_t quality_score_channel on scale of 1 to 5 uint8_t radio_coex uint16_t wlan_duty_cycle time available to WiFi since last notification (in ms). uint32_t[6] wifi_observed_tx_bitrate
bitmap of all radio contenders.
#define IF_INTERFACE_ADVISORY_WIFI_RADIO_COEX_BT 0x01 #define IF_INTERFACE_ADVISORY_WIFI_RADIO_COEX_AWDL 0x02 bitrate information for each queue (in Kbps).
#define IF_INTERFACE_ADVISORY_WIFI_TX_QUEUE_COUNT 6 This structure is used to define the parameters for advisory notifications
that are specific for Cellular interface.
size 16, align 1
uint8_t radio_access_technology Radio Access Technology int16_t reference_signal_level Received Reference Signal Received level (RSRP dBm) int16_t signal_level Received Signal strength level (RSSI dBm) int8_t signal_quality Received signal quality (SNR dB). uint8_t uplink_bler Uplink Block Error Rate % uint8_t downlink_bler Downlink Block Error Rate % uint8_t bandwidth_limitation_indication Bandwidth Limitation Type. I.e. TTI-B. uint8_t cdrx_state Discontinuous reception state: CDRX on/off. uint16_t cdrx_cycle Discontinuous reception cycle in ms. uint16_t estimated_outage_period Approximate outage period when not known uint8_t outage_state uint8_t __pad padding for alignment.
Cellular outage state: i.e. handover in progress.
0 - no outage
1 - outage.
#define IF_INTERFACE_ADVISORY_CELL_OUTAGE_STATE_NO 0 #define IF_INTERFACE_ADVISORY_CELL_OUTAGE_STATE_YES 1 Supported types
#define IFNET_TRAFFIC_DESCRIPTOR_TYPE_ETH 1 #define IFNET_TRAFFIC_DESCRIPTOR_TYPE_INET 2 Supported flags
#define IFNET_TRAFFIC_DESCRIPTOR_FLAG_INBOUND 0x0001 #define IFNET_TRAFFIC_DESCRIPTOR_FLAG_OUTBOUND 0x0002 size 8, align 1
uint8_t itd_type uint8_t _reserved uint16_t itd_len length of entire struct (common + td-specific) uint32_t itd_flags
#define IFNET_TRAFFIC_DESCRIPTOR_ETH_MASK_ETHER_TYPE 0x01 #define IFNET_TRAFFIC_DESCRIPTOR_ETH_MASK_RADDR 0x02 #define IFNET_TRAFFIC_DESCRIPTOR_INET_IPVER 0x01 #define IFNET_TRAFFIC_DESCRIPTOR_INET_PROTO 0x02 #define IFNET_TRAFFIC_DESCRIPTOR_INET_LADDR 0x04 #define IFNET_TRAFFIC_DESCRIPTOR_INET_RADDR 0x08 #define IFNET_TRAFFIC_DESCRIPTOR_INET_LPORT 0x10 #define IFNET_TRAFFIC_DESCRIPTOR_INET_RPORT 0x20 #define iia_v4addr addr32[3] #define IFNET_TRAFFIC_RULE_ACTION_STEER 1 size 4, align 1
uint8_t ra_type uint8_t _reserved uint16_t ra_len
Generated 2026-09-08 from the headers of one specific machine (macOS 26.4.1, SDK 26.4, arm64) — not official documentation. About & caveats