qos: QoS dump APIs
[vpp.git] / src / vnet / qos / qos.api
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 /** \file
18
19     This file defines QoS record and mark API messages which are generally
20     called through a shared memory interface.
21 */
22
23 option version = "1.0.0";
24
25 enum qos_source : u8
26 {
27   QOS_API_SOURCE_EXT = 0,
28   QOS_API_SOURCE_VLAN = 1,
29   QOS_API_SOURCE_MPLS = 2,
30   QOS_API_SOURCE_IP = 3,
31 };
32
33 /**
34  * QoS recording.
35  * @param sw_if_index - The interface on which recording is enabled.
36  * @param input_source - The input source/layer at which the QoS bits
37                          are copied from the packet. See qos_source_t.
38  */
39 typedef qos_record
40 {
41   u32 sw_if_index;
42   vl_api_qos_source_t input_source;
43 };
44
45 /**
46  * Enable/Disable QoS recording
47  * The QoS bits from the packet at the specified input layer are copied
48  * into the packet. Recording should be used in conjunction with marking
49  * @param enable - enable=1 or disable the feature
50  * @param record - Recording configuration
51  */
52 autoreply define qos_record_enable_disable
53 {
54   u32 client_index;
55   u32 context;
56   u8 enable;
57   vl_api_qos_record_t record;
58 };
59
60 /**
61  * Dump the QoS record configs
62  */
63 define qos_record_dump
64 {
65   u32 client_index;
66   u32 context;
67 };
68
69 /**
70  * Details of QoS recording configs
71  */
72 define qos_record_details
73 {
74   u32 context;
75   vl_api_qos_record_t record;
76 };
77
78 /**
79  * @brief A row within a QoS map
80  *  Each value translates from an input value to an output.
81  */
82 typedef qos_egress_map_row
83 {
84   u8 outputs[256];
85 };
86
87 /**
88  * QoS Translation Map
89  *
90  * @param id - client provided identifier for the map
91  * @param rows - one row (per-input source) of output values
92  */
93 typedef qos_egress_map
94 {
95   u32 id;
96   vl_api_qos_egress_map_row_t rows[4];
97 };
98
99 /**
100  *  @brief Update a QoS Map
101  *   A QoS map, translates from the QoS value in the packet set by the 'record'
102  *   feature, to the value used for output in the 'mark' feature.
103  *   There is one row in the map for each input/record source.
104  *   The MAP is then applied to the egress interface at for a given output source
105  * @param map - The Map
106  */
107 autoreply define qos_egress_map_update
108 {
109   u32 client_index;
110   u32 context;
111   vl_api_qos_egress_map_t map;
112 };
113
114 /**
115  * @brief Delete a Qos Map
116  * @param map_id - ID of the map to delete
117  */
118 autoreply define qos_egress_map_delete
119 {
120   u32 client_index;
121   u32 context;
122   u32 id;
123 };
124
125 /**
126  * Dump the QoS egress maps
127  */
128 define qos_egress_map_dump
129 {
130   u32 client_index;
131   u32 context;
132 };
133
134 /**
135  * QoS map details
136  */
137 define qos_egress_map_details
138 {
139   u32 context;
140   vl_api_qos_egress_map_t map;
141 };
142
143 /**
144  * QoS marking Cponfiguration
145  * The QoS bits from the buffer are mapped (using the desired egress map)
146  * into the header of the 'output-source'. Marking should be used in
147  * conjunction with recording
148  * @param sw_if_index - The interface on which recording is enabled.
149  * @param output_source - The output source/layer at which the QoS bits
150  *                        are written into the packet. See qos_source_t.
151  * @param map_id - The ID of the MAP in which the translation from input
152  *                 to output is performed.
153  */
154 typedef qos_mark
155 {
156   u32 sw_if_index;
157   u32 map_id;
158   vl_api_qos_source_t output_source;
159 };
160
161 /**
162  * @brief Enable/Disable QoS marking
163  * @param enable - enable=1 or disable the feature
164  * @param mark - Marking config
165  */
166 autoreply define qos_mark_enable_disable
167 {
168   u32 client_index;
169   u32 context;
170   u8 enable;
171   vl_api_qos_mark_t mark;
172 };
173
174 /**
175  * Dump QoS marking configs
176  */
177 define qos_mark_dump
178 {
179   u32 client_index;
180   u32 context;
181   u32 sw_if_index;
182 };
183
184 /**
185  * QoS marking details
186  */
187 autoreply define qos_mark_details
188 {
189   u32 context;
190   vl_api_qos_mark_t mark;
191 };
192
193 /*
194  * Local Variables:
195  * eval: (c-set-style "gnu")
196  * End:
197  */