blob: dcd9ce5d0112f36fa40f78beedbb3239660e37c0 [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 */
28option version = "1.1.0";
Neale Ranns039cbfe2018-02-27 03:45:38 -080029
Neale Ranns83832e72019-07-31 02:48:02 -070030import "vnet/ip/ip_types.api";
Neale Ranns039cbfe2018-02-27 03:45:38 -080031
Neale Ranns5281a902019-07-23 08:16:19 -070032enum qos_source : u8
Neale Rannsed234e72018-09-05 09:36:05 -070033{
34 QOS_API_SOURCE_EXT = 0,
35 QOS_API_SOURCE_VLAN = 1,
36 QOS_API_SOURCE_MPLS = 2,
37 QOS_API_SOURCE_IP = 3,
38};
39
Neale Ranns5281a902019-07-23 08:16:19 -070040/**
Neale Ranns83832e72019-07-31 02:48:02 -070041 * QoS store.
42 * @param sw_if_index - The interface on which store is enabled.
43 * @param input_source - The input source/layer at which the QoS bits are stored
44 * See qos_source_t. This determines what packets have a
45 * value stored. i.e. If IP is seleted this affects on IP
46 * packets.
47 * @param value - The value to store.
48 */
49typedef qos_store
50{
51 u32 sw_if_index;
52 vl_api_qos_source_t input_source;
53 u8 value;
54};
55
56/**
57 * Enable/Disable QoS storing
58 * The QoS bits from the packet at the specified input layer are copied
59 * into the packet. Storeing should be used in conjunction with marking
60 * @param enable - enable=1 or disable the feature
61 * @param store - Store configuration
62 */
63autoreply define qos_store_enable_disable
64{
65 u32 client_index;
66 u32 context;
67 u8 enable;
68 vl_api_qos_store_t store;
69};
70
71/**
72 * Dump the QoS store configs
73 */
74define qos_store_dump
75{
76 u32 client_index;
77 u32 context;
78};
79
80/**
81 * Details of QoS recording configs
82 */
83define qos_store_details
84{
85 u32 context;
86 vl_api_qos_store_t store;
87};
88
89/**
Neale Ranns5281a902019-07-23 08:16:19 -070090 * QoS recording.
91 * @param sw_if_index - The interface on which recording is enabled.
92 * @param input_source - The input source/layer at which the QoS bits
93 are copied from the packet. See qos_source_t.
94 */
95typedef qos_record
96{
97 u32 sw_if_index;
98 vl_api_qos_source_t input_source;
99};
100
101/**
102 * Enable/Disable QoS recording
103 * The QoS bits from the packet at the specified input layer are copied
104 * into the packet. Recording should be used in conjunction with marking
105 * @param enable - enable=1 or disable the feature
106 * @param record - Recording configuration
107 */
Neale Ranns039cbfe2018-02-27 03:45:38 -0800108autoreply define qos_record_enable_disable
109{
110 u32 client_index;
111 u32 context;
Neale Ranns039cbfe2018-02-27 03:45:38 -0800112 u8 enable;
Neale Ranns5281a902019-07-23 08:16:19 -0700113 vl_api_qos_record_t record;
Neale Ranns039cbfe2018-02-27 03:45:38 -0800114};
115
Neale Ranns5281a902019-07-23 08:16:19 -0700116/**
117 * Dump the QoS record configs
118 */
119define qos_record_dump
Neale Ranns039cbfe2018-02-27 03:45:38 -0800120{
Neale Ranns5281a902019-07-23 08:16:19 -0700121 u32 client_index;
122 u32 context;
Neale Ranns039cbfe2018-02-27 03:45:38 -0800123};
124
Neale Ranns5281a902019-07-23 08:16:19 -0700125/**
126 * Details of QoS recording configs
127 */
128define qos_record_details
129{
130 u32 context;
131 vl_api_qos_record_t record;
132};
133
134/**
135 * @brief A row within a QoS map
136 * Each value translates from an input value to an output.
137 */
138typedef qos_egress_map_row
139{
140 u8 outputs[256];
141};
142
143/**
144 * QoS Translation Map
145 *
146 * @param id - client provided identifier for the map
147 * @param rows - one row (per-input source) of output values
148 */
149typedef qos_egress_map
150{
151 u32 id;
152 vl_api_qos_egress_map_row_t rows[4];
153};
154
155/**
156 * @brief Update a QoS Map
157 * A QoS map, translates from the QoS value in the packet set by the 'record'
158 * feature, to the value used for output in the 'mark' feature.
159 * There is one row in the map for each input/record source.
160 * The MAP is then applied to the egress interface at for a given output source
161 * @param map - The Map
162 */
Neale Ranns039cbfe2018-02-27 03:45:38 -0800163autoreply define qos_egress_map_update
164{
165 u32 client_index;
166 u32 context;
Neale Ranns5281a902019-07-23 08:16:19 -0700167 vl_api_qos_egress_map_t map;
Neale Ranns039cbfe2018-02-27 03:45:38 -0800168};
169
Neale Ranns5281a902019-07-23 08:16:19 -0700170/**
171 * @brief Delete a Qos Map
172 * @param map_id - ID of the map to delete
173 */
Neale Ranns039cbfe2018-02-27 03:45:38 -0800174autoreply define qos_egress_map_delete
175{
176 u32 client_index;
177 u32 context;
Neale Ranns5281a902019-07-23 08:16:19 -0700178 u32 id;
Neale Ranns039cbfe2018-02-27 03:45:38 -0800179};
180
Neale Ranns5281a902019-07-23 08:16:19 -0700181/**
182 * Dump the QoS egress maps
183 */
184define qos_egress_map_dump
185{
186 u32 client_index;
187 u32 context;
188};
189
190/**
191 * QoS map details
192 */
193define qos_egress_map_details
194{
195 u32 context;
196 vl_api_qos_egress_map_t map;
197};
198
199/**
200 * QoS marking Cponfiguration
201 * The QoS bits from the buffer are mapped (using the desired egress map)
202 * into the header of the 'output-source'. Marking should be used in
203 * conjunction with recording
204 * @param sw_if_index - The interface on which recording is enabled.
205 * @param output_source - The output source/layer at which the QoS bits
206 * are written into the packet. See qos_source_t.
207 * @param map_id - The ID of the MAP in which the translation from input
208 * to output is performed.
209 */
210typedef qos_mark
211{
212 u32 sw_if_index;
213 u32 map_id;
214 vl_api_qos_source_t output_source;
215};
216
217/**
218 * @brief Enable/Disable QoS marking
219 * @param enable - enable=1 or disable the feature
220 * @param mark - Marking config
221 */
Neale Ranns039cbfe2018-02-27 03:45:38 -0800222autoreply define qos_mark_enable_disable
223{
224 u32 client_index;
225 u32 context;
Neale Ranns039cbfe2018-02-27 03:45:38 -0800226 u8 enable;
Neale Ranns5281a902019-07-23 08:16:19 -0700227 vl_api_qos_mark_t mark;
228};
229
230/**
231 * Dump QoS marking configs
232 */
233define qos_mark_dump
234{
235 u32 client_index;
236 u32 context;
237 u32 sw_if_index;
238};
239
240/**
241 * QoS marking details
242 */
243autoreply define qos_mark_details
244{
245 u32 context;
246 vl_api_qos_mark_t mark;
Neale Ranns039cbfe2018-02-27 03:45:38 -0800247};
248
249/*
250 * Local Variables:
251 * eval: (c-set-style "gnu")
252 * End:
253 */