summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip_packet.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-07-19 14:01:02 +0000
committerDamjan Marion <dmarion@me.com>2019-07-26 13:27:14 +0000
commit038e1dfbdfd0bd785852c364011da0a1d828093e (patch)
tree4e3a039c240e9e91123ff363f909caabc4c909f4 /src/vnet/ip/ip_packet.h
parent08ac303e43492c8b25911340fb62811289dd3935 (diff)
dhcp ip: DSCP settings for transmitted DHCP packets
Type: feature - Define the ip_dscp_t and use in the IP headers - Add DSCP setting to the DHCP client for use with packet TX Change-Id: If220dde0017ea78793747d65f53e11daf23a28fa Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip_packet.h')
-rw-r--r--src/vnet/ip/ip_packet.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/vnet/ip/ip_packet.h b/src/vnet/ip/ip_packet.h
index c4990976188..97b3c96b2ce 100644
--- a/src/vnet/ip/ip_packet.h
+++ b/src/vnet/ip/ip_packet.h
@@ -84,6 +84,44 @@ typedef enum
#undef _
} ip_multicast_group_t;
+
+/**
+ * The set of RFC defined DSCP values.
+ */
+#define foreach_ip_dscp \
+ _(0, CS0) \
+ _(8, CS1) \
+ _(10, AF11) \
+ _(12, AF12) \
+ _(14, AF13) \
+ _(16, CS2) \
+ _(18, AF21) \
+ _(20, AF22) \
+ _(22, AF23) \
+ _(24, CS3) \
+ _(26, AF31) \
+ _(28, AF32) \
+ _(30, AF33) \
+ _(32, CS4) \
+ _(34, AF41) \
+ _(36, AF42) \
+ _(38, AF43) \
+ _(40, CS5) \
+ _(46, EF) \
+ _(48, CS6) \
+ _(50, CS7)
+
+typedef enum ip_dscp_t_
+{
+#define _(n,f) IP_DSCP_##f = n,
+ foreach_ip_dscp
+#undef _
+} __clib_packed ip_dscp_t;
+
+STATIC_ASSERT_SIZEOF (ip_dscp_t, 1);
+
+extern u8 *format_ip_dscp (u8 * s, va_list * va);
+
/* IP checksum support. */
static_always_inline u16