]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/net/if.h
xnu-3789.70.16.tar.gz
[apple/xnu.git] / bsd / net / if.h
index c2c99314bff9f55ce3aa17a0475e750082064b0a..9d93391f4f5af9f48223a8925cab36b9ccb23855 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2015 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  *
 #define        _NET_IF_H_
 
 #include <sys/cdefs.h>
+#include <net/net_kev.h>
 
 #define        IF_NAMESIZE     16
 
 #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
 #include <sys/appleapiopts.h>
 #ifdef __APPLE__
-/*
- * Define Data-Link event subclass, and associated
- * events.
- */
-
-#define        KEV_DL_SUBCLASS 2
-
-#define        KEV_DL_SIFFLAGS                         1
-#define        KEV_DL_SIFMETRICS                       2
-#define        KEV_DL_SIFMTU                           3
-#define        KEV_DL_SIFPHYS                          4
-#define        KEV_DL_SIFMEDIA                         5
-#define        KEV_DL_SIFGENERIC                       6
-#define        KEV_DL_ADDMULTI                         7
-#define        KEV_DL_DELMULTI                         8
-#define        KEV_DL_IF_ATTACHED                      9
-#define        KEV_DL_IF_DETACHING                     10
-#define        KEV_DL_IF_DETACHED                      11
-#define        KEV_DL_LINK_OFF                         12
-#define        KEV_DL_LINK_ON                          13
-#define        KEV_DL_PROTO_ATTACHED                   14
-#define        KEV_DL_PROTO_DETACHED                   15
-#define        KEV_DL_LINK_ADDRESS_CHANGED             16
-#define        KEV_DL_WAKEFLAGS_CHANGED                17
-#define        KEV_DL_IF_IDLE_ROUTE_REFCNT             18
-#define        KEV_DL_IFCAP_CHANGED                    19
-#define        KEV_DL_LINK_QUALITY_METRIC_CHANGED      20
-#define        KEV_DL_NODE_PRESENCE                    21
-#define        KEV_DL_NODE_ABSENCE                     22
-#define        KEV_DL_MASTER_ELECTED                   23
-#define        KEV_DL_ISSUES                           24
-#define        KEV_DL_IFDELEGATE_CHANGED               25
-#define        KEV_DL_AWDL_RESTRICTED                  26
-#define        KEV_DL_AWDL_UNRESTRICTED                27
-#define        KEV_DL_RRC_STATE_CHANGED                28
 
 #include <net/if_var.h>
 #include <sys/types.h>
 #ifdef PRIVATE
 #include <net/if_dl.h>
 #include <netinet/in.h>
-#endif
+#include <mach/vm_types.h>
+#endif /* PRIVATE */
 #endif
 
 struct if_clonereq {
@@ -162,6 +129,7 @@ struct if_clonereq32 {
 #define        IFEF_ENQUEUE_MULTI      0x00000002      /* enqueue multiple packets at once */
 #define        IFEF_DELAY_START        0x00000004      /* delay start callback */
 #define        IFEF_PROBE_CONNECTIVITY 0x00000008      /* Probe connections going over this interface */
+#define        IFEF_QOSMARKING_CAPABLE 0x00000010      /* XXX Obsolete, to be removed */
 #define        IFEF_IPV6_DISABLED      0x00000020      /* coupled to ND6_IFF_IFDISABLED */
 #define        IFEF_ACCEPT_RTADV       0x00000040      /* accepts IPv6 RA on the interface */
 #define        IFEF_TXSTART            0x00000080      /* has start callback */
@@ -169,7 +137,13 @@ struct if_clonereq32 {
 #define        IFEF_VLAN               0x00000200      /* interface has one or more vlans */
 #define        IFEF_BOND               0x00000400      /* interface is part of bond */
 #define        IFEF_ARPLL              0x00000800      /* ARP for IPv4LL addresses */
-#define        IFEF_NOWINDOWSCALE      0x00001000      /* Don't scale TCP window on iface */
+/* #define     IFEF_NOWINDOWSCALE      0x00001000 */   /* Don't scale TCP window on iface */
+/*
+ * XXX IFEF_NOAUTOIPV6LL is deprecated and should be done away with.
+ * Configd pretty much manages the interface configuration.
+ * Rather than looking at the flag we check if a specific LLA
+ * has to be configured or the IID has to be generated by kernel.
+ */
 #define        IFEF_NOAUTOIPV6LL       0x00002000      /* Need explicit IPv6 LL address */
 #define        IFEF_EXPENSIVE          0x00004000      /* Data access has a cost */
 #define        IFEF_IPV4_ROUTER        0x00008000      /* interior when in IPv4 router mode */
@@ -184,11 +158,20 @@ struct if_clonereq32 {
 #define        IFEF_2KCL               0x00800000      /* prefers 2K cluster (socket based tunnel) */
 #define        IFEF_ECN_ENABLE         0x01000000      /* use ECN for TCP connections on the interface */
 #define        IFEF_ECN_DISABLE        0x02000000      /* do not use ECN for TCP connections on the interface */
+#define        IFEF_SKYWALK_NATIVE     0x04000000      /* Native Skywalk support */
+#define        IFEF_3CA                0x08000000      /* Capable of 3CA */
 #define        IFEF_SENDLIST           0x10000000      /* Supports tx packet lists */
 #define        IFEF_DIRECTLINK         0x20000000      /* point-to-point topology */
-#define        _IFEF_INUSE             0x40000000      /* deprecated */
+#define        IFEF_QOSMARKING_ENABLED 0x40000000      /* OoS marking is enabled */
 #define        IFEF_UPDOWNCHANGE       0x80000000      /* up/down state is changing */
+
 #ifdef XNU_KERNEL_PRIVATE
+/*
+ * Extra flags
+ */
+#define        IFXF_WAKE_ON_MAGIC_PACKET       0x00000001 /* wake on magic packet */
+#define        IFXF_TIMESTAMP_ENABLED                  0x00000002 /* time stamping enabled */
+
 /*
  * Current requirements for an AWDL interface.  Setting/clearing IFEF_AWDL
  * will also trigger the setting/clearing of the rest of the flags.  Once
@@ -247,12 +230,16 @@ struct if_clonereq32 {
 #define        IFCAP_LRO               0x00080 /* can do Large Receive Offload */
 #define        IFCAP_AV                0x00100 /* can do 802.1 AV Bridging */
 #define        IFCAP_TXSTATUS          0x00200 /* can return linklevel xmit status */
+#define        IFCAP_SKYWALK           0x00400 /* Skywalk mode supported/enabled */
+#define        IFCAP_HW_TIMESTAMP      0x00800 /* Time stamping in hardware */
+#define        IFCAP_SW_TIMESTAMP      0x01000 /* Time stamping in software */
 
 #define        IFCAP_HWCSUM    (IFCAP_RXCSUM | IFCAP_TXCSUM)
 #define        IFCAP_TSO       (IFCAP_TSO4 | IFCAP_TSO6)
 
 #define        IFCAP_VALID (IFCAP_HWCSUM | IFCAP_TSO | IFCAP_LRO | IFCAP_VLAN_MTU | \
-       IFCAP_VLAN_HWTAGGING | IFCAP_JUMBO_MTU | IFCAP_AV | IFCAP_TXSTATUS)
+       IFCAP_VLAN_HWTAGGING | IFCAP_JUMBO_MTU | IFCAP_AV | IFCAP_TXSTATUS | \
+       IFCAP_SKYWALK | IFCAP_SW_TIMESTAMP | IFCAP_HW_TIMESTAMP)
 
 #define        IFQ_MAXLEN      128
 #define        IFNET_SLOWHZ    1       /* granularity is 1 second */
@@ -471,6 +458,7 @@ struct      ifreq {
 #define        IFRTYPE_SUBFAMILY_WIFI          3
 #define        IFRTYPE_SUBFAMILY_THUNDERBOLT   4
 #define        IFRTYPE_SUBFAMILY_RESERVED      5
+#define        IFRTYPE_SUBFAMILY_INTCOPROC     6
                } ifru_type;
                u_int32_t ifru_functional_type;
 #define IFRTYPE_FUNCTIONAL_UNKNOWN     0
@@ -479,7 +467,8 @@ struct      ifreq {
 #define IFRTYPE_FUNCTIONAL_WIFI_INFRA  3
 #define IFRTYPE_FUNCTIONAL_WIFI_AWDL   4
 #define IFRTYPE_FUNCTIONAL_CELLULAR    5
-#define IFRTYPE_FUNCTIONAL_LAST                5
+#define        IFRTYPE_FUNCTIONAL_INTCOPROC    6          
+#define IFRTYPE_FUNCTIONAL_LAST                6
                u_int32_t ifru_expensive;
                u_int32_t ifru_2kcl;
                struct {
@@ -490,8 +479,13 @@ struct     ifreq {
                u_int32_t ifru_probe_connectivity;
                u_int32_t ifru_ecn_mode;
 #define        IFRTYPE_ECN_DEFAULT             0
-#define        IFRTYPE_ECN_ENABLE                      1
-#define        IFRTYPE_ECN_DISABLE                     2
+#define        IFRTYPE_ECN_ENABLE              1
+#define        IFRTYPE_ECN_DISABLE             2
+               u_int32_t ifru_qosmarking_mode;
+#define        IFRTYPE_QOSMARKING_MODE_NONE            0
+#define        IFRTYPE_QOSMARKING_FASTLANE     1
+               u_int32_t ifru_qosmarking_enabled;
+               u_int32_t ifru_disable_output;
 #endif /* PRIVATE */
        } ifr_ifru;
 #define        ifr_addr        ifr_ifru.ifru_addr      /* address */
@@ -535,6 +529,12 @@ struct     ifreq {
 #define ifr_interface_state    ifr_ifru.ifru_interface_state
 #define        ifr_probe_connectivity  ifr_ifru.ifru_probe_connectivity
 #define        ifr_ecn_mode    ifr_ifru.ifru_ecn_mode
+#define        ifr_qosmarking_mode     ifr_ifru.ifru_qosmarking_mode
+#define        ifr_fastlane_capable    ifr_qosmarking_mode
+#define ifr_qosmarking_enabled ifr_ifru.ifru_qosmarking_enabled
+#define        ifr_fastlane_enabled    ifr_qosmarking_enabled
+#define        ifr_disable_output      ifr_ifru.ifru_disable_output
+
 #endif /* PRIVATE */
 };
 
@@ -741,8 +741,9 @@ struct if_descreq {
 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                   = 2,
+       IFNET_SCHED_MODEL_MAX                   = 3,
 #endif /* XNU_KERNEL_PRIVATE */
 };
 
@@ -912,6 +913,47 @@ struct if_nsreq {
        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 */
 
 #ifdef KERNEL