2 *------------------------------------------------------------------
3 * Copyright (c) 2018 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *------------------------------------------------------------------
22 #include <vnet/qos/qos_types.h>
24 static const char *qos_source_names[] = QOS_SOURCE_NAMES;
27 format_qos_source (u8 * s, va_list * args)
29 int qs = va_arg (*args, int);
31 return (format (s, "%s", qos_source_names[qs]));
35 unformat_qos_source (unformat_input_t * input, va_list * args)
37 int *qs = va_arg (*args, int *);
39 if (unformat (input, "ip"))
41 else if (unformat (input, "mpls"))
42 *qs = QOS_SOURCE_MPLS;
43 else if (unformat (input, "ext"))
45 else if (unformat (input, "vlan"))
46 *qs = QOS_SOURCE_VLAN;
54 * fd.io coding-style-patch-verification: ON
57 * eval: (c-set-style "gnu")