summaryrefslogtreecommitdiffstats
path: root/src/vnet/qos/qos.api
blob: 84addf0e4494cb87a245d5fbc7a1422177289ffb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
/* Hey Emacs use -*- mode: C -*- */
/*
 * Copyright (c) 2018 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @file
 * This file defines QoS record, store and mark API messages which are generally
 *    called through a shared memory interface.
 *
 * Definitions of verbs:
 *  store: write a QoS value into the buffer meta-data
 *  record: Extract a QoS value from a packet header and store it.
 *  mark: Make a change to the content of a packet header by writing a stored
 *        QoS value
 */
option version = "1.1.1";

import "vnet/ip/ip_types.api";
import "vnet/interface_types.api";

enum qos_source : u8
{
  QOS_API_SOURCE_EXT = 0,
  QOS_API_SOURCE_VLAN = 1,
  QOS_API_SOURCE_MPLS = 2,
  QOS_API_SOURCE_IP = 3,
};

/**
 * QoS store.
 * @param sw_if_index - The interface on which store is enabled.
 * @param input_source - The input source/layer at which the QoS bits are stored
 *                       See qos_source_t. This determines what packets have a
 *                       value stored. i.e. If IP is seleted this affects on IP
 *                       packets.
 * @param value - The value to store.
 */
typedef qos_store
{
  vl_api_interface_index_t sw_if_index;
  vl_api_qos_source_t input_source;
  u8 value;
};

/**
 * Enable/Disable QoS storing
 * The QoS bits from the packet at the specified input layer are copied
 * into the packet. Storing should be used in conjunction with marking
 * @param enable - enable=1 or disable the feature
 * @param store - Store configuration
 */
autoreply define qos_store_enable_disable
{
  u32 client_index;
  u32 context;
  bool enable [default=true];
  vl_api_qos_store_t store;
};

/**
 * Dump the QoS store configs
 */
define qos_store_dump
{
  u32 client_index;
  u32 context;
};

/**
 * Details of QoS recording configs
 */
define qos_store_details
{
  u32 context;
  vl_api_qos_store_t store;
};

/**
 * QoS recording.
 * @param sw_if_index - The interface on which recording is enabled.
 * @param input_source - The input source/layer at which the QoS bits
                         are copied from the packet. See qos_source_t.
 */
typedef qos_record
{
  vl_api_interface_index_t sw_if_index;
  vl_api_qos_source_t input_source;
};

/**
 * Enable/Disable QoS recording
 * The QoS bits from the packet at the specified input layer are copied
 * into the packet. Recording should be used in conjunction with marking
 * @param enable - enable=1 or disable the feature
 * @param record - Recording configuration
 */
autoreply define qos_record_enable_disable
{
  u32 client_index;
  u32 context;
  bool enable [default=true];
  vl_api_qos_record_t record;
};

/**
 * Dump the QoS record configs
 */
define qos_record_dump
{
  u32 client_index;
  u32 context;
};

/**
 * Details of QoS recording configs
 */
define qos_record_details
{
  u32 context;
  vl_api_qos_record_t record;
};

/**
 * @brief A row within a QoS map
 *  Each value translates from an input value to an output.
 */
typedef qos_egress_map_row
{
  u8 outputs[256];
};

/**
 * QoS Translation Map
 *
 * @param id - client provided identifier for the map
 * @param rows - one row (per-input source) of output values
 */
typedef qos_egress_map
{
  u32 id;
  vl_api_qos_egress_map_row_t rows[4];
};

/**
 *  @brief Update a QoS Map
 *   A QoS map, translates from the QoS value in the packet set by the 'record'
 *   feature, to the value used for output in the 'mark' feature.
 *   There is one row in the map for each input/record source.
 *   The MAP is then applied to the egress interface at for a given output source
 * @param map - The Map
 */
autoreply define qos_egress_map_update
{
  u32 client_index;
  u32 context;
  vl_api_qos_egress_map_t map;
};

/**
 * @brief Delete a Qos Map
 * @param map_id - ID of the map to delete
 */
autoreply define qos_egress_map_delete
{
  u32 client_index;
  u32 context;
  u32 id;
};

/**
 * Dump the QoS egress maps
 */
define qos_egress_map_dump
{
  u32 client_index;
  u32 context;
};

/**
 * QoS map details
 */
define qos_egress_map_details
{
  u32 context;
  vl_api_qos_egress_map_t map;
};

/**
 * QoS marking Cponfiguration
 * The QoS bits from the buffer are mapped (using the desired egress map)
 * into the header of the 'output-source'. Marking should be used in
 * conjunction with recording
 * @param sw_if_index - The interface on which recording is enabled.
 * @param output_source - The output source/layer at which the QoS bits
 *                        are written into the packet. See qos_source_t.
 * @param map_id - The ID of the MAP in which the translation from input
 *                 to output is performed.
 */
typedef qos_mark
{
  u32 sw_if_index;
  u32 map_id;
  vl_api_qos_source_t output_source;
};

/**
 * @brief Enable/Disable QoS marking
 * @param enable - enable=1 or disable the feature
 * @param mark - Marking config
 */
autoreply define qos_mark_enable_disable
{
  u32 client_index;
  u32 context;
  bool enable [default=true];
  vl_api_qos_mark_t mark;
};

/**
 * Dump QoS marking configs
 */
define qos_mark_dump
{
  u32 client_index;
  u32 context;
  vl_api_interface_index_t sw_if_index;
};

/**
 * QoS marking details
 */
autoreply define qos_mark_details
{
  u32 context;
  vl_api_qos_mark_t mark;
};

/*
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */