+#ifdef PRIVATE
+/*
+ * Link Quality Metrics
+ *
+ * IFNET_LQM_THRESH_OFF Metric is not available; device is off.
+ * IFNET_LQM_THRESH_UNKNOWN Metric is not (yet) known.
+ * IFNET_LQM_THRESH_BAD Link quality is considered bad by driver.
+ * IFNET_LQM_THRESH_POOR Link quality is considered poor by driver.
+ * IFNET_LQM_THRESH_GOOD Link quality is considered good by driver.
+ */
+enum {
+ IFNET_LQM_THRESH_OFF = (-2),
+ IFNET_LQM_THRESH_UNKNOWN = (-1),
+ IFNET_LQM_THRESH_ABORT = 10,
+ IFNET_LQM_THRESH_MINIMALLY_VIABLE = 20,
+ IFNET_LQM_THRESH_POOR = 50,
+ IFNET_LQM_THRESH_GOOD = 100
+};
+#define IFNET_LQM_THRESH_BAD IFNET_LQM_THRESH_ABORT
+
+#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;
+ u_int64_t iflpr_input_tbr_rate;
+ 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 */
+};