From e3845d79bfa819355ac5085d73f3b8f2ffae2042 Mon Sep 17 00:00:00 2001 From: Brian Russell Date: Mon, 8 Feb 2021 15:33:18 +0000 Subject: 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 Change-Id: Iff4bc789356edc290b9c31eca33e93cf5b6211bf --- src/vat/api_format.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/vat') 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 -- cgit 1.2.3-korg