blob: cd1809817733ea3f8e9a58cbc6c068b341995459 [file] [log] [blame]
Neale Ranns008dbe12018-09-07 09:32:36 -07001/* Hey Emacs use -*- mode: C -*- */
Dave Barachb5e8a772016-12-06 12:04:42 -05002/*
Neale Ranns008dbe12018-09-07 09:32:36 -07003 * Copyright (c) 2018 Cisco and/or its affiliates.
Dave Barachb5e8a772016-12-06 12:04:42 -05004 * 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 vpp IP control-plane API messages which are generally
Jakub Grajciar58989a32019-10-08 14:05:18 +020020 called through a shared memory interface.
Dave Barachb5e8a772016-12-06 12:04:42 -050021*/
22
Aloys Augustin6e4cfb52021-09-16 20:53:14 +020023option version = "3.2.0";
Neale Ranns097fa662018-05-01 05:17:55 -070024
Jakub Grajciar58989a32019-10-08 14:05:18 +020025import "vnet/interface_types.api";
Neale Ranns31ed7442018-02-23 05:29:09 -080026import "vnet/fib/fib_types.api";
Neale Rannsde5b08f2018-08-29 06:37:18 -070027import "vnet/ethernet/ethernet_types.api";
Neale Ranns097fa662018-05-01 05:17:55 -070028import "vnet/mfib/mfib_types.api";
Ole Troan668605f2019-12-09 16:08:27 +010029import "vnet/interface_types.api";
Dave Barach0d056e52017-09-28 15:11:16 -040030
Neale Ranns097fa662018-05-01 05:17:55 -070031/** \brief An IP table
Neale Ranns28ab9cc2017-08-14 07:18:42 -070032 @param is_ipv6 - V4 or V6 table
33 @param table_id - table ID associated with the route
Paul Vinciguerrac0e94412020-04-28 01:12:04 -040034 This table ID will apply to both the unicast
35 and multicast FIBs
Neale Ranns2297af02017-09-12 09:45:04 -070036 @param name - A client provided name/tag for the table. If this is
37 not set by the client, then VPP will generate something
Paul Vinciguerrac0e94412020-04-28 01:12:04 -040038 meaningful.
Neale Ranns28ab9cc2017-08-14 07:18:42 -070039*/
Paul Vinciguerrae7174822019-08-07 00:05:59 -040040typedef ip_table
Neale Ranns097fa662018-05-01 05:17:55 -070041{
42 u32 table_id;
Ole Troan668605f2019-12-09 16:08:27 +010043 bool is_ip6;
44 string name[64];
Neale Ranns097fa662018-05-01 05:17:55 -070045};
46
47/** \brief Add / del table request
48 A table can be added multiple times, but need be deleted only once.
49 @param client_index - opaque cookie to identify the sender
50 @param context - sender context, to match reply w/ request
51*/
Neale Ranns28ab9cc2017-08-14 07:18:42 -070052autoreply define ip_table_add_del
53{
54 u32 client_index;
55 u32 context;
Jakub Grajciar58989a32019-10-08 14:05:18 +020056 bool is_add [default=true];
Neale Ranns097fa662018-05-01 05:17:55 -070057 vl_api_ip_table_t table;
Neale Ranns28ab9cc2017-08-14 07:18:42 -070058};
59
Aloys Augustin6e4cfb52021-09-16 20:53:14 +020060/** \brief Allocate an unused table
61 A table can be added multiple times.
62 If a large number of tables are in use (millions), this API might
63 fail to find a free ID with very low probability, and will return
64 EAGAIN. A subsequent attempt may be successful.
65 @param client_index - opaque cookie to identify the sender
66 @param context - sender context, to match reply w/ request
67 @param table - if table.table_id == ~0, vpp allocates an unused table_id and
68 proceeds as in ip_table_add_del with is_add = true
69 if table.table_id != ~0, vpp uses the table.table_id and
70 proceeds as in ip_table_add_del with is_add = true
71 table.table_id should never be 0
72*/
73define ip_table_allocate
74{
75 u32 client_index;
76 u32 context;
77
78 vl_api_ip_table_t table;
79};
80
81define ip_table_allocate_reply
82{
83 u32 context;
84 i32 retval;
85
86 vl_api_ip_table_t table;
87};
88
Neale Ranns097fa662018-05-01 05:17:55 -070089/** \brief Dump IP all fib tables
Dave Barachb5e8a772016-12-06 12:04:42 -050090 @param client_index - opaque cookie to identify the sender
Neale Ranns097fa662018-05-01 05:17:55 -070091 @param context - sender context, to match reply w/ request
Dave Barachb5e8a772016-12-06 12:04:42 -050092*/
Neale Ranns097fa662018-05-01 05:17:55 -070093define ip_table_dump
Dave Barachb5e8a772016-12-06 12:04:42 -050094{
95 u32 client_index;
96 u32 context;
97};
98
Neale Ranns9db6ada2019-11-08 12:42:31 +000099/** \brief IP table replace being
100
101 The use-case is that, for some unspecified reason, the control plane
102 has a very different set of entries it wants in the table than VPP
103 currently has. The CP would thus like to 'replace' VPP's current table
104 only by specifying what the new set of entries shall be, i.e. it is not
Paul Vinciguerrac0e94412020-04-28 01:12:04 -0400105 going to delete anything that already exists.
106 the CP declares the start of this procedure with this begin_replace
Neale Ranns9db6ada2019-11-08 12:42:31 +0000107 API Call, and when it has populated all the entries it wants, it calls
Paul Vinciguerrac0e94412020-04-28 01:12:04 -0400108 the below end_replace API. From this point on it is of course free
Neale Ranns9db6ada2019-11-08 12:42:31 +0000109 to add and delete entries as usual.
110 The underlying mechanism by which VPP implements this replace is
111 purposefully left unspecified.
112
113 @param client_index - opaque cookie to identify the sender
114 @param context - sender context, to match reply w/ request
115 @param table - The table to resync
116*/
117autoreply define ip_table_replace_begin
118{
119 u32 client_index;
120 u32 context;
121 vl_api_ip_table_t table;
122};
123
124/** \brief IP table replace end
125
126 see replace start/
127
128 @param client_index - opaque cookie to identify the sender
129 @param context - sender context, to match reply w/ request
130 @param table - The table that has converged
131*/
132autoreply define ip_table_replace_end
133{
134 u32 client_index;
135 u32 context;
136 vl_api_ip_table_t table;
137};
138
139/** \brief IP table flush
140 Flush a table of all routes
141 @param client_index - opaque cookie to identify the sender
142 @param context - sender context, to match reply w/ request
143 @param table - The table to flush
144*/
145autoreply define ip_table_flush
146{
147 u32 client_index;
148 u32 context;
149 vl_api_ip_table_t table;
150};
151
Dave Barachb5e8a772016-12-06 12:04:42 -0500152/** \brief IP FIB table response
Neale Ranns097fa662018-05-01 05:17:55 -0700153 @param context - sender context
154 @param table - description of the table
Dave Barachb5e8a772016-12-06 12:04:42 -0500155*/
Ole Troandf87f802020-11-18 19:17:48 +0100156define ip_table_details
Dave Barachb5e8a772016-12-06 12:04:42 -0500157{
158 u32 context;
Neale Ranns097fa662018-05-01 05:17:55 -0700159 vl_api_ip_table_t table;
Dave Barachb5e8a772016-12-06 12:04:42 -0500160};
161
Neale Ranns097fa662018-05-01 05:17:55 -0700162/** \brief An IP route
163 @param table_id The IP table the route is in
164 @param stats_index The index of the route in the stats segment
165 @param prefix the prefix for the route
166 @param n_paths The number of paths the route has
Neale Ranns976b2592019-12-04 06:11:00 +0000167 @param src The entity adding the route. either 0 for default
168 or a value returned from fib_source_sdd.
Neale Ranns097fa662018-05-01 05:17:55 -0700169 @param paths The paths of the route
Dave Barachb5e8a772016-12-06 12:04:42 -0500170*/
Paul Vinciguerrae7174822019-08-07 00:05:59 -0400171typedef ip_route
Neale Ranns097fa662018-05-01 05:17:55 -0700172{
173 u32 table_id;
174 u32 stats_index;
175 vl_api_prefix_t prefix;
176 u8 n_paths;
177 vl_api_fib_path_t paths[n_paths];
178};
Neale Ranns976b2592019-12-04 06:11:00 +0000179typedef ip_route_v2
180{
181 u32 table_id;
182 u32 stats_index;
183 vl_api_prefix_t prefix;
184 u8 n_paths;
185 u8 src;
186 vl_api_fib_path_t paths[n_paths];
187};
Neale Ranns097fa662018-05-01 05:17:55 -0700188
189/** \brief Add / del route request
190 @param client_index - opaque cookie to identify the sender
191 @param context - sender context, to match reply w/ request
192 @param is_multipath - Set to 1 if these paths will be added/removed
193 to/from the existing set, or 0 to replace
194 the existing set.
195 is_add=0 & is_multipath=0 implies delete all paths
196 @param is_add - Are the paths being added or removed
197*/
198define ip_route_add_del
Dave Barachb5e8a772016-12-06 12:04:42 -0500199{
200 u32 client_index;
201 u32 context;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200202 bool is_add [default=true];
Ole Troan668605f2019-12-09 16:08:27 +0100203 bool is_multipath;
Neale Ranns097fa662018-05-01 05:17:55 -0700204 vl_api_ip_route_t route;
Dave Barachb5e8a772016-12-06 12:04:42 -0500205};
Neale Ranns976b2592019-12-04 06:11:00 +0000206define ip_route_add_del_v2
207{
208 option in_progress;
209 u32 client_index;
210 u32 context;
211 bool is_add [default=true];
212 bool is_multipath;
213 vl_api_ip_route_v2_t route;
214};
Neale Ranns097fa662018-05-01 05:17:55 -0700215define ip_route_add_del_reply
Dave Barachb5e8a772016-12-06 12:04:42 -0500216{
217 u32 context;
Neale Ranns097fa662018-05-01 05:17:55 -0700218 i32 retval;
Neale Ranns008dbe12018-09-07 09:32:36 -0700219 u32 stats_index;
Neale Ranns097fa662018-05-01 05:17:55 -0700220};
Neale Ranns976b2592019-12-04 06:11:00 +0000221define ip_route_add_del_v2_reply
222{
223 option in_progress;
224 u32 context;
225 i32 retval;
226 u32 stats_index;
227};
Neale Ranns097fa662018-05-01 05:17:55 -0700228
229/** \brief Dump IP routes from a table
230 @param client_index - opaque cookie to identify the sender
Neale Ranns976b2592019-12-04 06:11:00 +0000231 @param src The entity adding the route. either 0 for default
232 or a value returned from fib_source_sdd.
Neale Ranns097fa662018-05-01 05:17:55 -0700233 @param table - The table from which to dump routes (ony ID an AF are needed)
234*/
235define ip_route_dump
236{
237 u32 client_index;
238 u32 context;
239 vl_api_ip_table_t table;
240};
Neale Ranns976b2592019-12-04 06:11:00 +0000241define ip_route_v2_dump
242{
243 option in_progress;
244 u32 client_index;
245 u32 context;
246 /* vl_api_fib_source_t src; */
247 u8 src;
248 vl_api_ip_table_t table;
249};
Neale Ranns097fa662018-05-01 05:17:55 -0700250
251/** \brief IP FIB table entry response
252 @param route The route entry in the table
253*/
Ole Troandf87f802020-11-18 19:17:48 +0100254define ip_route_details
Neale Ranns097fa662018-05-01 05:17:55 -0700255{
256 u32 context;
257 vl_api_ip_route_t route;
Dave Barachb5e8a772016-12-06 12:04:42 -0500258};
Neale Ranns976b2592019-12-04 06:11:00 +0000259define ip_route_v2_details
260{
261 option in_progress;
262 u32 context;
263 vl_api_ip_route_v2_t route;
264};
Dave Barachb5e8a772016-12-06 12:04:42 -0500265
Christian Hoppsf5d38e02020-05-04 10:28:03 -0400266/** \brief Lookup IP route from a table
267 @param client_index - opaque cookie to identify the sender
268 @param table_id - The IP table to look the route up in
269 @param exact - 0 for normal route lookup, 1 for exact match only
270 @param prefix - The prefix (or host) for route lookup.
271*/
272define ip_route_lookup
273{
274 u32 client_index;
275 u32 context;
276 u32 table_id;
277 u8 exact;
278 vl_api_prefix_t prefix;
279};
Neale Ranns976b2592019-12-04 06:11:00 +0000280define ip_route_lookup_v2
281{
282 option in_progress;
283 u32 client_index;
284 u32 context;
285 u32 table_id;
286 u8 exact;
287 vl_api_prefix_t prefix;
288};
Christian Hoppsf5d38e02020-05-04 10:28:03 -0400289
290/** \brief IP FIB table lookup response
291 @param retval - return code of the lookup
292 @param route - The route entry in the table if found
293*/
294define ip_route_lookup_reply
295{
296 u32 context;
297 i32 retval;
298 vl_api_ip_route_t route;
299};
Neale Ranns976b2592019-12-04 06:11:00 +0000300define ip_route_lookup_v2_reply
301{
302 option in_progress;
303 u32 context;
304 i32 retval;
305 vl_api_ip_route_v2_t route;
306};
Christian Hoppsf5d38e02020-05-04 10:28:03 -0400307
Dave Barachb5e8a772016-12-06 12:04:42 -0500308/** \brief Set the ip flow hash config for a fib request
309 @param client_index - opaque cookie to identify the sender
310 @param context - sender context, to match reply w/ request
311 @param vrf_id - vrf/fib id
312 @param is_ipv6 - if non-zero the fib is ip6, else ip4
313 @param src - if non-zero include src in flow hash
314 @param dst - if non-zero include dst in flow hash
315 @param sport - if non-zero include sport in flow hash
316 @param dport - if non-zero include dport in flow hash
317 @param proto -if non-zero include proto in flow hash
318 @param reverse - if non-zero include reverse in flow hash
Mohsin Kazmi2af0e3a2018-11-20 11:11:12 +0100319 @param symmetric - if non-zero include symmetry in flow hash
Dave Barachb5e8a772016-12-06 12:04:42 -0500320*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400321autoreply define set_ip_flow_hash
Dave Barachb5e8a772016-12-06 12:04:42 -0500322{
Ahmed Abdelsalamf2984bb2020-11-20 18:56:09 +0000323 option deprecated;
Dave Barachb5e8a772016-12-06 12:04:42 -0500324 u32 client_index;
325 u32 context;
326 u32 vrf_id;
Ole Troan668605f2019-12-09 16:08:27 +0100327 bool is_ipv6;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200328 bool src;
329 bool dst;
330 bool sport;
331 bool dport;
332 bool proto;
333 bool reverse;
334 bool symmetric;
Dave Barachb5e8a772016-12-06 12:04:42 -0500335};
336
Ahmed Abdelsalamf2984bb2020-11-20 18:56:09 +0000337/**
338 @brief flow hash settings for an IP table
339 @param src - include src in flow hash
340 @param dst - include dst in flow hash
341 @param sport - include sport in flow hash
342 @param dport - include dport in flow hash
343 @param proto - include proto in flow hash
344 @param reverse - include reverse in flow hash
345 @param symmetric - include symmetry in flow hash
346 @param flowlabel - include flowlabel in flow hash
347*/
348enumflag ip_flow_hash_config
349{
350 IP_API_FLOW_HASH_SRC_IP = 0x01,
351 IP_API_FLOW_HASH_DST_IP = 0x02,
352 IP_API_FLOW_HASH_SRC_PORT = 0x04,
353 IP_API_FLOW_HASH_DST_PORT = 0x08,
354 IP_API_FLOW_HASH_PROTO = 0x10,
355 IP_API_FLOW_HASH_REVERSE = 0x20,
356 IP_API_FLOW_HASH_SYMETRIC = 0x40,
357 IP_API_FLOW_HASH_FLOW_LABEL = 0x80,
358};
359
360autoreply define set_ip_flow_hash_v2
361{
362 u32 client_index;
363 u32 context;
364 u32 table_id;
365 vl_api_address_family_t af;
366 vl_api_ip_flow_hash_config_t flow_hash_config;
367};
368
Neale Ranns3d5f08a2021-01-22 16:12:38 +0000369/** \brief Set the ip flow hash router ID
370 @param client_index - opaque cookie to identify the sender
371 @param context - sender context, to match reply w/ request
372 @param router_id - The ID of the router. Mixed into the hash.
373 Used to prevent polarisation across a network,
374 since each router is assumed to have a different ID
375*/
376autoreply define set_ip_flow_hash_router_id
377{
378 u32 client_index;
379 u32 context;
380 u32 router_id;
381};
382
Dave Barachb5e8a772016-12-06 12:04:42 -0500383/** \brief IPv6 interface enable / disable request
384 @param client_index - opaque cookie to identify the sender
385 @param context - sender context, to match reply w/ request
386 @param sw_if_index - interface used to reach neighbor
387 @param enable - if non-zero enable ip6 on interface, else disable
388*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400389autoreply define sw_interface_ip6_enable_disable
Dave Barachb5e8a772016-12-06 12:04:42 -0500390{
391 u32 client_index;
392 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100393 vl_api_interface_index_t sw_if_index;
394 bool enable; /* set to true if enable */
Dave Barachb5e8a772016-12-06 12:04:42 -0500395};
396
Neale Ranns097fa662018-05-01 05:17:55 -0700397/** \brief Dump IP multicast fib table
398 @param client_index - opaque cookie to identify the sender
399*/
400define ip_mtable_dump
Neale Ranns008dbe12018-09-07 09:32:36 -0700401{
Neale Ranns097fa662018-05-01 05:17:55 -0700402 u32 client_index;
Neale Ranns008dbe12018-09-07 09:32:36 -0700403 u32 context;
Neale Ranns097fa662018-05-01 05:17:55 -0700404};
405define ip_mtable_details
406{
407 u32 client_index;
408 u32 context;
409 vl_api_ip_table_t table;
Neale Ranns008dbe12018-09-07 09:32:36 -0700410};
411
Neale Ranns32e1c012016-11-22 17:07:28 +0000412/** \brief Add / del route request
Ian Wells412ecd32018-10-04 12:31:11 -0700413
414 Adds a route, consisting both of the MFIB entry to match packets
415 (which may already exist) and a path to send those packets down.
416 Routes can be entered repeatedly to add multiple paths. Deletions are
417 per-path.
418
Neale Ranns32e1c012016-11-22 17:07:28 +0000419 @param client_index - opaque cookie to identify the sender
420 @param context - sender context, to match reply w/ request
Ian Wells412ecd32018-10-04 12:31:11 -0700421 @param table_id - fib table /vrf associated with the route
422 @param is_add - true if adding a route; false if deleting one
423 @param is_ipv6 - true iff all the addresses are v6
424 @param entry_flags - see fib_entry_flag_t
425 @param itf_flags - see mfib_entry_flags_t
426 @param next_hop_afi - see dpo_proto_t; the type of destination description
427 @param src_address - the source of the packet
428 @param grp_address - the group the packet is destined to
429 @param nh_address - the nexthop to forward the packet to
430 @param next_hop_sw_if_index - interface to emit packet on
431
432 BIER AFIs use the BIER imposition ID. v4 and v6 AFIs use either the
433 interface or the nexthop address.
434
435 Note that if the route is source-specific (S is supplied, not all 0s),
436 the prefix match is treated as exact (prefixlen /32 or /128).
437
438 FIXME not complete yet
Neale Ranns32e1c012016-11-22 17:07:28 +0000439*/
Neale Ranns097fa662018-05-01 05:17:55 -0700440typedef ip_mroute
441{
442 u32 table_id;
Neale Ranns990f6942020-10-20 07:20:17 +0000443 vl_api_mfib_entry_flags_t entry_flags;
Neale Ranns097fa662018-05-01 05:17:55 -0700444 u32 rpf_id;
445 vl_api_mprefix_t prefix;
446 u8 n_paths;
447 vl_api_mfib_path_t paths[n_paths];
448};
449
Neale Ranns28c142e2018-09-07 09:37:07 -0700450define ip_mroute_add_del
Neale Ranns32e1c012016-11-22 17:07:28 +0000451{
452 u32 client_index;
453 u32 context;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200454 bool is_add [default=true];
Ole Troan668605f2019-12-09 16:08:27 +0100455 bool is_multipath;
Neale Ranns097fa662018-05-01 05:17:55 -0700456 vl_api_ip_mroute_t route;
Neale Ranns32e1c012016-11-22 17:07:28 +0000457};
Neale Ranns28c142e2018-09-07 09:37:07 -0700458define ip_mroute_add_del_reply
459{
460 u32 context;
461 i32 retval;
462 u32 stats_index;
463};
464
Neale Ranns5a8123b2017-01-26 01:18:23 -0800465/** \brief Dump IP multicast fib table
Neale Ranns097fa662018-05-01 05:17:55 -0700466 @param table - The table from which to dump routes (ony ID an AF are needed)
Neale Ranns5a8123b2017-01-26 01:18:23 -0800467*/
Neale Ranns097fa662018-05-01 05:17:55 -0700468define ip_mroute_dump
Neale Ranns5a8123b2017-01-26 01:18:23 -0800469{
470 u32 client_index;
471 u32 context;
Neale Ranns097fa662018-05-01 05:17:55 -0700472 vl_api_ip_table_t table;
Neale Ranns5a8123b2017-01-26 01:18:23 -0800473};
474
Neale Ranns097fa662018-05-01 05:17:55 -0700475/** \brief IP Multicast Route Details
476 @param route - Details of the route
Neale Ranns5a8123b2017-01-26 01:18:23 -0800477*/
Ole Troandf87f802020-11-18 19:17:48 +0100478define ip_mroute_details
Neale Ranns5a8123b2017-01-26 01:18:23 -0800479{
480 u32 context;
Neale Ranns097fa662018-05-01 05:17:55 -0700481 vl_api_ip_mroute_t route;
Neale Ranns5a8123b2017-01-26 01:18:23 -0800482};
483
Dave Barachb5e8a772016-12-06 12:04:42 -0500484define ip_address_details
485{
Dave Barachb5e8a772016-12-06 12:04:42 -0500486 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100487 vl_api_interface_index_t sw_if_index;
Ole Troan75761b92019-09-11 17:49:08 +0200488 vl_api_address_with_prefix_t prefix;
Dave Barachb5e8a772016-12-06 12:04:42 -0500489};
490
491define ip_address_dump
492{
493 u32 client_index;
494 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100495 vl_api_interface_index_t sw_if_index;
496 bool is_ipv6;
Dave Barachb5e8a772016-12-06 12:04:42 -0500497};
498
Neale Ranns9e2f9152018-05-18 02:27:10 -0700499/** \brief IP unnumbered configurations
500 @param sw_if_index The interface that has unnumbered configuration
Paul Vinciguerrac0e94412020-04-28 01:12:04 -0400501 @param ip_sw_if_index The IP interface that it is unnumbered to
Neale Ranns9e2f9152018-05-18 02:27:10 -0700502*/
503define ip_unnumbered_details
504{
Neale Ranns9e2f9152018-05-18 02:27:10 -0700505 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100506 vl_api_interface_index_t sw_if_index;
507 vl_api_interface_index_t ip_sw_if_index;
Neale Ranns9e2f9152018-05-18 02:27:10 -0700508};
509
510/** \brief Dump IP unnumbered configurations
511 @param sw_if_index ~0 for all interfaces, else the interface desired
512*/
513define ip_unnumbered_dump
514{
515 u32 client_index;
516 u32 context;
Paul Vinciguerrac0e94412020-04-28 01:12:04 -0400517 vl_api_interface_index_t sw_if_index [default=0xffffffff];
Neale Ranns9e2f9152018-05-18 02:27:10 -0700518};
519
Dave Barachb5e8a772016-12-06 12:04:42 -0500520define ip_details
521{
Dave Barachb5e8a772016-12-06 12:04:42 -0500522 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100523 vl_api_interface_index_t sw_if_index;
524 bool is_ipv6;
Dave Barachb5e8a772016-12-06 12:04:42 -0500525};
526
527define ip_dump
528{
529 u32 client_index;
530 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100531 bool is_ipv6;
Dave Barachb5e8a772016-12-06 12:04:42 -0500532};
533
Neale Ranns32e1c012016-11-22 17:07:28 +0000534define mfib_signal_dump
535{
536 u32 client_index;
537 u32 context;
538};
539
540define mfib_signal_details
541{
Neale Ranns32e1c012016-11-22 17:07:28 +0000542 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100543 vl_api_interface_index_t sw_if_index;
Neale Ranns32e1c012016-11-22 17:07:28 +0000544 u32 table_id;
Neale Ranns097fa662018-05-01 05:17:55 -0700545 vl_api_mprefix_t prefix;
Neale Ranns32e1c012016-11-22 17:07:28 +0000546 u16 ip_packet_len;
547 u8 ip_packet_data[256];
548};
Dave Barachb5e8a772016-12-06 12:04:42 -0500549
Neale Rannsd91c1db2017-07-31 02:30:50 -0700550/** \brief IP punt policer
551 @param client_index - opaque cookie to identify the sender
552 @param context - sender context, to match reply w/ request
553 @param is_add - 1 to add neighbor, 0 to delete
554 @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
555 @param policer_index - Index of policer to use
556*/
557autoreply define ip_punt_police
558{
559 u32 client_index;
560 u32 context;
561 u32 policer_index;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200562 bool is_add [default=true];
Ole Troan668605f2019-12-09 16:08:27 +0100563 bool is_ip6;
Neale Rannsd91c1db2017-07-31 02:30:50 -0700564};
565
Pavel Kotucek609e1212018-11-27 09:59:44 +0100566/** \brief Punt redirect type
Neale Ranns47527b22018-11-16 00:53:53 -0800567 @param rx_sw_if_index - specify the original RX interface of traffic
568 that should be redirected. ~0 means any interface.
Paul Vinciguerrac0e94412020-04-28 01:12:04 -0400569 @param tx_sw_if_index - the TX interface to which traffic should be
Neale Rannsd91c1db2017-07-31 02:30:50 -0700570 redirected.
Pavel Kotucek609e1212018-11-27 09:59:44 +0100571 @param nh - the next-hop to redirect the traffic to.
572 @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
573*/
Paul Vinciguerrae7174822019-08-07 00:05:59 -0400574typedef punt_redirect
Pavel Kotucek609e1212018-11-27 09:59:44 +0100575{
Ole Troan668605f2019-12-09 16:08:27 +0100576 vl_api_interface_index_t rx_sw_if_index;
577 vl_api_interface_index_t tx_sw_if_index;
Pavel Kotucek609e1212018-11-27 09:59:44 +0100578 vl_api_address_t nh;
579};
580
581/** \brief IP punt redirect
582 @param client_index - opaque cookie to identify the sender
583 @param context - sender context, to match reply w/ request
584 @param punt - punt definition
585 @param is_add - 1 to add neighbor, 0 to delete
Neale Rannsd91c1db2017-07-31 02:30:50 -0700586*/
587autoreply define ip_punt_redirect
588{
Nathan Skrzypczak2a1783f2021-08-10 15:05:29 +0200589 option deprecated;
Neale Rannsd91c1db2017-07-31 02:30:50 -0700590 u32 client_index;
591 u32 context;
Pavel Kotucek609e1212018-11-27 09:59:44 +0100592 vl_api_punt_redirect_t punt;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200593 bool is_add [default=true];
Pavel Kotucek609e1212018-11-27 09:59:44 +0100594};
595
596define ip_punt_redirect_dump
597{
598 u32 client_index;
599 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100600 vl_api_interface_index_t sw_if_index;
601 bool is_ipv6;
Pavel Kotucek609e1212018-11-27 09:59:44 +0100602};
603
604define ip_punt_redirect_details
605{
606 u32 context;
607 vl_api_punt_redirect_t punt;
Neale Rannsd91c1db2017-07-31 02:30:50 -0700608};
609
Nathan Skrzypczak2a1783f2021-08-10 15:05:29 +0200610/** \brief Punt redirect type
611 @param rx_sw_if_index - specify the original RX interface of traffic
612 that should be redirected. ~0 means any interface.
613 @param af - Address family (ip4 or ip6)
614 @param paths - the TX paths to which traffic should be redirected.
615*/
616typedef punt_redirect_v2
617{
618 vl_api_interface_index_t rx_sw_if_index [default=0xffffffff];
619 vl_api_address_family_t af;
620 u32 n_paths;
621 vl_api_fib_path_t paths[n_paths];
622};
623
624/** \brief Add IP punt redirect rule
625 @param client_index - opaque cookie to identify the sender
626 @param context - sender context, to match reply w/ request
627 @param punt - punt definition
628 @param is_add - 1 to add punt_redirect rule, 0 to delete
629*/
630autoreply define add_del_ip_punt_redirect_v2
631{
632 u32 client_index;
633 u32 context;
634 bool is_add [default=true];
635 vl_api_punt_redirect_v2_t punt;
636};
637
638define ip_punt_redirect_v2_dump
639{
640 u32 client_index;
641 u32 context;
642 vl_api_interface_index_t sw_if_index;
643 vl_api_address_family_t af;
644};
645
646define ip_punt_redirect_v2_details
647{
648 u32 context;
649 vl_api_punt_redirect_v2_t punt;
650};
651
Florin Coras595992c2017-11-06 17:17:08 -0800652autoreply define ip_container_proxy_add_del
653{
654 u32 client_index;
655 u32 context;
Neale Ranns37029302018-08-10 05:30:06 -0700656 vl_api_prefix_t pfx;
Ole Troan668605f2019-12-09 16:08:27 +0100657 vl_api_interface_index_t sw_if_index;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200658 bool is_add [default=true];
Florin Coras595992c2017-11-06 17:17:08 -0800659};
660
Matus Fabian75b9f452018-10-02 23:27:21 -0700661define ip_container_proxy_dump
662{
663 u32 client_index;
664 u32 context;
665};
666
667define ip_container_proxy_details
668{
669 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100670 vl_api_interface_index_t sw_if_index;
Matus Fabian75b9f452018-10-02 23:27:21 -0700671 vl_api_prefix_t prefix;
672};
673
Neale Rannsb8d44812017-11-10 06:53:54 -0800674/** \brief Configure IP source and L4 port-range check
675 @param client_index - opaque cookie to identify the sender
676 @param context - sender context, to match reply w/ request
677 @param is_ip6 - 1 if source address type is IPv6
678 @param is_add - 1 if add, 0 if delete
Neale Ranns37029302018-08-10 05:30:06 -0700679 @param ip - prefix to match
Neale Rannsb8d44812017-11-10 06:53:54 -0800680 @param number_of_ranges - length of low_port and high_port arrays (must match)
681 @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
682 @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
683 @param vrf_id - fib table/vrf id to associate the source and port-range check with
684 @note To specify a single port set low_port and high_port entry the same
685*/
686autoreply define ip_source_and_port_range_check_add_del
687{
688 u32 client_index;
689 u32 context;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200690 bool is_add [default=true];
Neale Ranns37029302018-08-10 05:30:06 -0700691 vl_api_prefix_t prefix;
Neale Rannsb8d44812017-11-10 06:53:54 -0800692 u8 number_of_ranges;
693 u16 low_ports[32];
694 u16 high_ports[32];
695 u32 vrf_id;
696};
697
698/** \brief Set interface source and L4 port-range request
699 @param client_index - opaque cookie to identify the sender
700 @param context - sender context, to match reply w/ request
701 @param interface_id - interface index
702 @param tcp_vrf_id - VRF associated with source and TCP port-range check
703 @param udp_vrf_id - VRF associated with source and TCP port-range check
704*/
705autoreply define ip_source_and_port_range_check_interface_add_del
706{
707 u32 client_index;
708 u32 context;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200709 bool is_add [default=true];
Ole Troan668605f2019-12-09 16:08:27 +0100710 vl_api_interface_index_t sw_if_index;
Neale Rannsb8d44812017-11-10 06:53:54 -0800711 u32 tcp_in_vrf_id;
712 u32 tcp_out_vrf_id;
713 u32 udp_in_vrf_id;
714 u32 udp_out_vrf_id;
715};
716
Neale Rannscbe25aa2019-09-30 10:53:31 +0000717/** \brief IPv6 set link local address on interface request
John Lo7f358b32018-04-28 01:19:24 -0400718 @param client_index - opaque cookie to identify the sender
719 @param context - sender context, to match reply w/ request
Neale Rannscbe25aa2019-09-30 10:53:31 +0000720 @param sw_if_index - interface to set link local on
721 @param ip - the new link local address
John Lo7f358b32018-04-28 01:19:24 -0400722*/
Neale Rannscbe25aa2019-09-30 10:53:31 +0000723autoreply define sw_interface_ip6_set_link_local_address
Neale Rannsb8d44812017-11-10 06:53:54 -0800724{
725 u32 client_index;
726 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100727 vl_api_interface_index_t sw_if_index;
Neale Rannscbe25aa2019-09-30 10:53:31 +0000728 vl_api_ip6_address_t ip;
Neale Rannsb8d44812017-11-10 06:53:54 -0800729};
730
Benoît Ganne58a19152021-01-18 19:24:34 +0100731/** \brief IPv6 get link local address on interface request
732 @param client_index - opaque cookie to identify the sender
733 @param context - sender context, to match reply w/ request
734 @param sw_if_index - interface to set link local on
735*/
736define sw_interface_ip6_get_link_local_address
737{
738 u32 client_index;
739 u32 context;
740 vl_api_interface_index_t sw_if_index;
741};
742
743/** \brief IPv6 link local address detail
744 @param context - sender context, to match reply w/ request
745 @param ip - the link local address
746*/
747define sw_interface_ip6_get_link_local_address_reply
748{
749 u32 context;
750 i32 retval;
751 vl_api_ip6_address_t ip;
752};
753
Neale Rannsb8d44812017-11-10 06:53:54 -0800754/** \brief IOAM enable : Enable in-band OAM
755 @param id - profile id
756 @param seqno - To enable Seqno Processing
Jakub Grajciar58989a32019-10-08 14:05:18 +0200757 @param analyse - Enabling analysis of iOAM at decap node
758 @param pow_enable - Proof of Work enabled or not flag
Neale Rannsb8d44812017-11-10 06:53:54 -0800759 @param trace_enable - iOAM Trace enabled or not flag
760*/
761autoreply define ioam_enable
762{
763 u32 client_index;
764 u32 context;
765 u16 id;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200766 bool seqno;
767 bool analyse;
768 bool pot_enable;
769 bool trace_enable;
Neale Rannsb8d44812017-11-10 06:53:54 -0800770 u32 node_id;
771};
772
773/** \brief iOAM disable
774 @param client_index - opaque cookie to identify the sender
775 @param context - sender context, to match reply w/ request
776 @param index - MAP Domain index
777*/
778autoreply define ioam_disable
779{
780 u32 client_index;
781 u32 context;
782 u16 id;
783};
784
Klement Sekerade34c352019-06-25 11:19:22 +0000785enum ip_reass_type
786{
787 IP_REASS_TYPE_FULL = 0,
788 IP_REASS_TYPE_SHALLOW_VIRTUAL = 0x1,
789};
790
Klement Sekera75e7d132017-09-20 08:26:30 +0200791autoreply define ip_reassembly_set
792{
793 u32 client_index;
794 u32 context;
795 u32 timeout_ms;
796 u32 max_reassemblies;
Klement Sekera3a343d42019-05-16 14:35:46 +0200797 u32 max_reassembly_length;
Klement Sekera75e7d132017-09-20 08:26:30 +0200798 u32 expire_walk_interval_ms;
Ole Troan668605f2019-12-09 16:08:27 +0100799 bool is_ip6;
Klement Sekerade34c352019-06-25 11:19:22 +0000800 vl_api_ip_reass_type_t type;
Klement Sekera75e7d132017-09-20 08:26:30 +0200801};
802
803define ip_reassembly_get
804{
805 u32 client_index;
806 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100807 bool is_ip6;
Klement Sekerade34c352019-06-25 11:19:22 +0000808 vl_api_ip_reass_type_t type;
Klement Sekera75e7d132017-09-20 08:26:30 +0200809};
810
811define ip_reassembly_get_reply
812{
Klement Sekera75e7d132017-09-20 08:26:30 +0200813 u32 context;
814 i32 retval;
815 u32 timeout_ms;
816 u32 max_reassemblies;
Klement Sekera3a343d42019-05-16 14:35:46 +0200817 u32 max_reassembly_length;
Klement Sekera75e7d132017-09-20 08:26:30 +0200818 u32 expire_walk_interval_ms;
Ole Troan668605f2019-12-09 16:08:27 +0100819 bool is_ip6;
Klement Sekera75e7d132017-09-20 08:26:30 +0200820};
821
Klement Sekera4c533132018-02-22 11:41:12 +0100822/** \brief Enable/disable reassembly feature
823 @param client_index - opaque cookie to identify the sender
824 @param context - sender context, to match reply w/ request
825 @param sw_if_index - interface to enable/disable feature on
826 @param enable_ip4 - enable ip4 reassembly if non-zero, disable if 0
827 @param enable_ip6 - enable ip6 reassembly if non-zero, disable if 0
828*/
829autoreply define ip_reassembly_enable_disable
830{
831 u32 client_index;
832 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100833 vl_api_interface_index_t sw_if_index;
834 bool enable_ip4;
835 bool enable_ip6;
Klement Sekerade34c352019-06-25 11:19:22 +0000836 vl_api_ip_reass_type_t type;
Klement Sekera4c533132018-02-22 11:41:12 +0100837};
838
Klement Sekera01c1fa42021-12-14 18:25:11 +0000839/** enable/disable full reassembly of packets aimed at our addresses */
840autoreply define ip_local_reass_enable_disable
841{
842 u32 client_index;
843 u32 context;
844 bool enable_ip4;
845 bool enable_ip6;
846};
847
848/** get status of local reassembly */
849define ip_local_reass_get
850{
851 u32 client_index;
852 u32 context;
853};
854
855define ip_local_reass_get_reply
856{
857 u32 context;
858 i32 retval;
859 bool ip4_is_enabled;
860 bool ip6_is_enabled;
861};
862
Neale Ranns8f5fef22020-12-21 08:29:34 +0000863/**
864 @brief Set a Path MTU value. i.e. a MTU value for a given neighbour.
865 The neighbour can be described as attached (w/ interface and next-hop)
866 or remote (w/ table_id and next-hop);
867 @param client_index - opaque cookie to identify the sender
868 @param context - sender context, to match reply w/ request
869 @param table_id - table-ID for next-hop
870 @param nh - Next hop
871 @param path_mtu - value to set, 0 is disable.
872*/
873typedef ip_path_mtu
874{
875 u32 client_index;
876 u32 context;
877 u32 table_id;
878 vl_api_address_t nh;
879 u16 path_mtu;
880};
881autoreply define ip_path_mtu_update
882{
883 u32 client_index;
884 u32 context;
885 vl_api_ip_path_mtu_t pmtu;
886};
887define ip_path_mtu_get
888{
889 u32 client_index;
890 u32 context;
891 u32 cursor;
892};
893define ip_path_mtu_get_reply
894{
895 u32 context;
896 i32 retval;
897 u32 cursor;
898};
899define ip_path_mtu_details
900{
901 u32 context;
902 vl_api_ip_path_mtu_t pmtu;
903};
904service {
905 rpc ip_path_mtu_get returns ip_path_mtu_get_reply
906 stream ip_path_mtu_details;
907};
908
909autoreply define ip_path_mtu_replace_begin
910{
911 u32 client_index;
912 u32 context;
913};
914autoreply define ip_path_mtu_replace_end
915{
916 u32 client_index;
917 u32 context;
918};
919
Dave Barachb5e8a772016-12-06 12:04:42 -0500920/*
921 * Local Variables:
922 * eval: (c-set-style "gnu")
923 * End:
924 */