1 /* Hey Emacs use -*- mode: C -*- */
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:
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * This file defines QoS record, store and mark API messages which are generally
20 * called through a shared memory interface.
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
28 option version = "1.1.1";
30 import "vnet/ip/ip_types.api";
31 import "vnet/interface_types.api";
35 QOS_API_SOURCE_EXT = 0,
36 QOS_API_SOURCE_VLAN = 1,
37 QOS_API_SOURCE_MPLS = 2,
38 QOS_API_SOURCE_IP = 3,
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
48 * @param value - The value to store.
52 vl_api_interface_index_t sw_if_index;
53 vl_api_qos_source_t input_source;
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
64 autoreply define qos_store_enable_disable
68 bool enable [default=true];
69 vl_api_qos_store_t store;
73 * Dump the QoS store configs
82 * Details of QoS recording configs
84 define qos_store_details
87 vl_api_qos_store_t store;
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.
98 vl_api_interface_index_t sw_if_index;
99 vl_api_qos_source_t input_source;
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
109 autoreply define qos_record_enable_disable
113 bool enable [default=true];
114 vl_api_qos_record_t record;
118 * Dump the QoS record configs
120 define qos_record_dump
127 * Details of QoS recording configs
129 define qos_record_details
132 vl_api_qos_record_t record;
136 * @brief A row within a QoS map
137 * Each value translates from an input value to an output.
139 typedef qos_egress_map_row
145 * QoS Translation Map
147 * @param id - client provided identifier for the map
148 * @param rows - one row (per-input source) of output values
150 typedef qos_egress_map
153 vl_api_qos_egress_map_row_t rows[4];
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
164 autoreply define qos_egress_map_update
168 vl_api_qos_egress_map_t map;
172 * @brief Delete a Qos Map
173 * @param map_id - ID of the map to delete
175 autoreply define qos_egress_map_delete
183 * Dump the QoS egress maps
185 define qos_egress_map_dump
194 define qos_egress_map_details
197 vl_api_qos_egress_map_t map;
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.
215 vl_api_qos_source_t output_source;
219 * @brief Enable/Disable QoS marking
220 * @param enable - enable=1 or disable the feature
221 * @param mark - Marking config
223 autoreply define qos_mark_enable_disable
227 bool enable [default=true];
228 vl_api_qos_mark_t mark;
232 * Dump QoS marking configs
238 vl_api_interface_index_t sw_if_index;
242 * QoS marking details
244 autoreply define qos_mark_details
247 vl_api_qos_mark_t mark;
252 * eval: (c-set-style "gnu")