]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netinet/ip.h
xnu-3789.1.32.tar.gz
[apple/xnu.git] / bsd / netinet / ip.h
index 421b0baf00147e18fc77aab4f429416e514a60e2..0574f5c23689110be997c55be7bc28962f099740 100644 (file)
@@ -1,14 +1,19 @@
 /*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
  *
- * @APPLE_LICENSE_HEADER_START@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ * 
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
  * 
  * The Original Code and all software distributed under the License are
  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
@@ -18,7 +23,7 @@
  * Please see the License for the specific language governing rights and
  * limitations under the License.
  * 
- * @APPLE_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -59,7 +64,7 @@
 #ifndef _NETINET_IP_H_
 #define _NETINET_IP_H_
 #include <sys/appleapiopts.h>
-#include <sys/types.h>>                /* XXX temporary hack to get u_ types */
+#include <sys/types.h>         /* XXX temporary hack to get u_ types */
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 
@@ -116,10 +121,23 @@ struct ip {
 #define        IPTOS_THROUGHPUT        0x08
 #define        IPTOS_RELIABILITY       0x04
 #define        IPTOS_MINCOST           0x02
-/* ECN bits proposed by Sally Floyd */
-#define        IPTOS_CE                0x01    /* congestion experienced */
-#define        IPTOS_ECT               0x02    /* ECN-capable transport */
+#if 1
+/* ECN RFC3168 obsoletes RFC2481, and these will be deprecated soon. */
+#define        IPTOS_CE                0x01
+#define        IPTOS_ECT               0x02
+#endif
+
+#define        IPTOS_DSCP_SHIFT        2
 
+/*
+ * ECN (Explicit Congestion Notification) codepoints in RFC3168
+ * mapped to the lower 2 bits of the TOS field.
+ */
+#define        IPTOS_ECN_NOTECT        0x00    /* not-ECT */
+#define        IPTOS_ECN_ECT1          0x01    /* ECN-capable transport (1) */
+#define        IPTOS_ECN_ECT0          0x02    /* ECN-capable transport (0) */
+#define        IPTOS_ECN_CE            0x03    /* congestion experienced */
+#define        IPTOS_ECN_MASK          0x03    /* ECN field mask */
 
 /*
  * Definitions for IP precedence (also in ip_tos) (hopefully unused)
@@ -133,6 +151,17 @@ struct ip {
 #define        IPTOS_PREC_PRIORITY             0x20
 #define        IPTOS_PREC_ROUTINE              0x00
 
+#ifdef PRIVATE
+/*
+ * Definitions of traffic class for use within wireless LAN. 
+ * Mainly used by AFP for backup. Not recommended for general use.
+ */
+#define IP_TCLASS_BE                   0x00    /* standard, best effort */
+#define IP_TCLASS_BK                   0x20    /* Background, low priority */
+#define IP_TCLASS_VI                   0x80    /* Interactive */
+#define IP_TCLASS_VO                   0xc0    /* Signalling */
+
+#endif
 /*
  * Definitions for options.
  */
@@ -207,7 +236,7 @@ struct      ip_timestamp {
  */
 #define        MAXTTL          255             /* maximum time to live (seconds) */
 #define        IPDEFTTL        64              /* default ttl, from RFC 1340 */
-#define        IPFRAGTTL       60              /* time to live for frags, slowhz */
+#define        IPFRAGTTL       30              /* time to live for frags (seconds) */
 #define        IPTTLDEC        1               /* subtracted when forwarding */
 
 #define        IP_MSS          576             /* default maximum segment size */