blob: 84addf0e4494cb87a245d5fbc7a1422177289ffb [file] [log] [blame]
Neale Rannsed234e72018-09-05 09:36:05 -07001/* Hey Emacs use -*- mode: C -*- */
Neale Ranns039cbfe2018-02-27 03:45:38 -08002/*
Neale Rannsed234e72018-09-05 09:36:05 -07003 * Copyright (c) 2018 Cisco and/or its affiliates.
Neale Ranns039cbfe2018-02-27 03:45:38 -08004 * 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
Neale Ranns83832e72019-07-31 02:48:02 -070017/**
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 */
Jakub Grajciar4b76c582020-01-03 10:01:03 +010028option version = "1.1.1";
Neale Ranns039cbfe2018-02-27 03:45:38 -080029
Neale Ranns83832e72019-07-31 02:48:02 -070030import "vnet/ip/ip_types.api";
Jakub Grajciar4b76c582020-01-03 10:01:03 +010031import "vnet/interface_types.api";
Neale Ranns039cbfe2018-02-27 03:45:38 -080032
Neale Ranns5281a902019-07-23 08:16:19 -070033enum qos_source : u8
Neale Rannsed234e72018-09-05 09:36:05 -070034{
35 QOS_API_SOURCE_EXT = 0,
36 QOS_API_SOURCE_VLAN = 1,
37 QOS_API_SOURCE_MPLS = 2,
38 QOS_API_SOURCE_IP = 3,
39};
40
Neale Ranns5281a902019-07-23 08:16:19 -070041/**
Neale Ranns83832e72019-07-31 02:48:02 -070042 * 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 */
50typedef qos_store
51{
Jakub Grajciar4b76c582020-01-03 10:01:03 +010052 vl_api_interface_index_t sw_if_index;
Neale Ranns83832e72019-07-31 02:48:02 -070053 vl_api_qos_source_t input_source;
54 u8 value;
55};
56
57/**
58 * Enable/Disable QoS storing
59 * The QoS bits from the packet at the specified input layer are copied
Nathan Skrzypczak2c77ae42021-09-29 15:36:51 +020060 * into the packet. Storing should be used in conjunction with marking
Neale Ranns83832e72019-07-31 02:48:02 -070061 * @param enable - enable=1 or disable the feature
62 * @param store - Store configuration
63 */
64autoreply define qos_store_enable_disable
65{
66 u32 client_index;
67 u32 context;
Jakub Grajciar4b76c582020-01-03 10:01:03 +010068 bool enable [default=true];
Neale Ranns83832e72019-07-31 02:48:02 -070069 vl_api_qos_store_t store;
70};
71
72/**
73 * Dump the QoS store configs
74 */
75define qos_store_dump
76{
77 u32 client_index;
78 u32 context;
79};
80
81/**
82 * Details of QoS recording configs
83 */
84define qos_store_details
85{
86 u32 context;
87 vl_api_qos_store_t store;
88};
89
90/**
Neale Ranns5281a902019-07-23 08:16:19 -070091 * 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 */
96typedef qos_record
97{
Jakub Grajciar4b76c582020-01-03 10:01:03 +010098 vl_api_interface_index_t sw_if_index;
Neale Ranns5281a902019-07-23 08:16:19 -070099 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 */
Neale Ranns039cbfe2018-02-27 03:45:38 -0800109autoreply define qos_record_enable_disable
110{
111 u32 client_index;
112 u32 context;
Jakub Grajciar4b76c582020-01-03 10:01:03 +0100113 bool enable [default=true];
Neale Ranns5281a902019-07-23 08:16:19 -0700114 vl_api_qos_record_t record;
Neale Ranns039cbfe2018-02-27 03:45:38 -0800115};
116
Neale Ranns5281a902019-07-23 08:16:19 -0700117/**
118 * Dump the QoS record configs
119 */
120define qos_record_dump
Neale Ranns039cbfe2018-02-27 03:45:38 -0800121{
Neale Ranns5281a902019-07-23 08:16:19 -0700122 u32 client_index;
123 u32 context;
Neale Ranns039cbfe2018-02-27 03:45:38 -0800124};
125
Neale Ranns5281a902019-07-23 08:16:19 -0700126/**
127 * Details of QoS recording configs
128 */
129define qos_record_details
130{
131 u32 context;
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 */
139typedef 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 */
150typedef 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 */
Neale Ranns039cbfe2018-02-27 03:45:38 -0800164autoreply define qos_egress_map_update
165{
166 u32 client_index;
167 u32 context;
Neale Ranns5281a902019-07-23 08:16:19 -0700168 vl_api_qos_egress_map_t map;
Neale Ranns039cbfe2018-02-27 03:45:38 -0800169};
170
Neale Ranns5281a902019-07-23 08:16:19 -0700171/**
172 * @brief Delete a Qos Map
173 * @param map_id - ID of the map to delete
174 */
Neale Ranns039cbfe2018-02-27 03:45:38 -0800175autoreply define qos_egress_map_delete
176{
177 u32 client_index;
178 u32 context;
Neale Ranns5281a902019-07-23 08:16:19 -0700179 u32 id;
Neale Ranns039cbfe2018-02-27 03:45:38 -0800180};
181
Neale Ranns5281a902019-07-23 08:16:19 -0700182/**
183 * Dump the QoS egress maps
184 */
185define qos_egress_map_dump
186{
187 u32 client_index;
188 u32 context;
189};
190
191/**
192 * QoS map details
193 */
194define qos_egress_map_details
195{
196 u32 context;
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 */
211typedef qos_mark
212{
213 u32 sw_if_index;
214 u32 map_id;
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 */
Neale Ranns039cbfe2018-02-27 03:45:38 -0800223autoreply define qos_mark_enable_disable
224{
225 u32 client_index;
226 u32 context;
Jakub Grajciar4b76c582020-01-03 10:01:03 +0100227 bool enable [default=true];
Neale Ranns5281a902019-07-23 08:16:19 -0700228 vl_api_qos_mark_t mark;
229};
230
231/**
232 * Dump QoS marking configs
233 */
234define qos_mark_dump
235{
236 u32 client_index;
237 u32 context;
Jakub Grajciar4b76c582020-01-03 10:01:03 +0100238 vl_api_interface_index_t sw_if_index;
Neale Ranns5281a902019-07-23 08:16:19 -0700239};
240
241/**
242 * QoS marking details
243 */
244autoreply define qos_mark_details
245{
246 u32 context;
247 vl_api_qos_mark_t mark;
Neale Ranns039cbfe2018-02-27 03:45:38 -0800248};
249
250/*
251 * Local Variables:
252 * eval: (c-set-style "gnu")
253 * End:
254 */