FD.io VPP  v18.07.1-19-g511ce25
Vector Packet Processing
qos_types.h
Go to the documentation of this file.
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 tyeps
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  */
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  */
qos_source_t_
QoS tyeps.
Definition: qos_types.h:30
unsigned char u8
Definition: types.h:56
Some external source, e.g.
Definition: qos_types.h:35
u8 * format_qos_source(u8 *s, va_list *args)
format/unformat QoS source types
Definition: qos_types.c:27
struct _unformat_input_t unformat_input_t
uword unformat_qos_source(unformat_input_t *input, va_list *args)
Definition: qos_types.c:35
u64 uword
Definition: types.h:112
u8 qos_bits_t
Type, er, safety for us water based entities.
Definition: qos_types.h:68