summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip.c
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.c
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.c')
-rw-r--r--src/vnet/ip/ip.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/vnet/ip/ip.c b/src/vnet/ip/ip.c
index 6e8ac7c437d..133767bd06c 100644
--- a/src/vnet/ip/ip.c
+++ b/src/vnet/ip/ip.c
@@ -294,6 +294,23 @@ format_ip_address_family (u8 * s, va_list * args)
return (format (s, "unknown"));
}
+u8 *
+format_ip_dscp (u8 * s, va_list * va)
+{
+ ip_dscp_t dscp = va_arg (*va, u32); // int promotion of u8
+
+ switch (dscp)
+ {
+#define _(n,v) \
+ case IP_DSCP_##v: \
+ return (format (s, "%s", #v));
+ foreach_ip_dscp
+#undef _
+ }
+
+ return (format (s, "unknon"));
+}
+
/*
* fd.io coding-style-patch-verification: ON
*