+#ifdef XNU_KERNEL_PRIVATE
+#define IFNET_LQM_MIN IFNET_LQM_THRESH_OFF
+#define IFNET_LQM_MAX IFNET_LQM_THRESH_GOOD
+#endif /* XNU_KERNEL_PRIVATE */
+
+/*
+ * DLIL KEV_DL_LINK_QUALITY_METRIC_CHANGED structure
+ */
+struct kev_dl_link_quality_metric_data {
+ struct net_event_data link_data;
+ int link_quality_metric;
+};
+
+#define IF_DESCSIZE 128
+
+/*
+ * Structure for SIOC[SG]IFDESC
+ */
+struct if_descreq {
+ char ifdr_name[IFNAMSIZ]; /* interface name */
+ u_int32_t ifdr_len; /* up to IF_DESCSIZE */
+ u_int8_t ifdr_desc[IF_DESCSIZE]; /* opaque data */
+};
+
+/*
+ * Output packet scheduling models
+ *
+ * IFNET_SCHED_MODEL_NORMAL The default output packet scheduling model
+ * where the driver or media does not require strict scheduling
+ * strategy, and that the networking stack is free to choose the
+ * most appropriate scheduling and queueing algorithm, including
+ * shaping traffics.
+ * IFNET_SCHED_MODEL_DRIVER_MANAGED The alternative output packet
+ * scheduling model where the driver or media requires strict
+ * scheduling strategy (e.g. 802.11 WMM), and that the networking
+ * stack is only responsible for creating multiple queues for the
+ * corresponding service classes.
+ */
+enum {
+ IFNET_SCHED_MODEL_NORMAL = 0,
+ IFNET_SCHED_MODEL_DRIVER_MANAGED = 1,
+ IFNET_SCHED_MODEL_FQ_CODEL = 2,
+#ifdef XNU_KERNEL_PRIVATE
+ IFNET_SCHED_MODEL_MAX = 3,
+#endif /* XNU_KERNEL_PRIVATE */
+};
+
+/*
+ * Values for iflpr_flags
+ */
+#define IFLPRF_ALTQ 0x1 /* configured via PF/ALTQ */
+#define IFLPRF_DRVMANAGED 0x2 /* output queue scheduled by drv */
+
+/*
+ * Structure for SIOCGIFLINKPARAMS
+ */
+struct if_linkparamsreq {
+ char iflpr_name[IFNAMSIZ]; /* interface name */
+ u_int32_t iflpr_flags;
+ u_int32_t iflpr_output_sched;
+ u_int64_t iflpr_output_tbr_rate;
+ u_int32_t iflpr_output_tbr_percent;
+ struct if_bandwidths iflpr_output_bw;
+ struct if_bandwidths iflpr_input_bw;
+ struct if_latencies iflpr_output_lt;
+ struct if_latencies iflpr_input_lt;
+};
+
+/*
+ * Structure for SIOCGIFQUEUESTATS
+ */
+struct if_qstatsreq {
+ char ifqr_name[IFNAMSIZ]; /* interface name */
+ u_int32_t ifqr_slot;
+ void *ifqr_buf __attribute__((aligned(8)));
+ int ifqr_len __attribute__((aligned(8)));
+};
+
+/*
+ * Node Proximity Metrics
+ */
+enum {
+ IFNET_NPM_THRESH_UNKNOWN = (-1),
+ IFNET_NPM_THRESH_NEAR = 30,
+ IFNET_NPM_THRESH_GENERAL = 70,
+ IFNET_NPM_THRESH_FAR = 100,
+};
+
+/*
+ * Received Signal Strength Indication [special values]
+ *
+ * IFNET_RSSI_UNKNOWN Metric is not (yet) known.
+ */
+enum {
+ IFNET_RSSI_UNKNOWN = ((-2147483647)-1), /* INT32_MIN */
+};
+
+
+/*
+ * DLIL KEV_DL_NODE_PRESENCE/KEV_DL_NODE_ABSENCE event structures
+ */
+struct kev_dl_node_presence {
+ struct net_event_data link_data;
+ struct sockaddr_in6 sin6_node_address;
+ struct sockaddr_dl sdl_node_address;
+ int32_t rssi;
+ int link_quality_metric;
+ int node_proximity_metric;
+ u_int8_t node_service_info[48];
+};
+
+struct kev_dl_node_absence {
+ struct net_event_data link_data;
+ struct sockaddr_in6 sin6_node_address;
+ struct sockaddr_dl sdl_node_address;
+};
+
+/*
+ * Structure for SIOC[SG]IFTHROTTLE
+ */
+struct if_throttlereq {
+ char ifthr_name[IFNAMSIZ]; /* interface name */
+ u_int32_t ifthr_level;
+};
+
+/*
+ * Interface throttling levels
+ *
+ * IFNET_THROTTLE_OFF The default throttling level (no throttling.)
+ * All service class queues operate normally according to the
+ * standard packet scheduler configuration.
+ * IFNET_THROTTLE_OPPORTUNISTIC One or more service class queues that
+ * are responsible for managing "opportunistic" traffics are
+ * suspended. Packets enqueued on those queues will be dropped
+ * and a flow advisory error will be generated to the data
+ * source. Existing packets in the queues will stay enqueued
+ * until the interface is no longer throttled, or until they
+ * are explicitly flushed.
+ */
+enum {
+ IFNET_THROTTLE_OFF = 0,
+ IFNET_THROTTLE_OPPORTUNISTIC = 1,
+#ifdef XNU_KERNEL_PRIVATE
+ IFNET_THROTTLE_MAX = 2,
+#endif /* XNU_KERNEL_PRIVATE */
+};
+
+/*
+ * Structure for SIOC[A/D]IFAGENTID
+ */
+struct if_agentidreq {
+ char ifar_name[IFNAMSIZ]; /* interface name */
+ uuid_t ifar_uuid; /* agent UUID to add or delete */
+};
+
+/*
+ * Structure for SIOCGIFAGENTIDS
+ */
+struct if_agentidsreq {
+ char ifar_name[IFNAMSIZ]; /* interface name */
+ u_int32_t ifar_count; /* number of agent UUIDs */
+ uuid_t *ifar_uuids; /* array of agent UUIDs */
+};
+
+#ifdef BSD_KERNEL_PRIVATE
+struct if_agentidsreq32 {
+ char ifar_name[IFNAMSIZ];
+ u_int32_t ifar_count;
+ user32_addr_t ifar_uuids;
+};
+struct if_agentidsreq64 {
+ char ifar_name[IFNAMSIZ];
+ u_int32_t ifar_count;
+ user64_addr_t ifar_uuids __attribute__((aligned(8)));
+};
+#endif /* BSD_KERNEL_PRIVATE */
+
+#define DLIL_MODIDLEN 20 /* same as IFNET_MODIDLEN */
+#define DLIL_MODARGLEN 12 /* same as IFNET_MODARGLEN */
+
+/*
+ * DLIL KEV_DL_ISSUES event structure
+ */
+struct kev_dl_issues {
+ struct net_event_data link_data;
+ u_int8_t modid[DLIL_MODIDLEN];
+ u_int64_t timestamp;
+ u_int8_t info[DLIL_MODARGLEN];
+};
+
+/*
+ * DLIL KEV_DL_RRC_STATE_CHANGED structure
+ */
+struct kev_dl_rrc_state {
+ struct net_event_data link_data;
+ u_int32_t rrc_state;
+};
+
+/*
+ * Length of network signature/fingerprint blob.
+ */
+#define IFNET_SIGNATURELEN 20
+
+/*
+ * Structure for SIOC[S/G]IFNETSIGNATURE
+ */
+struct if_nsreq {
+ char ifnsr_name[IFNAMSIZ];
+ u_int8_t ifnsr_family; /* address family */
+ u_int8_t ifnsr_len; /* data length */
+ u_int16_t ifnsr_flags; /* for future */
+ u_int8_t ifnsr_data[IFNET_SIGNATURELEN];
+};
+
+/*
+ * Structure for SIOC[S/G]IFORDER
+ *
+ * When setting, ifo_count is the number of u_int32_t interface indices
+ * in the ifo_ordered_indices array.
+ *
+ * When getting, if ifo_count is 0, the length of the ordered list will
+ * be returned. If the ifo_count is non-0, it is the number of u_int32_t
+ * interface indices allocated. Upon return, ifo_count will contain the number
+ * of indices copied into the array.
+ */
+struct if_order {
+ u_int32_t ifo_count;
+ u_int32_t ifo_reserved;
+ mach_vm_address_t ifo_ordered_indices; /* array of u_int32_t */
+};
+
+/*
+ * Struct for traffic class to DSCP mapping
+ */
+struct if_tdmreq {
+ char iftdm_name[IFNAMSIZ];
+ u_int32_t iftdm_len; /* byte length of the table */
+ struct netsvctype_dscp_map *iftdm_table;
+};
+
+#ifdef BSD_KERNEL_PRIVATE
+struct if_tdmreq32 {
+ char iftdm_name[IFNAMSIZ];
+ u_int32_t iftdm_len; /* byte length of the table */
+ user32_addr_t iftdm_table;
+};
+
+struct if_tdmreq64 {
+ char iftdm_name[IFNAMSIZ];
+ u_int32_t iftdm_len; /* byte length of the table */
+ user64_addr_t iftdm_table __attribute__((aligned(8)));
+};
+#endif
+
+#endif /* PRIVATE */