#include <net/if_var_status.h>

net/if_var_status.h

includes: machine/types.h, stdint.h, net/ethernet.h
71 macros · 16 structs · 7 enums · 1 union · 1 typedef

macroIF_CELLULAR_STATUS_REPORT_VERSION_1

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

macroIF_WIFI_STATUS_REPORT_VERSION_1

#define IF_WIFI_STATUS_REPORT_VERSION_1 1

macroIF_CELLULAR_STATUS_REPORT_CURRENT_VERSION

#define IF_CELLULAR_STATUS_REPORT_CURRENT_VERSION IF_CELLULAR_STATUS_REPORT_VERSION_1

macroIF_WIFI_STATUS_REPORT_CURRENT_VERSION

#define IF_WIFI_STATUS_REPORT_CURRENT_VERSION IF_WIFI_STATUS_REPORT_VERSION_1

structif_cellular_status_v1

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_tvalid_bitmaskindicates which fields are valid
u_int32_tlink_quality_metric
u_int32_tul_effective_bandwidthMeasured uplink bandwidth based on current activity (bps)
u_int32_tul_max_bandwidthMaximum supported uplink bandwidth (bps)
u_int32_tul_min_latencymin expected uplink latency for first hop (ms)
u_int32_tul_effective_latencycurrent expected uplink latency for first hop (ms)
u_int32_tul_max_latencymax expected uplink latency first hop (ms)
u_int32_tul_retxt_levelRetransmission metric
u_int32_tul_bytes_lost% of total bytes lost on uplink in Q10 format
u_int32_tul_min_queue_sizeminimum bytes in queue
u_int32_tul_avg_queue_sizeaverage bytes in queue
u_int32_tul_max_queue_sizemaximum bytes in queue
u_int32_tdl_effective_bandwidthMeasured downlink bandwidth based on current activity (bps)
u_int32_tdl_max_bandwidthMaximum supported downlink bandwidth (bps)
u_int32_tconfig_inactivity_timems
u_int32_tconfig_backoff_timenew connections backoff time in ms
u_int16_tmss_recommended
u_int16_treserved_1
u_int32_treserved_2
u_int64_treserved_3
u_int64_treserved_4
u_int64_treserved_5
u_int64_treserved_6

macroIF_CELL_UL_EFFECTIVE_BANDWIDTH_VALID

#define IF_CELL_UL_EFFECTIVE_BANDWIDTH_VALID 0x2

macroIF_CELL_UL_MAX_BANDWIDTH_VALID

#define IF_CELL_UL_MAX_BANDWIDTH_VALID 0x4

macroIF_CELL_UL_MIN_LATENCY_VALID

#define IF_CELL_UL_MIN_LATENCY_VALID 0x8

macroIF_CELL_UL_EFFECTIVE_LATENCY_VALID

#define IF_CELL_UL_EFFECTIVE_LATENCY_VALID 0x10

macroIF_CELL_UL_MAX_LATENCY_VALID

#define IF_CELL_UL_MAX_LATENCY_VALID 0x20

macroIF_CELL_UL_RETXT_LEVEL_VALID

#define IF_CELL_UL_RETXT_LEVEL_VALID 0x40

macroIF_CELL_UL_BYTES_LOST_VALID

#define IF_CELL_UL_BYTES_LOST_VALID 0x80

macroIF_CELL_UL_MIN_QUEUE_SIZE_VALID

#define IF_CELL_UL_MIN_QUEUE_SIZE_VALID 0x100

macroIF_CELL_UL_AVG_QUEUE_SIZE_VALID

#define IF_CELL_UL_AVG_QUEUE_SIZE_VALID 0x200

macroIF_CELL_UL_MAX_QUEUE_SIZE_VALID

#define IF_CELL_UL_MAX_QUEUE_SIZE_VALID 0x400

macroIF_CELL_DL_EFFECTIVE_BANDWIDTH_VALID

#define IF_CELL_DL_EFFECTIVE_BANDWIDTH_VALID 0x800

macroIF_CELL_DL_MAX_BANDWIDTH_VALID

#define IF_CELL_DL_MAX_BANDWIDTH_VALID 0x1000

macroIF_CELL_CONFIG_INACTIVITY_TIME_VALID

#define IF_CELL_CONFIG_INACTIVITY_TIME_VALID 0x2000

macroIF_CELL_CONFIG_BACKOFF_TIME_VALID

#define IF_CELL_CONFIG_BACKOFF_TIME_VALID 0x4000

macroIF_CELL_UL_RETXT_LEVEL_NONE

#define IF_CELL_UL_RETXT_LEVEL_NONE 1

macroIF_CELL_UL_RETXT_LEVEL_LOW

#define IF_CELL_UL_RETXT_LEVEL_LOW 2

macroIF_CELL_UL_RETXT_LEVEL_MEDIUM

#define IF_CELL_UL_RETXT_LEVEL_MEDIUM 3

macroIF_CELL_UL_RETXT_LEVEL_HIGH

#define IF_CELL_UL_RETXT_LEVEL_HIGH 4

structif_cellular_status

size 104, align 1
unnamed union at net/if_var_status.h:146:2if_cell_u
struct if_cellular_status_v1if_status_v1

structif_wifi_status_v1

size 112, align 1 · packed
u_int32_tvalid_bitmask
u_int32_tlink_quality_metriclink quality metric
u_int32_tul_effective_bandwidthMeasured uplink bandwidth based on current activity (bps)
u_int32_tul_max_bandwidthMaximum supported uplink bandwidth (bps)
u_int32_tul_min_latencymin expected uplink latency for first hop (ms)
u_int32_tul_effective_latencycurrent expected uplink latency for first hop (ms)
u_int32_tul_max_latencymax expected uplink latency for first hop (ms)
u_int32_tul_retxt_levelRetransmission metric
u_int32_tul_bytes_lost% of total bytes lost on uplink in Q10 format
u_int32_tul_error_rate% of bytes dropped on uplink after many retransmissions in Q10 format
u_int32_tdl_effective_bandwidthMeasured downlink bandwidth based on current activity (bps)
u_int32_tdl_max_bandwidthMaximum supported downlink bandwidth (bps)
u_int32_tdl_min_latencyThe 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_tdl_effective_latencycurrent expected latency for first hop in ms
u_int32_tdl_max_latencymax expected latency for first hop in ms
u_int32_tdl_error_rate% of CRC or other errors in Q10 format
u_int32_tconfig_frequency2.4 or 5 GHz
u_int32_tconfig_multicast_ratebps
u_int32_tscan_countscan count during the previous period
u_int32_tscan_durationscan duration in ms
u_int64_treserved_1
u_int64_treserved_2
u_int64_treserved_3
u_int64_treserved_4

macroIF_WIFI_UL_EFFECTIVE_BANDWIDTH_VALID

#define IF_WIFI_UL_EFFECTIVE_BANDWIDTH_VALID 0x2

macroIF_WIFI_UL_MAX_BANDWIDTH_VALID

#define IF_WIFI_UL_MAX_BANDWIDTH_VALID 0x4

macroIF_WIFI_UL_MIN_LATENCY_VALID

#define IF_WIFI_UL_MIN_LATENCY_VALID 0x8

macroIF_WIFI_UL_EFFECTIVE_LATENCY_VALID

#define IF_WIFI_UL_EFFECTIVE_LATENCY_VALID 0x10

macroIF_WIFI_UL_MAX_LATENCY_VALID

#define IF_WIFI_UL_MAX_LATENCY_VALID 0x20

macroIF_WIFI_UL_RETXT_LEVEL_VALID

#define IF_WIFI_UL_RETXT_LEVEL_VALID 0x40

macroIF_WIFI_UL_ERROR_RATE_VALID

#define IF_WIFI_UL_ERROR_RATE_VALID 0x80

macroIF_WIFI_UL_BYTES_LOST_VALID

#define IF_WIFI_UL_BYTES_LOST_VALID 0x100

macroIF_WIFI_DL_EFFECTIVE_BANDWIDTH_VALID

#define IF_WIFI_DL_EFFECTIVE_BANDWIDTH_VALID 0x200

macroIF_WIFI_DL_MAX_BANDWIDTH_VALID

#define IF_WIFI_DL_MAX_BANDWIDTH_VALID 0x400

macroIF_WIFI_DL_MIN_LATENCY_VALID

#define IF_WIFI_DL_MIN_LATENCY_VALID 0x800

macroIF_WIFI_DL_EFFECTIVE_LATENCY_VALID

#define IF_WIFI_DL_EFFECTIVE_LATENCY_VALID 0x1000

macroIF_WIFI_DL_MAX_LATENCY_VALID

#define IF_WIFI_DL_MAX_LATENCY_VALID 0x2000

macroIF_WIFI_DL_ERROR_RATE_VALID

#define IF_WIFI_DL_ERROR_RATE_VALID 0x4000

macroIF_WIFI_CONFIG_FREQUENCY_VALID

#define IF_WIFI_CONFIG_FREQUENCY_VALID 0x8000

macroIF_WIFI_CONFIG_MULTICAST_RATE_VALID

#define IF_WIFI_CONFIG_MULTICAST_RATE_VALID 0x10000

macroIF_WIFI_CONFIG_SCAN_COUNT_VALID

#define IF_WIFI_CONFIG_SCAN_COUNT_VALID 0x20000

macroIF_WIFI_CONFIG_SCAN_DURATION_VALID

#define IF_WIFI_CONFIG_SCAN_DURATION_VALID 0x40000

macroIF_WIFI_UL_RETXT_LEVEL_NONE

#define IF_WIFI_UL_RETXT_LEVEL_NONE 1

macroIF_WIFI_UL_RETXT_LEVEL_LOW

#define IF_WIFI_UL_RETXT_LEVEL_LOW 2

macroIF_WIFI_UL_RETXT_LEVEL_MEDIUM

#define IF_WIFI_UL_RETXT_LEVEL_MEDIUM 3

macroIF_WIFI_UL_RETXT_LEVEL_HIGH

#define IF_WIFI_UL_RETXT_LEVEL_HIGH 4

macroIF_WIFI_CONFIG_FREQUENCY_2_4_GHZ

#define IF_WIFI_CONFIG_FREQUENCY_2_4_GHZ 1

macroIF_WIFI_CONFIG_FREQUENCY_5_0_GHZ

#define IF_WIFI_CONFIG_FREQUENCY_5_0_GHZ 2

structif_wifi_status

size 112, align 1
unnamed union at net/if_var_status.h:217:2if_wifi_u
struct if_wifi_status_v1if_status_v1

enumifnet_interface_advisory_version

This structure is used to define the parameters for advisory notifications on an interface.
underlying type uint8_t
IF_INTERFACE_ADVISORY_VERSION_11Initial version with interface advisory report for WiFi interface.
IF_INTERFACE_ADVISORY_VERSION_22Reorganized the interface advisory structure to separate out WiFi and Cellular interface specific reports.
IF_INTERFACE_ADVISORY_VERSION_CURRENT2

enumifnet_interface_advisory_direction

underlying type uint8_t
IF_INTERFACE_ADVISORY_DIRECTION_TX1
IF_INTERFACE_ADVISORY_DIRECTION_RX2

enumifnet_interface_advisory_interface_type

underlying type uint8_t
IF_INTERFACE_ADVISORY_INTERFACE_TYPE_WIFI1
IF_INTERFACE_ADVISORY_INTERFACE_TYPE_CELL2

enumifnet_interface_advisory_notification_type_cell

underlying type uint8_t
IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_CELLULAR_DEFAULT0Reserved for MAV platform
1Used when sending Codec Rate Adaptation related notifications
IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_CELLULAR_MEASUREMENT_UPDATE2Used when sending periodic measurement of parameters (RSRP,RSSI etc.) during VoLTE/VoNR calls
IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_CELLULAR_BANDWIDTH_LIMITATION_EVENT3Used when a TTI bundle enable/disable occurs during VoLTE/VoNR calls
IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_CELLULAR_DISCONTINUOUS_RECEPTION_EVENT4Used when a configuration change occurs in CDRx during VoLTE/VoNR calls
IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_CELLULAR_OUTAGE_EVENT5Used when a handover start/end occurs during VoLTE/VoNR calls
IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_CELLULAR_THERMAL_CRA_EVENT6Used for Thermal Codec Rate Adaptation Events

enumifnet_interface_advisory_notification_type_wifi

underlying type uint8_t
IF_INTERFACE_ADVISORY_NOTIFICATION_TYPE_WIFI_UNDEFINED0Unused for now

typedefifnet_interface_advisory_notification_type_t

typedef union ifnet_interface_advisory_notification_type_t ifnet_interface_advisory_notification_type_t;

structifnet_interface_advisory_header

size 4, align 1
enum ifnet_interface_advisory_versionversionThe current structure version
enum ifnet_interface_advisory_directiondirectionSpecifies if the advisory is for transmit or receive path
enum ifnet_interface_advisory_interface_typeinterface_typeInterface type
ifnet_interface_advisory_notification_type_tnotification_typeNotification type

enumifnet_interface_advisory_rate_trend

underlying type int32_t
IF_INTERFACE_ADVISORY_RATE_SUGGESTION_RAMP_UP2147483647
IF_INTERFACE_ADVISORY_RATE_SUGGESTION_RAMP_DOWN-2147483648
IF_INTERFACE_ADVISORY_RATE_SUGGESTION_RAMP_NEUTRAL0

structifnet_interface_advisory_capacity

size 48, align 1
enum ifnet_interface_advisory_rate_trendrate_trend_suggestionsuggestion 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_ttimestampTime of the issue of advisory. Timestamp should be in the host domain. unit: mach absolute time
uint64_tmax_bandwidthMaximum theoretical bandwidth of the interface. unit: bits per second (bps)
uint64_ttotal_byte_countTotal bytes sent or received on the interface. wrap around possible and the application should account for that. unit: byte
uint64_taverage_throughputaverage throughput observed at the driver stack. unit: bits per second (bps)
uint32_tflushable_queue_sizeflushable queue size at the driver. should be set to UINT32_MAX if not available. unit: byte
uint32_tnon_flushable_queue_sizenon flushable queue size at the driver. should be set to UINT32_MAX if not available. unit: byte
uint32_taverage_delayaverage delay observed at the interface. unit: milliseconds (ms)

enumifnet_interface_advisory_wifi_freq_band

underlying type uint8_t
IF_INTERFACE_ADVISORY_FREQ_BAND_NOT_AVAIL0
IF_INTERFACE_ADVISORY_FREQ_BAND_WIFI_24GHZ1
IF_INTERFACE_ADVISORY_FREQ_BAND_WIFI_5GHZ2
IF_INTERFACE_ADVISORY_FREQ_BAND_WIFI_6GHZ3

structifnet_interface_advisory_wifi_context

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_bandfrequency_bandCurrent frequency band (enumeration).
uint8_tintermittent_stateIntermittent WiFi state [true(1)/false(0)]
uint16_testimated_intermittent_periodEstimated period for which intermittent state is expected to last. 1 tick -> 1 ms UNDEF => UINT16_MAX
uint16_tsingle_outage_periodExpected wifi outage period during intermittent state 1 tick -> 1 ms UNDEF => UINT16_MAX
uint8_tbt_coexWiFi-BT coexistence, 1-ON, 0-OFF
uint8_tquality_score_delayon scale of 1 to 5
uint8_tquality_score_losson scale of 1 to 5
uint8_tquality_score_channelon scale of 1 to 5
uint8_tradio_coex
uint16_twlan_duty_cycletime available to WiFi since last notification (in ms).
uint32_t[6]wifi_observed_tx_bitrate

macroIF_INTERFACE_ADVISORY_WIFI_RADIO_COEX_BT

bitmap of all radio contenders.
#define IF_INTERFACE_ADVISORY_WIFI_RADIO_COEX_BT 0x01

macroIF_INTERFACE_ADVISORY_WIFI_RADIO_COEX_AWDL

#define IF_INTERFACE_ADVISORY_WIFI_RADIO_COEX_AWDL 0x02

macroIF_INTERFACE_ADVISORY_WIFI_TX_QUEUE_COUNT

bitrate information for each queue (in Kbps).
#define IF_INTERFACE_ADVISORY_WIFI_TX_QUEUE_COUNT 6

structifnet_interface_advisory_cell_context

This structure is used to define the parameters for advisory notifications that are specific for Cellular interface.
size 16, align 1
uint8_tradio_access_technologyRadio Access Technology
int16_treference_signal_levelReceived Reference Signal Received level (RSRP dBm)
int16_tsignal_levelReceived Signal strength level (RSSI dBm)
int8_tsignal_qualityReceived signal quality (SNR dB).
uint8_tuplink_blerUplink Block Error Rate %
uint8_tdownlink_blerDownlink Block Error Rate %
uint8_tbandwidth_limitation_indicationBandwidth Limitation Type. I.e. TTI-B.
uint8_tcdrx_stateDiscontinuous reception state: CDRX on/off.
uint16_tcdrx_cycleDiscontinuous reception cycle in ms.
uint16_testimated_outage_periodApproximate outage period when not known
uint8_toutage_state
uint8_t__padpadding for alignment.

macroIF_INTERFACE_ADVISORY_CELL_OUTAGE_STATE_NO

Cellular outage state: i.e. handover in progress. 0 - no outage 1 - outage.
#define IF_INTERFACE_ADVISORY_CELL_OUTAGE_STATE_NO 0

macroIF_INTERFACE_ADVISORY_CELL_OUTAGE_STATE_YES

#define IF_INTERFACE_ADVISORY_CELL_OUTAGE_STATE_YES 1

structifnet_interface_advisory

size 96, align 8

macroIFNET_TRAFFIC_DESCRIPTOR_TYPE_ETH

Supported types
#define IFNET_TRAFFIC_DESCRIPTOR_TYPE_ETH 1

macroIFNET_TRAFFIC_DESCRIPTOR_TYPE_INET

#define IFNET_TRAFFIC_DESCRIPTOR_TYPE_INET 2

macroIFNET_TRAFFIC_DESCRIPTOR_FLAG_INBOUND

Supported flags
#define IFNET_TRAFFIC_DESCRIPTOR_FLAG_INBOUND 0x0001

macroIFNET_TRAFFIC_DESCRIPTOR_FLAG_OUTBOUND

#define IFNET_TRAFFIC_DESCRIPTOR_FLAG_OUTBOUND 0x0002

structifnet_traffic_descriptor_common

size 8, align 1
uint8_titd_type
uint8_t_reserved
uint16_titd_lenlength of entire struct (common + td-specific)
uint32_titd_flags

macroIFNET_TRAFFIC_DESCRIPTOR_ETH_MASK_ETHER_TYPE

#define IFNET_TRAFFIC_DESCRIPTOR_ETH_MASK_ETHER_TYPE 0x01

macroIFNET_TRAFFIC_DESCRIPTOR_ETH_MASK_RADDR

#define IFNET_TRAFFIC_DESCRIPTOR_ETH_MASK_RADDR 0x02

structifnet_traffic_descriptor_eth

size 17, align 1
struct ifnet_traffic_descriptor_commoneth_common
ether_addr_teth_raddr
uint16_teth_type
uint8_teth_mask

macroIFNET_TRAFFIC_DESCRIPTOR_INET_IPVER

#define IFNET_TRAFFIC_DESCRIPTOR_INET_IPVER 0x01

macroIFNET_TRAFFIC_DESCRIPTOR_INET_PROTO

#define IFNET_TRAFFIC_DESCRIPTOR_INET_PROTO 0x02

macroIFNET_TRAFFIC_DESCRIPTOR_INET_LADDR

#define IFNET_TRAFFIC_DESCRIPTOR_INET_LADDR 0x04

macroIFNET_TRAFFIC_DESCRIPTOR_INET_RADDR

#define IFNET_TRAFFIC_DESCRIPTOR_INET_RADDR 0x08

macroIFNET_TRAFFIC_DESCRIPTOR_INET_LPORT

#define IFNET_TRAFFIC_DESCRIPTOR_INET_LPORT 0x10

macroIFNET_TRAFFIC_DESCRIPTOR_INET_RPORT

#define IFNET_TRAFFIC_DESCRIPTOR_INET_RPORT 0x20

structifnet_ip_addr

size 16, align 1

macroiia_v4addr

#define iia_v4addr addr32[3]

structifnet_traffic_descriptor_inet

size 48, align 1
struct ifnet_traffic_descriptor_commoninet_common
uint8_tinet_mask
uint8_tinet_ipverIPVERSION or IPV6_VERSION
uint8_tinet_protoIPPROTO_TCP or IPPROTO_UDP
uint8_t_reserved
struct ifnet_ip_addrinet_laddr
struct ifnet_ip_addrinet_raddr
uint16_tinet_lport
uint16_tinet_rport

macroIFNET_TRAFFIC_RULE_ACTION_STEER

#define IFNET_TRAFFIC_RULE_ACTION_STEER 1

structifnet_traffic_rule_action

size 4, align 1
uint8_tra_type
uint8_t_reserved
uint16_tra_len

structifnet_traffic_rule_action_steer

size 12, align 1
struct ifnet_traffic_rule_actionras_common
uint64_tras_qset_id