aboutsummaryrefslogtreecommitdiffstats
path: root/src/vat
diff options
context:
space:
mode:
authorBrian Russell <brian@graphiant.com>2021-02-08 15:33:18 +0000
committerNeale Ranns <neale@graphiant.com>2021-02-11 08:21:56 +0000
commite3845d79bfa819355ac5085d73f3b8f2ffae2042 (patch)
treeef78beac6d512cbabb43546e41664b3cda1d05a1 /src/vat
parent1bb74944a385ea1b8f50b975359cb1c7ca94afb4 (diff)
policer: use ip dscp
Use the common IP definitions of DSCP rather than duplicating in the policer code. Type: improvement Signed-off-by: Brian Russell <brian@graphiant.com> Change-Id: Iff4bc789356edc290b9c31eca33e93cf5b6211bf
Diffstat (limited to 'src/vat')
-rw-r--r--src/vat/api_format.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index cf9c7742d46..649737bc64f 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -530,11 +530,10 @@ unformat_dscp (unformat_input_t * input, va_list * va)
u8 *r = va_arg (*va, u8 *);
if (0);
-#define _(v,f,str) else if (unformat (input, str)) *r = VNET_DSCP_##f;
- foreach_vnet_dscp
+#define _(v, f) else if (unformat (input, #f)) *r = IP_DSCP_##f;
+ foreach_ip_dscp
#undef _
- else
- return 0;
+ else return 0;
return 1;
}
@@ -2751,14 +2750,14 @@ format_dscp (u8 * s, va_list * va)
switch (i)
{
-#define _(v,f,str) case VNET_DSCP_##f: t = str; break;
- foreach_vnet_dscp
+#define _(v, f) \
+ case IP_DSCP_##f: \
+ return (format (s, "%s", #f));
+ foreach_ip_dscp
#undef _
- default:
- return format (s, "ILLEGAL");
}
s = format (s, "%s", t);
- return s;
+ return (format (s, "ILLEGAL"));
}
static void