Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet Fill in missing IPTOS defines (from Linux/OpenBSD)
details: https://anonhg.NetBSD.org/src/rev/27fbfb039975
branches: trunk
changeset: 767615:27fbfb039975
user: christos <christos%NetBSD.org@localhost>
date: Sun Jul 24 18:06:08 2011 +0000
description:
Fill in missing IPTOS defines (from Linux/OpenBSD)
diffstat:
sys/netinet/ip.h | 81 +++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 66 insertions(+), 15 deletions(-)
diffs (109 lines):
diff -r 1f2634b88215 -r 27fbfb039975 sys/netinet/ip.h
--- a/sys/netinet/ip.h Sun Jul 24 15:11:38 2011 +0000
+++ b/sys/netinet/ip.h Sun Jul 24 18:06:08 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip.h,v 1.31 2007/12/25 18:33:46 perry Exp $ */
+/* $NetBSD: ip.h,v 1.32 2011/07/24 18:06:08 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -73,22 +73,48 @@
/*
* Definitions for IP type of service (ip_tos)
*/
-#define IPTOS_LOWDELAY 0x10
-#define IPTOS_THROUGHPUT 0x08
-#define IPTOS_RELIABILITY 0x04
-/* IPTOS_LOWCOST 0x02 XXX */
/*
- * Definitions for IP precedence (also in ip_tos) (hopefully unused)
+ * Definitions for DiffServ Codepoints as per RFC2474
*/
-#define IPTOS_PREC_NETCONTROL 0xe0
-#define IPTOS_PREC_INTERNETCONTROL 0xc0
-#define IPTOS_PREC_CRITIC_ECP 0xa0
-#define IPTOS_PREC_FLASHOVERRIDE 0x80
-#define IPTOS_PREC_FLASH 0x60
-#define IPTOS_PREC_IMMEDIATE 0x40
-#define IPTOS_PREC_PRIORITY 0x20
-#define IPTOS_PREC_ROUTINE 0x00
+#define IPTOS_DSCP_CS0 0x00
+#define IPTOS_DSCP_CS1 0x20
+#define IPTOS_DSCP_AF11 0x28
+#define IPTOS_DSCP_AF12 0x30
+#define IPTOS_DSCP_AF13 0x38
+#define IPTOS_DSCP_CS2 0x40
+#define IPTOS_DSCP_AF21 0x48
+#define IPTOS_DSCP_AF22 0x50
+#define IPTOS_DSCP_AF23 0x58
+#define IPTOS_DSCP_CS3 0x60
+#define IPTOS_DSCP_AF31 0x68
+#define IPTOS_DSCP_AF32 0x70
+#define IPTOS_DSCP_AF33 0x78
+#define IPTOS_DSCP_CS4 0x80
+#define IPTOS_DSCP_AF41 0x88
+#define IPTOS_DSCP_AF42 0x90
+#define IPTOS_DSCP_AF43 0x98
+#define IPTOS_DSCP_CS5 0xa0
+#define IPTOS_DSCP_EF 0xb8
+#define IPTOS_DSCP_CS6 0xc0
+#define IPTOS_DSCP_CS7 0xe0
+
+/*
+ * Definitions for DiffServ Class Selector Codepoints
+ */
+#define IPTOS_CLASS_CS0 0x00
+#define IPTOS_CLASS_CS1 0x20
+#define IPTOS_CLASS_CS2 0x40
+#define IPTOS_CLASS_CS3 0x60
+#define IPTOS_CLASS_CS4 0x80
+#define IPTOS_CLASS_CS5 0xa0
+#define IPTOS_CLASS_CS6 0xc0
+#define IPTOS_CLASS_CS7 0xe0
+#define IPTOS_CLASS_DEFAULT IPTOS_CLASS_CS0
+#define IPTOS_CLASS_MASK 0xe0
+#define IPTOS_CLASS(cs) ((cs) & IPTOS_CLASS_MASK)
+#define IPTOS_DSCP_MASK 0xfc
+#define IPTOS_DSCP(cp) ((cp) & IPTOS_DSCP_MASK)
/*
* ECN (Explicit Congestion Notification) codepoints in RFC3168
@@ -99,6 +125,32 @@
#define IPTOS_ECN_ECT0 0x02 /* ECN-capable transport (0) */
#define IPTOS_ECN_CE 0x03 /* congestion experienced */
#define IPTOS_ECN_MASK 0x03 /* ECN field mask */
+#define IPTOS_ECN(cn) ((cn) & IPTOS_ECN_MASK)
+#define IPTOS_ECN_NOT_ECT 0x00
+
+/*
+ * Definitions for IP type of service per RFC1349 (ip_tos)
+ * DEPRECATED
+ */
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_RELIABILITY 0x04
+#define IPTOS_MINCOST 0x02
+/* ECN RFC3168 obsoletes RFC2481, and these will be deprecated soon. */
+#define IPTOS_CE 0x01 /* congestion experienced */
+#define IPTOS_ECT 0x02 /* ECN-capable transport */
+
+/*
+ * Definitions for IP precedence per RFC1195 (also in ip_tos) (hopefully unused)
+ */
+#define IPTOS_PREC_NETCONTROL 0xe0
+#define IPTOS_PREC_INTERNETCONTROL 0xc0
+#define IPTOS_PREC_CRITIC_ECP 0xa0
+#define IPTOS_PREC_FLASHOVERRIDE 0x80
+#define IPTOS_PREC_FLASH 0x60
+#define IPTOS_PREC_IMMEDIATE 0x40
+#define IPTOS_PREC_PRIORITY 0x20
+#define IPTOS_PREC_ROUTINE 0x00
/*
* Definitions for options.
@@ -191,4 +243,3 @@
u_int16_t ippseudo_len; /* protocol length */
} __packed;
#endif /* !_NETINET_IP_H_ */
-
Home |
Main Index |
Thread Index |
Old Index