Trivial: Clean up some typos.
[vpp.git] / src / vnet / qos / qos_types.h
1 /*
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:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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  *------------------------------------------------------------------
16  */
17
18 /**
19  * QoS types
20  */
21
22 #ifndef __QOS_TYPES_H__
23 #define __QOS_TYPES_H__
24
25 #include <vnet/vnet.h>
26
27 /**
28  * Sources for the QoS bits in the packet
29  */
30 typedef enum qos_source_t_
31 {
32   /**
33    * Some external source, e.g. a plugin.
34    */
35   QOS_SOURCE_EXT,
36   QOS_SOURCE_VLAN,
37   QOS_SOURCE_MPLS,
38   QOS_SOURCE_IP,
39 } __attribute__ ((packed)) qos_source_t;
40
41 /**
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
44  */
45 #define QOS_N_SOURCES (QOS_SOURCE_IP + 1)
46
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",              \
52 }
53
54 #define FOR_EACH_QOS_SOURCE(_src)    \
55     for (_src = QOS_SOURCE_EXT;      \
56          _src <= QOS_SOURCE_IP;      \
57          _src++)
58
59 /**
60  * format/unformat QoS source types
61  */
62 extern u8 *format_qos_source (u8 * s, va_list * args);
63 extern uword unformat_qos_source (unformat_input_t * input, va_list * args);
64
65 /**
66  * Type, er, safety for us water based entities
67  */
68 typedef u8 qos_bits_t;
69
70 #endif
71
72 /*
73  * fd.io coding-style-patch-verification: ON
74  *
75  * Local Variables:
76  * eval: (c-set-style "gnu")
77  * End:
78  */