blob: 5d775dafdfc7f26c01b27805e470294b4299352f [file] [log] [blame]
Pavel Kotucek0f971d82017-01-03 10:48:54 +01001/*
2 * Copyright (c) 2015-2016 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
Jakub Grajciar3eb8f202020-01-03 09:59:07 +010016option version = "1.1.1";
Neale Ranns31ed7442018-02-23 05:29:09 -080017import "vnet/fib/fib_types.api";
Neale Ranns097fa662018-05-01 05:17:55 -070018import "vnet/ip/ip_types.api";
Jakub Grajciar3eb8f202020-01-03 09:59:07 +010019import "vnet/interface_types.api";
Dave Barach0d056e52017-09-28 15:11:16 -040020
Pavel Kotucek0f971d82017-01-03 10:48:54 +010021/** \brief Bind/Unbind an MPLS local label to an IP prefix. i.e. create
22 a per-prefix label entry.
23 @param client_index - opaque cookie to identify the sender
24 @param context - sender context, to match reply w/ request
25 @param mb_mpls_table_id - The MPLS table-id the MPLS entry will be added in
26 @param mb_label - The MPLS label value to bind
27 @param mb_ip_table_id - The IP table-id of the IP prefix to bind to.
Pavel Kotucek0f971d82017-01-03 10:48:54 +010028 @param mb_is_bind - Bind or unbind
29 @param mb_is_ip4 - The prefix to bind to is IPv4
Ole Troan75761b92019-09-11 17:49:08 +020030 @param mb_prefix - IP prefix
Pavel Kotucek0f971d82017-01-03 10:48:54 +010031*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040032autoreply define mpls_ip_bind_unbind
Pavel Kotucek0f971d82017-01-03 10:48:54 +010033{
34 u32 client_index;
35 u32 context;
36 u32 mb_mpls_table_id;
37 u32 mb_label;
38 u32 mb_ip_table_id;
Jakub Grajciar3eb8f202020-01-03 09:59:07 +010039 bool mb_is_bind;
Neale Ranns097fa662018-05-01 05:17:55 -070040 vl_api_prefix_t mb_prefix;
Pavel Kotucek0f971d82017-01-03 10:48:54 +010041};
42
Paul Vinciguerrae7174822019-08-07 00:05:59 -040043typedef mpls_tunnel
Neale Ranns097fa662018-05-01 05:17:55 -070044{
Jakub Grajciar3eb8f202020-01-03 09:59:07 +010045 vl_api_interface_index_t mt_sw_if_index;
Neale Ranns097fa662018-05-01 05:17:55 -070046 u32 mt_tunnel_index;
Jakub Grajciar3eb8f202020-01-03 09:59:07 +010047 bool mt_l2_only;
48 bool mt_is_multicast;
IJsbrand Wijnands39ae0a02020-03-05 10:56:26 -080049 string mt_tag[64];
Neale Ranns097fa662018-05-01 05:17:55 -070050 u8 mt_n_paths;
51 vl_api_fib_path_t mt_paths[mt_n_paths];
52};
IJsbrand Wijnands39ae0a02020-03-05 10:56:26 -080053
Pavel Kotucek0f971d82017-01-03 10:48:54 +010054define mpls_tunnel_add_del
55{
56 u32 client_index;
57 u32 context;
Jakub Grajciar3eb8f202020-01-03 09:59:07 +010058 bool mt_is_add [default=true];
Neale Ranns097fa662018-05-01 05:17:55 -070059 vl_api_mpls_tunnel_t mt_tunnel;
Pavel Kotucek0f971d82017-01-03 10:48:54 +010060};
61
62/** \brief Reply for MPLS tunnel add / del request
63 @param context - returned sender context, to match reply w/ request
64 @param retval - return code
65 @param sw_if_index - SW interface index of the tunnel created
66*/
67define mpls_tunnel_add_del_reply
68{
69 u32 context;
70 i32 retval;
Jakub Grajciar3eb8f202020-01-03 09:59:07 +010071 vl_api_interface_index_t sw_if_index;
Neale Rannsf5fa5ae2018-09-26 05:07:25 -070072 u32 tunnel_index;
Pavel Kotucek0f971d82017-01-03 10:48:54 +010073};
74
75/** \brief Dump mpls eth tunnel table
76 @param client_index - opaque cookie to identify the sender
Neale Rannsf5fa5ae2018-09-26 05:07:25 -070077 @param sw_if_index - sw_if_index of the MPLS tunnel
78 (as returned from the create)
Pavel Kotucek0f971d82017-01-03 10:48:54 +010079*/
80define mpls_tunnel_dump
81{
82 u32 client_index;
83 u32 context;
Paul Vinciguerrac0e94412020-04-28 01:12:04 -040084 vl_api_interface_index_t sw_if_index [default=0xffffffff];
Pavel Kotucek0f971d82017-01-03 10:48:54 +010085};
86
Neale Ranns0f26c5a2017-03-01 15:12:11 -080087/** \brief mpls tunnel details
88*/
Ole Troandf87f802020-11-18 19:17:48 +010089define mpls_tunnel_details
Neale Ranns0f26c5a2017-03-01 15:12:11 -080090{
91 u32 context;
Neale Ranns097fa662018-05-01 05:17:55 -070092 vl_api_mpls_tunnel_t mt_tunnel;
Neale Ranns0f26c5a2017-03-01 15:12:11 -080093};
94
Pim van Pelt8d61c592023-06-10 16:46:34 +020095/** \brief Dump mpls enabled interface(s)
96 @param client_index - opaque cookie to identify the sender
97 @param sw_if_index - sw_if_index of a specific interface, or -1 (default)
98 to return all MPLS enabled interfaces
99*/
100define mpls_interface_dump
101{
102 u32 client_index;
103 u32 context;
104 vl_api_interface_index_t sw_if_index [default=0xffffffff];
105};
106
107/** \brief mpls enabled interface details
108*/
109define mpls_interface_details
110{
111 u32 context;
112 vl_api_interface_index_t sw_if_index;
113};
114
Neale Ranns0f26c5a2017-03-01 15:12:11 -0800115/** \brief MPLS Route Add / del route
116 @param client_index - opaque cookie to identify the sender
117 @param context - sender context, to match reply w/ request
Neale Ranns28ab9cc2017-08-14 07:18:42 -0700118 @param mt_table_id - The MPLS table-id the route is added in
119 @param mt_is_add - Is this a route add or delete
Neale Ranns2297af02017-09-12 09:45:04 -0700120 @param mt_name - A client provided name/tag for the table. If this
121 is not set by the client, then VPP will generate
Paul Vinciguerrac0e94412020-04-28 01:12:04 -0400122 something meaningful.
Neale Ranns28ab9cc2017-08-14 07:18:42 -0700123*/
Paul Vinciguerrae7174822019-08-07 00:05:59 -0400124typedef mpls_table
Neale Ranns097fa662018-05-01 05:17:55 -0700125{
126 u32 mt_table_id;
Jakub Grajciar3eb8f202020-01-03 09:59:07 +0100127 string mt_name[64];
Neale Ranns097fa662018-05-01 05:17:55 -0700128};
Neale Ranns28ab9cc2017-08-14 07:18:42 -0700129autoreply define mpls_table_add_del
130{
131 u32 client_index;
132 u32 context;
Jakub Grajciar3eb8f202020-01-03 09:59:07 +0100133 bool mt_is_add [default=true];
Neale Ranns097fa662018-05-01 05:17:55 -0700134 vl_api_mpls_table_t mt_table;
135};
136
137/** \brief Dump MPLS fib table
138 @param client_index - opaque cookie to identify the sender
139*/
140define mpls_table_dump
141{
142 u32 client_index;
143 u32 context;
144};
145
146define mpls_table_details
147{
148 u32 context;
149 vl_api_mpls_table_t mt_table;
150};
151
152/** \brief MPLS Route
Jakub Grajciar3eb8f202020-01-03 09:59:07 +0100153 @param mr_table_id - The MPLS table-id the route is added in
Neale Ranns097fa662018-05-01 05:17:55 -0700154 @param mr_label - The MPLS label value
155 @param mr_eos - The End of stack bit
Paul Vinciguerrac0e94412020-04-28 01:12:04 -0400156 @param mr_eos_proto - If EOS then this is the DPO packet's proto post pop
Neale Ranns097fa662018-05-01 05:17:55 -0700157 @param mr_is_multicast - Is this a multicast route
158 @param mr_n_paths - The number of paths
159 @param mr_paths - The paths
160*/
Paul Vinciguerrae7174822019-08-07 00:05:59 -0400161typedef mpls_route
Neale Ranns097fa662018-05-01 05:17:55 -0700162{
163 u32 mr_table_id;
164 u32 mr_label;
Jakub Grajciar3eb8f202020-01-03 09:59:07 +0100165 /* TODO: check data type */
Neale Ranns097fa662018-05-01 05:17:55 -0700166 u8 mr_eos;
167 u8 mr_eos_proto;
Jakub Grajciar3eb8f202020-01-03 09:59:07 +0100168 bool mr_is_multicast;
Neale Ranns097fa662018-05-01 05:17:55 -0700169 u8 mr_n_paths;
170 vl_api_fib_path_t mr_paths[mr_n_paths];
Neale Ranns28ab9cc2017-08-14 07:18:42 -0700171};
172
173/** \brief MPLS Route Add / del route
174 @param client_index - opaque cookie to identify the sender
175 @param context - sender context, to match reply w/ request
Neale Ranns0f26c5a2017-03-01 15:12:11 -0800176 @param mr_table_id - The MPLS table-id the route is added in
Neale Ranns0f26c5a2017-03-01 15:12:11 -0800177 @param mr_is_add - Is this a route add or delete
Neale Ranns0f26c5a2017-03-01 15:12:11 -0800178 @param mr_is_multipath - Is this route update a multipath - i.e. is this
179 a path addition to an existing route
Neale Ranns097fa662018-05-01 05:17:55 -0700180 @param mr_route - The Route
Neale Ranns0f26c5a2017-03-01 15:12:11 -0800181*/
Neale Ranns008dbe12018-09-07 09:32:36 -0700182define mpls_route_add_del
Neale Ranns0f26c5a2017-03-01 15:12:11 -0800183{
184 u32 client_index;
185 u32 context;
Jakub Grajciar3eb8f202020-01-03 09:59:07 +0100186 bool mr_is_add;
187 bool mr_is_multipath;
Neale Ranns097fa662018-05-01 05:17:55 -0700188 vl_api_mpls_route_t mr_route;
Neale Ranns0f26c5a2017-03-01 15:12:11 -0800189};
190
Neale Ranns008dbe12018-09-07 09:32:36 -0700191define mpls_route_add_del_reply
192{
193 u32 context;
194 i32 retval;
195 u32 stats_index;
196};
197
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100198/** \brief Dump MPLS fib table
199 @param client_index - opaque cookie to identify the sender
200*/
Neale Ranns097fa662018-05-01 05:17:55 -0700201define mpls_route_dump
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100202{
203 u32 client_index;
204 u32 context;
Neale Ranns097fa662018-05-01 05:17:55 -0700205 vl_api_mpls_table_t table;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100206};
207
208/** \brief mpls FIB table response
209 @param table_id - MPLS fib table id
210 @param s_bit - End-of-stack bit
211 @param label - MPLS label value
212 @param count - the number of fib_path in path
213 @param path - array of of fib_path structures
214*/
Ole Troandf87f802020-11-18 19:17:48 +0100215define mpls_route_details
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100216{
217 u32 context;
Neale Ranns097fa662018-05-01 05:17:55 -0700218 vl_api_mpls_route_t mr_route;
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100219};
220
Neale Rannsb8d44812017-11-10 06:53:54 -0800221/** \brief Enable or Disable MPLS on and interface
222 @param client_index - opaque cookie to identify the sender
223 @param context - sender context, to match reply w/ request
224 @param sw_if_index - index of the interface
225 @param enable - if non-zero enable, else disable
226*/
227autoreply define sw_interface_set_mpls_enable
228{
229 u32 client_index;
230 u32 context;
Jakub Grajciar3eb8f202020-01-03 09:59:07 +0100231 vl_api_interface_index_t sw_if_index;
232 bool enable [default=true];
Neale Rannsb8d44812017-11-10 06:53:54 -0800233};
234
Neale Ranns41a85c02022-08-09 01:24:41 +0000235counters mpls {
236 none {
237 severity info;
238 type counter64;
239 units "packets";
240 description "no error";
241 };
242 unknown_protocol {
243 severity error;
244 type counter64;
245 units "packets";
246 description "unknown protocol";
247 };
248 unsupported_version {
249 severity error;
250 type counter64;
251 units "packets";
252 description "unsupported version";
253 };
254 pkts_decap {
255 severity info;
256 type counter64;
257 units "packets";
258 description "MPLS input packets decapsulated";
259 };
260 pkts_encap {
261 severity info;
262 type counter64;
263 units "packets";
264 description "MPLS output packets encapsulated";
265 };
266 pkts_need_frag {
267 severity info;
268 type counter64;
269 units "packets";
270 description "MPLS output packets needs fragmentation";
271 };
272 no_label {
273 severity error;
274 type counter64;
275 units "packets";
276 description "MPLS no label for fib/dst";
277 };
278 ttl_expired {
279 severity error;
280 type counter64;
281 units "packets";
282 description "MPLS ttl expired";
283 };
284 s_not_set {
285 severity error;
286 type counter64;
287 units "packets";
288 description "MPLS s-bit not set";
289 };
290 bad_label {
291 severity error;
292 type counter64;
293 units "packets";
294 description "invalid FIB id in label";
295 };
296 not_ip4 {
297 severity error;
298 type counter64;
299 units "packets";
300 description "non-ip4 packets dropped";
301 };
302 disallowed_fib {
303 severity error;
304 type counter64;
305 units "packets";
306 description "disallowed FIB id";
307 };
308 not_enabled {
309 severity error;
310 type counter64;
311 units "packets";
312 description "MPLS not enabled";
313 };
314 drop {
315 severity error;
316 type counter64;
317 units "packets";
318 description "MPLS DROP DPO";
319 };
320 punt {
321 severity error;
322 type counter64;
323 units "packets";
324 description "MPLS PUNT DPO";
325 };
326};
327
328paths {
329 "/err/mpls-input" "mpls";
330 "/err/mpls-output" "mpls";
331 "/err/mpls-lookup" "mpls";
332 "/err/mpls-midchain" "mpls";
333 "/err/mpls-adj-incomplete" "mpls";
334 "/err/mpls-frag" "mpls";
335};
336
Pavel Kotucek0f971d82017-01-03 10:48:54 +0100337/*
338 * Local Variables:
339 * eval: (c-set-style "gnu")
340 * End:
341 */