#include <net/if_var_private.h>

net/if_var_private.h Kernel.framework

includes: Kernel/net/if_var_status.h, Kernel/net/route.h, Kernel/stdint.h, sys/types.h, Kernel/sys/ioccom.h
52 macros · 17 structs · 1 enum · 1 typedef

structif_traffic_class

size 160, align 8
u_int64_tifi_ibepacketsTC_BE packets received on interface
u_int64_tifi_ibebytesTC_BE bytes received on interface
u_int64_tifi_obepacketsTC_BE packet sent on interface
u_int64_tifi_obebytesTC_BE bytes sent on interface
u_int64_tifi_ibkpacketsTC_BK packets received on interface
u_int64_tifi_ibkbytesTC_BK bytes received on interface
u_int64_tifi_obkpacketsTC_BK packet sent on interface
u_int64_tifi_obkbytesTC_BK bytes sent on interface
u_int64_tifi_ivipacketsTC_VI packets received on interface
u_int64_tifi_ivibytesTC_VI bytes received on interface
u_int64_tifi_ovipacketsTC_VI packets sent on interface
u_int64_tifi_ovibytesTC_VI bytes sent on interface
u_int64_tifi_ivopacketsTC_VO packets received on interface
u_int64_tifi_ivobytesTC_VO bytes received on interface
u_int64_tifi_ovopacketsTC_VO packets sent on interface
u_int64_tifi_ovobytesTC_VO bytes sent on interface
u_int64_tifi_ipvpacketsTC priv packets received on interface
u_int64_tifi_ipvbytesTC priv bytes received on interface
u_int64_tifi_opvpacketsTC priv packets sent on interface
u_int64_tifi_opvbytesTC priv bytes sent on interface

structif_data_extended

size 128, align 8
u_int64_tifi_alignerrsunaligned (32-bit) input pkts
u_int64_tifi_dt_bytesData threshold counter
u_int64_tifi_fpacketsforwarded packets on interface
u_int64_tifi_fbytesforwarded bytes on interface
u_int64_t[12]reservedfor future

structif_packet_stats

size 256, align 8
u_int64_tifi_tcp_badformatTCP
u_int64_tifi_tcp_unspecv6
u_int64_tifi_tcp_synfin
u_int64_tifi_tcp_badformatipsec
u_int64_tifi_tcp_noconnnolist
u_int64_tifi_tcp_noconnlist
u_int64_tifi_tcp_listbadsyn
u_int64_tifi_tcp_icmp6unreach
u_int64_tifi_tcp_deprecate6
u_int64_tifi_tcp_rstinsynrcv
u_int64_tifi_tcp_ooopacket
u_int64_tifi_tcp_dospacket
u_int64_tifi_tcp_cleanup
u_int64_tifi_tcp_synwindow
u_int64_t[6]reserved
u_int64_tifi_udp_port_unreachUDP
u_int64_tifi_udp_faithprefix
u_int64_tifi_udp_port0
u_int64_tifi_udp_badlength
u_int64_tifi_udp_badchksum
u_int64_tifi_udp_badmcast
u_int64_tifi_udp_cleanup
u_int64_tifi_udp_badipsec
u_int64_t[4]_reserved

structif_linkheuristics

Structure to report link heuristics
size 144, align 8
u_int64_tiflh_link_heuristics_cntCount of congested link indications
u_int64_tiflh_link_heuristics_timeDuration of congested link indications (msec)
u_int64_tiflh_congested_link_cntCount of congested link indications
u_int64_tiflh_congested_link_timeDuration of congested link indications (msec)
u_int64_tiflh_lqm_good_cntCount of LQM good
u_int64_tiflh_lqm_good_timeDuration of LQM good (msec)
u_int64_tiflh_lqm_poor_cntCount of LQM poor
u_int64_tiflh_lqm_poor_timeDuration of LQM poor (msec)
u_int64_tiflh_lqm_min_viable_cntCount of LQM minimally viable
u_int64_tiflh_lqm_min_viable_timeDuration of LQM minimally viable (msec)
u_int64_tiflh_lqm_bad_cntCount of LQM bad
u_int64_tiflh_lqm_bad_timeDuration of LQM bad (msec)
u_int64_tiflh_tcp_linkheur_stealthdrop
u_int64_tiflh_tcp_linkheur_noackpri
u_int64_tiflh_tcp_linkheur_comprxmt
u_int64_tiflh_tcp_linkheur_synrxmt
u_int64_tiflh_tcp_linkheur_rxmtfloor
u_int64_tiflh_udp_linkheur_stealthdrop

macroHAS_IF_LPW_STATS

Structure to report LPW (Low Power Wake) statistics
#define HAS_IF_LPW_STATS 1

structif_lpw_stats

size 32, align 8
u_int64_tiflpw_ipacketspackets received in LPW mode
u_int64_tiflpw_opacketspackets sent in LPW mode
u_int64_tiflpw_magic_pkt_checkedCount of packet_has_magic_pattern invocations
u_int64_tiflpw_magic_pkt_foundCount of magic packets found

structif_description

size 16, align 8
u_int32_tifd_maxlenmust be IF_DESCSIZE
u_int32_tifd_lenactual ifd_desc length
u_int8_t *ifd_descptr to desc buffer

structif_bandwidths

size 16, align 8
uint64_teff_bweffective bandwidth
uint64_tmax_bwmaximum theoretical bandwidth

structif_latencies

size 16, align 8
u_int64_teff_lteffective latency
u_int64_tmax_ltmaximum theoretical latency

enumif_netem_model_t

underlying type unsigned int
IF_NETEM_MODEL_NULL0
IF_NETEM_MODEL_NLC1

typedefif_netem_model_t

typedef enum if_netem_model_t if_netem_model_t;

macroIF_NETEM_PARAMS_PSCALE

#define IF_NETEM_PARAMS_PSCALE 100000

structif_netem_params

size 72, align 8
if_netem_model_tifnetem_modelpacket scheduler model
uint64_tifnetem_bandwidth_bpsbandwidth limit
uint32_tifnetem_latency_mslatency (normal distribution with jitter as stdev)
uint32_tifnetem_jitter_ms
uint32_tifnetem_corruption_pNetEm 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_tifnetem_duplication_prandom packet duplication
uint32_tifnetem_loss_p_gr_gl4 state Markov loss model P( gap_loss | gap_rx )
uint32_tifnetem_loss_p_gr_blP( burst_loss | gap_rx )
uint32_tifnetem_loss_p_bl_brP( burst_rx | burst_loss )
uint32_tifnetem_loss_p_bl_grP( gap_rx | burst_loss )
uint32_tifnetem_loss_p_br_blP( burst_loss | burst_rx )
uint32_tifnetem_loss_recovery_mstime to recovery loss
uint32_tifnetem_reordering_prandom packet reordering reorder probability
uint32_tifnetem_reordering_msreorder delay in ms
uint32_tifnetem_output_ival_msNetEm 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

structif_rxpoll_stats

size 104, align 8
u_int32_tifi_poll_off_reqtotal # of POLL_OFF reqs
u_int32_tifi_poll_off_errtotal # of POLL_OFF errors
u_int32_tifi_poll_on_reqtotal # of POLL_ON reqs
u_int32_tifi_poll_on_errtotal # of POLL_ON errors
u_int32_tifi_poll_wakeups_avgavg # of wakeup reqs
u_int32_tifi_poll_wakeups_lowatwakeups low watermark
u_int32_tifi_poll_wakeups_hiwatwakeups high watermark
u_int64_tifi_poll_packetstotal # of polled packets
u_int32_tifi_poll_packets_avgaverage polled packets
u_int32_tifi_poll_packets_minsmallest polled packets
u_int32_tifi_poll_packets_maxlargest polled packets
u_int32_tifi_poll_packets_lowatpackets low watermark
u_int32_tifi_poll_packets_hiwatpackets high watermark
u_int64_tifi_poll_bytestotal # of polled bytes
u_int32_tifi_poll_bytes_avgaverage polled bytes
u_int32_tifi_poll_bytes_minsmallest polled bytes
u_int32_tifi_poll_bytes_maxlargest polled bytes
u_int32_tifi_poll_bytes_lowatbytes low watermark
u_int32_tifi_poll_bytes_hiwatbytes high watermark
u_int32_tifi_poll_packets_limitmax packets per poll call
u_int64_tifi_poll_interval_timepoll interval (nsec)

structif_netif_stats

size 64, align 8
u_int64_tifn_rx_mit_intervalrx mitigation ival (nsec)
u_int32_tifn_rx_mit_mode0: static, 1: dynamic
u_int32_tifn_rx_mit_packets_avgaverage # of packets
u_int32_tifn_rx_mit_packets_minsmallest # of packets
u_int32_tifn_rx_mit_packets_maxlargest # of packets
u_int32_tifn_rx_mit_bytes_avgaverage # of bytes
u_int32_tifn_rx_mit_bytes_minsmallest # of bytes
u_int32_tifn_rx_mit_bytes_maxlargest # of bytes
u_int32_tifn_rx_mit_cfg_idxcurrent config selector
u_int32_tifn_rx_mit_cfg_packets_lowatpkts low watermark
u_int32_tifn_rx_mit_cfg_packets_hiwatpkts high watermark
u_int32_tifn_rx_mit_cfg_bytes_lowatbytes low watermark
u_int32_tifn_rx_mit_cfg_bytes_hiwatbytes high watermark
u_int32_tifn_rx_mit_cfg_intervaldelay interval (nsec)

structif_tcp_ecn_perf_stat

size 104, align 8
u_int64_ttotal_txpkts
u_int64_ttotal_rxmitpkts
u_int64_ttotal_rxpkts
u_int64_ttotal_oopkts
u_int64_ttotal_reorderpkts
u_int64_trtt_avg
u_int64_trtt_var
u_int64_tsack_episodes
u_int64_trxmit_drop
u_int64_trst_drop
u_int64_too_percent
u_int64_treorder_percent
u_int64_trxmit_percent

structif_tcp_ecn_stat

size 392, align 8
u_int64_ttimestamp
u_int64_tecn_client_setup
u_int64_tecn_server_setup
u_int64_tecn_client_success
u_int64_tecn_server_success
u_int64_tecn_peer_nosupport
u_int64_tecn_syn_lost
u_int64_tecn_synack_lost
u_int64_tecn_recv_ce
u_int64_tecn_recv_ece
u_int64_tecn_conn_recv_ce
u_int64_tecn_conn_recv_ece
u_int64_tecn_conn_plnoce
u_int64_tecn_conn_plce
u_int64_tecn_conn_noplce
u_int64_tecn_fallback_synloss
u_int64_tecn_fallback_reorder
u_int64_tecn_fallback_ce
u_int64_tecn_off_conn
u_int64_tecn_total_conn
u_int64_tecn_fallback_droprst
u_int64_tecn_fallback_droprxmt
u_int64_tecn_fallback_synrst
struct if_tcp_ecn_perf_statecn_on
struct if_tcp_ecn_perf_statecn_off

structif_lim_perf_stat

size 128, align 8
u_int64_tlim_dl_max_bandwidthbits per second
u_int64_tlim_ul_max_bandwidthbits per second
u_int64_tlim_total_txpktsTotal transmit packets, count
u_int64_tlim_total_rxpktsTotal receive packets, count
u_int64_tlim_total_retxpktsTotal retransmit packets
u_int64_tlim_packet_loss_percentPacket loss rate
u_int64_tlim_total_oopktsTotal out-of-order packets
u_int64_tlim_packet_ooo_percentOut-of-order packet rate
u_int64_tlim_rtt_varianceRTT variance, milliseconds
u_int64_tlim_rtt_averageRTT average, milliseconds
u_int64_tlim_rtt_minRTT minimum, milliseconds
u_int64_tlim_conn_timeoutsconnection timeouts
u_int64_tlim_conn_attemptsconnection attempts
u_int64_tlim_conn_timeout_percentRate of connection timeouts
u_int64_tlim_bk_txpktsTransmit packets with BK service class, that use delay based algorithms
u_int64_t:1lim_dl_detectedLow internet
u_int64_t:1lim_ul_detected

macroIF_VAR_H_HAS_IFNET_STATS_PER_FLOW

#define IF_VAR_H_HAS_IFNET_STATS_PER_FLOW 1

macroIF_VAR_H_HAS_IFNET_STATS_PER_FLOW_LINKHEUR

#define IF_VAR_H_HAS_IFNET_STATS_PER_FLOW_LINKHEUR 1

structifnet_stats_per_flow

size 136, align 8
u_int64_tbk_txpackets
u_int64_ttxpackets
u_int64_trxpackets
u_int32_ttxretransmitbytes
u_int32_trxoutoforderbytes
u_int32_trxmitpkts
u_int32_trcvoopack
u_int32_tpawsdrop
u_int32_tsack_recovery_episodes
u_int32_treordered_pkts
u_int32_tdsack_sent
u_int32_tdsack_recvd
u_int32_tsrtt
u_int32_trttupdated
u_int32_trttvar
u_int32_trttmin
u_int32_tbw_sndbw_max
u_int32_tbw_rcvbw_max
u_int32_tecn_recv_ece
u_int32_tecn_recv_ce
u_int32_tecn_flags
u_int16_t:1ipv4
u_int16_t:1local
u_int16_t:1connreset
u_int16_t:1conntimeout
u_int16_t:1rxmit_drop
u_int16_t:1ecn_fallback_synloss
u_int16_t:1ecn_fallback_droprst
u_int16_t:1ecn_fallback_droprxmt
u_int16_t:1ecn_fallback_ce
u_int16_t:1ecn_fallback_reorder
u_int16_t:6_reserved_6
u_int16_t_reserved_16
u_int32_t_reserved_32
u_int64_tlinkheur_noackpri
u_int64_tlinkheur_comprxmt
u_int64_tlinkheur_synrxmt
u_int64_tlinkheur_rxmtfloor

structif_interface_state

size 4, align 1
u_int8_tvalid_bitmaskThe 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_trrc_stateValid only for cellular interface
int8_tlqm_stateValues 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_tinterface_availabilityIndicate if the underlying link is currently available

macroIF_INTERFACE_STATE_RRC_STATE_VALID

#define IF_INTERFACE_STATE_RRC_STATE_VALID 0x1

macroIF_INTERFACE_STATE_LQM_STATE_VALID

#define IF_INTERFACE_STATE_LQM_STATE_VALID 0x2

macroIF_INTERFACE_STATE_INTERFACE_AVAILABILITY_VALID

#define IF_INTERFACE_STATE_INTERFACE_AVAILABILITY_VALID 0x4

macroIF_INTERFACE_STATE_RRC_STATE_IDLE

#define IF_INTERFACE_STATE_RRC_STATE_IDLE 0x0

macroIF_INTERFACE_STATE_RRC_STATE_CONNECTED

#define IF_INTERFACE_STATE_RRC_STATE_CONNECTED 0x1

macroIF_INTERFACE_STATE_INTERFACE_AVAILABLE

#define IF_INTERFACE_STATE_INTERFACE_AVAILABLE 0x0

macroIF_INTERFACE_STATE_INTERFACE_UNAVAILABLE

#define IF_INTERFACE_STATE_INTERFACE_UNAVAILABLE 0x1

structchain_len_stats

size 40, align 8
uint64_tcls_one
uint64_tcls_two
uint64_tcls_three
uint64_tcls_four
uint64_tcls_five_or_more

macroif_mtu

#define if_mtu if_data.ifi_mtu

macroif_type

#define if_type if_data.ifi_type

macroif_typelen

#define if_typelen if_data.ifi_typelen

macroif_physical

#define if_physical if_data.ifi_physical

macroif_addrlen

#define if_addrlen if_data.ifi_addrlen

macroif_hdrlen

#define if_hdrlen if_data.ifi_hdrlen

macroif_metric

#define if_metric if_data.ifi_metric

macroif_baudrate

#define if_baudrate if_data.ifi_baudrate

macroif_hwassist

#define if_hwassist if_data.ifi_hwassist

macroif_ipackets

#define if_ipackets if_data.ifi_ipackets

macroif_ierrors

#define if_ierrors if_data.ifi_ierrors

macroif_opackets

#define if_opackets if_data.ifi_opackets

macroif_oerrors

#define if_oerrors if_data.ifi_oerrors

macroif_collisions

#define if_collisions if_data.ifi_collisions

macroif_ibytes

#define if_ibytes if_data.ifi_ibytes

macroif_obytes

#define if_obytes if_data.ifi_obytes

macroif_imcasts

#define if_imcasts if_data.ifi_imcasts

macroif_omcasts

#define if_omcasts if_data.ifi_omcasts

macroif_iqdrops

#define if_iqdrops if_data.ifi_iqdrops

macroif_noproto

#define if_noproto if_data.ifi_noproto

macroif_lastchange

#define if_lastchange if_data.ifi_lastchange

macroif_recvquota

#define if_recvquota if_data.ifi_recvquota

macroif_xmitquota

#define if_xmitquota if_data.ifi_xmitquota

macroIF_HWASSIST_CSUM_IP

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
will csum IP, IFNET_CSUM_IP

macroIF_HWASSIST_CSUM_TCP

#define IF_HWASSIST_CSUM_TCP 0x0002
will csum TCP, IFNET_CSUM_TCP

macroIF_HWASSIST_CSUM_UDP

#define IF_HWASSIST_CSUM_UDP 0x0004
will csum UDP, IFNET_CSUM_UDP

macroIF_HWASSIST_CSUM_IP_FRAGS

#define IF_HWASSIST_CSUM_IP_FRAGS 0x0008
will csum IP fragments, IFNET_CSUM_FRAGMENT

macroIF_HWASSIST_CSUM_FRAGMENT

#define IF_HWASSIST_CSUM_FRAGMENT 0x0010
will do IP fragmentation, IFNET_IP_FRAGMENT

macroIF_HWASSIST_CSUM_TCPIPV6

#define IF_HWASSIST_CSUM_TCPIPV6 0x0020
will csum TCPv6, IFNET_CSUM_TCPIPV6

macroIF_HWASSIST_CSUM_UDPIPV6

#define IF_HWASSIST_CSUM_UDPIPV6 0x0040
will csum UDPv6, IFNET_CSUM_UDP

macroIF_HWASSIST_CSUM_FRAGMENT_IPV6

#define IF_HWASSIST_CSUM_FRAGMENT_IPV6 0x0080
will do IPv6 fragmentation, IFNET_IPV6_FRAGMENT

macroIF_HWASSIST_CSUM_PARTIAL

#define IF_HWASSIST_CSUM_PARTIAL 0x1000
simple Sum16 computation, IFNET_CSUM_PARTIAL

macroIF_HWASSIST_CSUM_ZERO_INVERT

#define IF_HWASSIST_CSUM_ZERO_INVERT 0x2000
capable of inverting csum of 0 to -0 (0xffff)

macroIF_HWASSIST_CSUM_MASK

#define IF_HWASSIST_CSUM_MASK 0xffff

macroIF_HWASSIST_CSUM_FLAGS

#define IF_HWASSIST_CSUM_FLAGS(hwassist) ((hwassist) & IF_HWASSIST_CSUM_MASK)

macroIF_HWASSIST_VLAN_TAGGING

VLAN support
#define IF_HWASSIST_VLAN_TAGGING 0x00010000
supports VLAN tagging, IFNET_VLAN_TAGGING

macroIF_HWASSIST_VLAN_MTU

#define IF_HWASSIST_VLAN_MTU 0x00020000
supports VLAN MTU-sized packet (for software VLAN), IFNET_VLAN_MTU

macroIF_HWASSIST_TSO_V4

#define IF_HWASSIST_TSO_V4 0x00200000
will do TCP Segment offload for IPv4, IFNET_TSO_IPV4

macroIF_HWASSIST_TSO_V6

#define IF_HWASSIST_TSO_V6 0x00400000
will do TCP Segment offload for IPv6, IFNET_TSO_IPV6

macroIFXNAMSIZ

#define IFXNAMSIZ (IFNAMSIZ + 8)
external name (name + unit)

macroIFNET_NETWORK_ID_LEN

#define IFNET_NETWORK_ID_LEN 32