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 #ifndef __QOS_TYPES_H__
23 #define __QOS_TYPES_H__
25 #include <vnet/vnet.h>
28 * Sources for the QoS bits in the packet
30 typedef enum qos_source_t_
33 * Some external source, e.g. a plugin.
39 } __attribute__ ((packed)) qos_source_t;
42 * The maximum number of sources. defined outside the enum so switch
43 * statements don't need to handle a non-value nor use a default label
45 #define QOS_N_SOURCES (QOS_SOURCE_IP + 1)
47 #define QOS_SOURCE_NAMES { \
48 [QOS_SOURCE_EXT] = "ext", \
49 [QOS_SOURCE_IP] = "IP", \
50 [QOS_SOURCE_MPLS] = "MPLS", \
51 [QOS_SOURCE_VLAN] = "VLAN", \
54 #define FOR_EACH_QOS_SOURCE(_src) \
55 for (_src = QOS_SOURCE_EXT; \
56 _src <= QOS_SOURCE_IP; \
60 * format/unformat QoS source types
62 extern u8 *format_qos_source (u8 * s, va_list * args);
63 extern uword unformat_qos_source (unformat_input_t * input, va_list * args);
66 * Type, er, safety for us water based entities
68 typedef u8 qos_bits_t;
73 * fd.io coding-style-patch-verification: ON
76 * eval: (c-set-style "gnu")