FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
qos.api
Go to the documentation of this file.
1 /* Hey Emacs use -*- mode: C -*- */
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  * @file
19  * This file defines QoS record, store and mark API messages which are generally
20  * called through a shared memory interface.
21  *
22  * Definitions of verbs:
23  * store: write a QoS value into the buffer meta-data
24  * record: Extract a QoS value from a packet header and store it.
25  * mark: Make a change to the content of a packet header by writing a stored
26  * QoS value
27  */
28 option version = "1.1.1";
29 
30 import "vnet/ip/ip_types.api";
31 import "vnet/interface_types.api";
32 
33 enum qos_source : u8
34 {
39 };
40 
41 /**
42  * QoS store.
43  * @param sw_if_index - The interface on which store is enabled.
44  * @param input_source - The input source/layer at which the QoS bits are stored
45  * See qos_source_t. This determines what packets have a
46  * value stored. i.e. If IP is seleted this affects on IP
47  * packets.
48  * @param value - The value to store.
49  */
50 typedef qos_store
51 {
52  vl_api_interface_index_t sw_if_index;
53  vl_api_qos_source_t input_source;
55 };
56 
57 /**
58  * Enable/Disable QoS storing
59  * The QoS bits from the packet at the specified input layer are copied
60  * into the packet. Storeing should be used in conjunction with marking
61  * @param enable - enable=1 or disable the feature
62  * @param store - Store configuration
63  */
64 autoreply define qos_store_enable_disable
65 {
68  bool enable [default=true];
69  vl_api_qos_store_t store;
70 };
71 
72 /**
73  * Dump the QoS store configs
74  */
75 define qos_store_dump
76 {
79 };
80 
81 /**
82  * Details of QoS recording configs
83  */
84 define qos_store_details
85 {
87  vl_api_qos_store_t store;
88 };
89 
90 /**
91  * QoS recording.
92  * @param sw_if_index - The interface on which recording is enabled.
93  * @param input_source - The input source/layer at which the QoS bits
94  are copied from the packet. See qos_source_t.
95  */
96 typedef qos_record
97 {
98  vl_api_interface_index_t sw_if_index;
99  vl_api_qos_source_t input_source;
100 };
101 
102 /**
103  * Enable/Disable QoS recording
104  * The QoS bits from the packet at the specified input layer are copied
105  * into the packet. Recording should be used in conjunction with marking
106  * @param enable - enable=1 or disable the feature
107  * @param record - Recording configuration
108  */
109 autoreply define qos_record_enable_disable
110 {
113  bool enable [default=true];
114  vl_api_qos_record_t record;
115 };
116 
117 /**
118  * Dump the QoS record configs
119  */
120 define qos_record_dump
121 {
124 };
125 
126 /**
127  * Details of QoS recording configs
128  */
129 define qos_record_details
130 {
132  vl_api_qos_record_t record;
133 };
134 
135 /**
136  * @brief A row within a QoS map
137  * Each value translates from an input value to an output.
138  */
139 typedef qos_egress_map_row
140 {
141  u8 outputs[256];
142 };
143 
144 /**
145  * QoS Translation Map
146  *
147  * @param id - client provided identifier for the map
148  * @param rows - one row (per-input source) of output values
149  */
150 typedef qos_egress_map
151 {
152  u32 id;
153  vl_api_qos_egress_map_row_t rows[4];
154 };
155 
156 /**
157  * @brief Update a QoS Map
158  * A QoS map, translates from the QoS value in the packet set by the 'record'
159  * feature, to the value used for output in the 'mark' feature.
160  * There is one row in the map for each input/record source.
161  * The MAP is then applied to the egress interface at for a given output source
162  * @param map - The Map
163  */
164 autoreply define qos_egress_map_update
165 {
168  vl_api_qos_egress_map_t map;
169 };
170 
171 /**
172  * @brief Delete a Qos Map
173  * @param map_id - ID of the map to delete
174  */
175 autoreply define qos_egress_map_delete
176 {
180 };
181 
182 /**
183  * Dump the QoS egress maps
184  */
185 define qos_egress_map_dump
186 {
189 };
190 
191 /**
192  * QoS map details
193  */
194 define qos_egress_map_details
195 {
197  vl_api_qos_egress_map_t map;
198 };
199 
200 /**
201  * QoS marking Cponfiguration
202  * The QoS bits from the buffer are mapped (using the desired egress map)
203  * into the header of the 'output-source'. Marking should be used in
204  * conjunction with recording
205  * @param sw_if_index - The interface on which recording is enabled.
206  * @param output_source - The output source/layer at which the QoS bits
207  * are written into the packet. See qos_source_t.
208  * @param map_id - The ID of the MAP in which the translation from input
209  * to output is performed.
210  */
211 typedef qos_mark
212 {
215  vl_api_qos_source_t output_source;
216 };
217 
218 /**
219  * @brief Enable/Disable QoS marking
220  * @param enable - enable=1 or disable the feature
221  * @param mark - Marking config
222  */
223 autoreply define qos_mark_enable_disable
224 {
227  bool enable [default=true];
228  vl_api_qos_mark_t mark;
229 };
230 
231 /**
232  * Dump QoS marking configs
233  */
234 define qos_mark_dump
235 {
238  vl_api_interface_index_t sw_if_index;
239 };
240 
241 /**
242  * QoS marking details
243  */
244 autoreply define qos_mark_details
245 {
247  vl_api_qos_mark_t mark;
248 };
249 
250 /*
251  * Local Variables:
252  * eval: (c-set-style "gnu")
253  * End:
254  */
vl_api_qos_source_t output_source
Definition: qos.api:215
vl_api_qos_record_t record
Definition: qos.api:132
u32 map_id
Definition: qos.api:214
unsigned char u8
Definition: types.h:56
u8 id[64]
Definition: dhcp.api:160
void qos_egress_map_delete(qos_egress_map_id_t mid)
typedef qos_egress_map
QoS Translation Map.
Definition: qos.api:151
vl_api_qos_egress_map_row_t rows[4]
Definition: qos.api:153
typedef qos_record
QoS recording.
Definition: qos.api:97
unsigned int u32
Definition: types.h:88
vl_api_qos_source_t input_source
Definition: qos.api:53
void qos_egress_map_update(qos_egress_map_id_t mid, qos_source_t input_source, qos_bits_t *values)
Add a qos-egress map to an interface.
vl_api_qos_store_t store
Definition: qos.api:87
typedef qos_store
QoS store.
Definition: qos.api:51
vl_api_qos_mark_t mark
Definition: qos.api:228
qos_source
Definition: qos.api:33
vl_api_qos_egress_map_t map
Definition: qos.api:197
option version
Definition: qos.api:28
u8 value
Definition: qos.api:54
vl_api_qos_record_t record
Definition: qos.api:114
typedef qos_mark
QoS marking Cponfiguration The QoS bits from the buffer are mapped (using the desired egress map) int...
Definition: qos.api:212
vl_api_qos_store_t store
Definition: qos.api:69
vl_api_qos_egress_map_t map
Definition: qos.api:168
typedef qos_egress_map_row
A row within a QoS map Each value translates from an input value to an output.
Definition: qos.api:140
vl_api_qos_mark_t mark
Definition: qos.api:247
vl_api_interface_index_t sw_if_index
Definition: qos.api:238
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:33