blob: 28786fa5a90513b554bd45c805ef48dff411e1ee [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
Neale Ranns976b2592019-12-04 06:11:00 +000023option version = "3.1.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
Neale Ranns097fa662018-05-01 05:17:55 -070060/** \brief Dump IP all fib tables
Dave Barachb5e8a772016-12-06 12:04:42 -050061 @param client_index - opaque cookie to identify the sender
Neale Ranns097fa662018-05-01 05:17:55 -070062 @param context - sender context, to match reply w/ request
Dave Barachb5e8a772016-12-06 12:04:42 -050063*/
Neale Ranns097fa662018-05-01 05:17:55 -070064define ip_table_dump
Dave Barachb5e8a772016-12-06 12:04:42 -050065{
66 u32 client_index;
67 u32 context;
68};
69
Neale Ranns9db6ada2019-11-08 12:42:31 +000070/** \brief IP table replace being
71
72 The use-case is that, for some unspecified reason, the control plane
73 has a very different set of entries it wants in the table than VPP
74 currently has. The CP would thus like to 'replace' VPP's current table
75 only by specifying what the new set of entries shall be, i.e. it is not
Paul Vinciguerrac0e94412020-04-28 01:12:04 -040076 going to delete anything that already exists.
77 the CP declares the start of this procedure with this begin_replace
Neale Ranns9db6ada2019-11-08 12:42:31 +000078 API Call, and when it has populated all the entries it wants, it calls
Paul Vinciguerrac0e94412020-04-28 01:12:04 -040079 the below end_replace API. From this point on it is of course free
Neale Ranns9db6ada2019-11-08 12:42:31 +000080 to add and delete entries as usual.
81 The underlying mechanism by which VPP implements this replace is
82 purposefully left unspecified.
83
84 @param client_index - opaque cookie to identify the sender
85 @param context - sender context, to match reply w/ request
86 @param table - The table to resync
87*/
88autoreply define ip_table_replace_begin
89{
90 u32 client_index;
91 u32 context;
92 vl_api_ip_table_t table;
93};
94
95/** \brief IP table replace end
96
97 see replace start/
98
99 @param client_index - opaque cookie to identify the sender
100 @param context - sender context, to match reply w/ request
101 @param table - The table that has converged
102*/
103autoreply define ip_table_replace_end
104{
105 u32 client_index;
106 u32 context;
107 vl_api_ip_table_t table;
108};
109
110/** \brief IP table flush
111 Flush a table of all routes
112 @param client_index - opaque cookie to identify the sender
113 @param context - sender context, to match reply w/ request
114 @param table - The table to flush
115*/
116autoreply define ip_table_flush
117{
118 u32 client_index;
119 u32 context;
120 vl_api_ip_table_t table;
121};
122
Dave Barachb5e8a772016-12-06 12:04:42 -0500123/** \brief IP FIB table response
Neale Ranns097fa662018-05-01 05:17:55 -0700124 @param context - sender context
125 @param table - description of the table
Dave Barachb5e8a772016-12-06 12:04:42 -0500126*/
Ole Troandf87f802020-11-18 19:17:48 +0100127define ip_table_details
Dave Barachb5e8a772016-12-06 12:04:42 -0500128{
129 u32 context;
Neale Ranns097fa662018-05-01 05:17:55 -0700130 vl_api_ip_table_t table;
Dave Barachb5e8a772016-12-06 12:04:42 -0500131};
132
Neale Ranns097fa662018-05-01 05:17:55 -0700133/** \brief An IP route
134 @param table_id The IP table the route is in
135 @param stats_index The index of the route in the stats segment
136 @param prefix the prefix for the route
137 @param n_paths The number of paths the route has
Neale Ranns976b2592019-12-04 06:11:00 +0000138 @param src The entity adding the route. either 0 for default
139 or a value returned from fib_source_sdd.
Neale Ranns097fa662018-05-01 05:17:55 -0700140 @param paths The paths of the route
Dave Barachb5e8a772016-12-06 12:04:42 -0500141*/
Paul Vinciguerrae7174822019-08-07 00:05:59 -0400142typedef ip_route
Neale Ranns097fa662018-05-01 05:17:55 -0700143{
144 u32 table_id;
145 u32 stats_index;
146 vl_api_prefix_t prefix;
147 u8 n_paths;
148 vl_api_fib_path_t paths[n_paths];
149};
Neale Ranns976b2592019-12-04 06:11:00 +0000150typedef ip_route_v2
151{
152 u32 table_id;
153 u32 stats_index;
154 vl_api_prefix_t prefix;
155 u8 n_paths;
156 u8 src;
157 vl_api_fib_path_t paths[n_paths];
158};
Neale Ranns097fa662018-05-01 05:17:55 -0700159
160/** \brief Add / del route request
161 @param client_index - opaque cookie to identify the sender
162 @param context - sender context, to match reply w/ request
163 @param is_multipath - Set to 1 if these paths will be added/removed
164 to/from the existing set, or 0 to replace
165 the existing set.
166 is_add=0 & is_multipath=0 implies delete all paths
167 @param is_add - Are the paths being added or removed
168*/
169define ip_route_add_del
Dave Barachb5e8a772016-12-06 12:04:42 -0500170{
171 u32 client_index;
172 u32 context;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200173 bool is_add [default=true];
Ole Troan668605f2019-12-09 16:08:27 +0100174 bool is_multipath;
Neale Ranns097fa662018-05-01 05:17:55 -0700175 vl_api_ip_route_t route;
Dave Barachb5e8a772016-12-06 12:04:42 -0500176};
Neale Ranns976b2592019-12-04 06:11:00 +0000177define ip_route_add_del_v2
178{
179 option in_progress;
180 u32 client_index;
181 u32 context;
182 bool is_add [default=true];
183 bool is_multipath;
184 vl_api_ip_route_v2_t route;
185};
Neale Ranns097fa662018-05-01 05:17:55 -0700186define ip_route_add_del_reply
Dave Barachb5e8a772016-12-06 12:04:42 -0500187{
188 u32 context;
Neale Ranns097fa662018-05-01 05:17:55 -0700189 i32 retval;
Neale Ranns008dbe12018-09-07 09:32:36 -0700190 u32 stats_index;
Neale Ranns097fa662018-05-01 05:17:55 -0700191};
Neale Ranns976b2592019-12-04 06:11:00 +0000192define ip_route_add_del_v2_reply
193{
194 option in_progress;
195 u32 context;
196 i32 retval;
197 u32 stats_index;
198};
Neale Ranns097fa662018-05-01 05:17:55 -0700199
200/** \brief Dump IP routes from a table
201 @param client_index - opaque cookie to identify the sender
Neale Ranns976b2592019-12-04 06:11:00 +0000202 @param src The entity adding the route. either 0 for default
203 or a value returned from fib_source_sdd.
Neale Ranns097fa662018-05-01 05:17:55 -0700204 @param table - The table from which to dump routes (ony ID an AF are needed)
205*/
206define ip_route_dump
207{
208 u32 client_index;
209 u32 context;
210 vl_api_ip_table_t table;
211};
Neale Ranns976b2592019-12-04 06:11:00 +0000212define ip_route_v2_dump
213{
214 option in_progress;
215 u32 client_index;
216 u32 context;
217 /* vl_api_fib_source_t src; */
218 u8 src;
219 vl_api_ip_table_t table;
220};
Neale Ranns097fa662018-05-01 05:17:55 -0700221
222/** \brief IP FIB table entry response
223 @param route The route entry in the table
224*/
Ole Troandf87f802020-11-18 19:17:48 +0100225define ip_route_details
Neale Ranns097fa662018-05-01 05:17:55 -0700226{
227 u32 context;
228 vl_api_ip_route_t route;
Dave Barachb5e8a772016-12-06 12:04:42 -0500229};
Neale Ranns976b2592019-12-04 06:11:00 +0000230define ip_route_v2_details
231{
232 option in_progress;
233 u32 context;
234 vl_api_ip_route_v2_t route;
235};
Dave Barachb5e8a772016-12-06 12:04:42 -0500236
Christian Hoppsf5d38e02020-05-04 10:28:03 -0400237/** \brief Lookup IP route from a table
238 @param client_index - opaque cookie to identify the sender
239 @param table_id - The IP table to look the route up in
240 @param exact - 0 for normal route lookup, 1 for exact match only
241 @param prefix - The prefix (or host) for route lookup.
242*/
243define ip_route_lookup
244{
245 u32 client_index;
246 u32 context;
247 u32 table_id;
248 u8 exact;
249 vl_api_prefix_t prefix;
250};
Neale Ranns976b2592019-12-04 06:11:00 +0000251define ip_route_lookup_v2
252{
253 option in_progress;
254 u32 client_index;
255 u32 context;
256 u32 table_id;
257 u8 exact;
258 vl_api_prefix_t prefix;
259};
Christian Hoppsf5d38e02020-05-04 10:28:03 -0400260
261/** \brief IP FIB table lookup response
262 @param retval - return code of the lookup
263 @param route - The route entry in the table if found
264*/
265define ip_route_lookup_reply
266{
267 u32 context;
268 i32 retval;
269 vl_api_ip_route_t route;
270};
Neale Ranns976b2592019-12-04 06:11:00 +0000271define ip_route_lookup_v2_reply
272{
273 option in_progress;
274 u32 context;
275 i32 retval;
276 vl_api_ip_route_v2_t route;
277};
Christian Hoppsf5d38e02020-05-04 10:28:03 -0400278
Dave Barachb5e8a772016-12-06 12:04:42 -0500279/** \brief Set the ip flow hash config for a fib request
280 @param client_index - opaque cookie to identify the sender
281 @param context - sender context, to match reply w/ request
282 @param vrf_id - vrf/fib id
283 @param is_ipv6 - if non-zero the fib is ip6, else ip4
284 @param src - if non-zero include src in flow hash
285 @param dst - if non-zero include dst in flow hash
286 @param sport - if non-zero include sport in flow hash
287 @param dport - if non-zero include dport in flow hash
288 @param proto -if non-zero include proto in flow hash
289 @param reverse - if non-zero include reverse in flow hash
Mohsin Kazmi2af0e3a2018-11-20 11:11:12 +0100290 @param symmetric - if non-zero include symmetry in flow hash
Dave Barachb5e8a772016-12-06 12:04:42 -0500291*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400292autoreply define set_ip_flow_hash
Dave Barachb5e8a772016-12-06 12:04:42 -0500293{
Ahmed Abdelsalamf2984bb2020-11-20 18:56:09 +0000294 option deprecated;
Dave Barachb5e8a772016-12-06 12:04:42 -0500295 u32 client_index;
296 u32 context;
297 u32 vrf_id;
Ole Troan668605f2019-12-09 16:08:27 +0100298 bool is_ipv6;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200299 bool src;
300 bool dst;
301 bool sport;
302 bool dport;
303 bool proto;
304 bool reverse;
305 bool symmetric;
Dave Barachb5e8a772016-12-06 12:04:42 -0500306};
307
Ahmed Abdelsalamf2984bb2020-11-20 18:56:09 +0000308/**
309 @brief flow hash settings for an IP table
310 @param src - include src in flow hash
311 @param dst - include dst in flow hash
312 @param sport - include sport in flow hash
313 @param dport - include dport in flow hash
314 @param proto - include proto in flow hash
315 @param reverse - include reverse in flow hash
316 @param symmetric - include symmetry in flow hash
317 @param flowlabel - include flowlabel in flow hash
318*/
319enumflag ip_flow_hash_config
320{
321 IP_API_FLOW_HASH_SRC_IP = 0x01,
322 IP_API_FLOW_HASH_DST_IP = 0x02,
323 IP_API_FLOW_HASH_SRC_PORT = 0x04,
324 IP_API_FLOW_HASH_DST_PORT = 0x08,
325 IP_API_FLOW_HASH_PROTO = 0x10,
326 IP_API_FLOW_HASH_REVERSE = 0x20,
327 IP_API_FLOW_HASH_SYMETRIC = 0x40,
328 IP_API_FLOW_HASH_FLOW_LABEL = 0x80,
329};
330
331autoreply define set_ip_flow_hash_v2
332{
333 u32 client_index;
334 u32 context;
335 u32 table_id;
336 vl_api_address_family_t af;
337 vl_api_ip_flow_hash_config_t flow_hash_config;
338};
339
Neale Ranns3d5f08a2021-01-22 16:12:38 +0000340/** \brief Set the ip flow hash router ID
341 @param client_index - opaque cookie to identify the sender
342 @param context - sender context, to match reply w/ request
343 @param router_id - The ID of the router. Mixed into the hash.
344 Used to prevent polarisation across a network,
345 since each router is assumed to have a different ID
346*/
347autoreply define set_ip_flow_hash_router_id
348{
349 u32 client_index;
350 u32 context;
351 u32 router_id;
352};
353
Dave Barachb5e8a772016-12-06 12:04:42 -0500354/** \brief IPv6 interface enable / disable request
355 @param client_index - opaque cookie to identify the sender
356 @param context - sender context, to match reply w/ request
357 @param sw_if_index - interface used to reach neighbor
358 @param enable - if non-zero enable ip6 on interface, else disable
359*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400360autoreply define sw_interface_ip6_enable_disable
Dave Barachb5e8a772016-12-06 12:04:42 -0500361{
362 u32 client_index;
363 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100364 vl_api_interface_index_t sw_if_index;
365 bool enable; /* set to true if enable */
Dave Barachb5e8a772016-12-06 12:04:42 -0500366};
367
Neale Ranns097fa662018-05-01 05:17:55 -0700368/** \brief Dump IP multicast fib table
369 @param client_index - opaque cookie to identify the sender
370*/
371define ip_mtable_dump
Neale Ranns008dbe12018-09-07 09:32:36 -0700372{
Neale Ranns097fa662018-05-01 05:17:55 -0700373 u32 client_index;
Neale Ranns008dbe12018-09-07 09:32:36 -0700374 u32 context;
Neale Ranns097fa662018-05-01 05:17:55 -0700375};
376define ip_mtable_details
377{
378 u32 client_index;
379 u32 context;
380 vl_api_ip_table_t table;
Neale Ranns008dbe12018-09-07 09:32:36 -0700381};
382
Neale Ranns32e1c012016-11-22 17:07:28 +0000383/** \brief Add / del route request
Ian Wells412ecd32018-10-04 12:31:11 -0700384
385 Adds a route, consisting both of the MFIB entry to match packets
386 (which may already exist) and a path to send those packets down.
387 Routes can be entered repeatedly to add multiple paths. Deletions are
388 per-path.
389
Neale Ranns32e1c012016-11-22 17:07:28 +0000390 @param client_index - opaque cookie to identify the sender
391 @param context - sender context, to match reply w/ request
Ian Wells412ecd32018-10-04 12:31:11 -0700392 @param table_id - fib table /vrf associated with the route
393 @param is_add - true if adding a route; false if deleting one
394 @param is_ipv6 - true iff all the addresses are v6
395 @param entry_flags - see fib_entry_flag_t
396 @param itf_flags - see mfib_entry_flags_t
397 @param next_hop_afi - see dpo_proto_t; the type of destination description
398 @param src_address - the source of the packet
399 @param grp_address - the group the packet is destined to
400 @param nh_address - the nexthop to forward the packet to
401 @param next_hop_sw_if_index - interface to emit packet on
402
403 BIER AFIs use the BIER imposition ID. v4 and v6 AFIs use either the
404 interface or the nexthop address.
405
406 Note that if the route is source-specific (S is supplied, not all 0s),
407 the prefix match is treated as exact (prefixlen /32 or /128).
408
409 FIXME not complete yet
Neale Ranns32e1c012016-11-22 17:07:28 +0000410*/
Neale Ranns097fa662018-05-01 05:17:55 -0700411typedef ip_mroute
412{
413 u32 table_id;
Neale Ranns990f6942020-10-20 07:20:17 +0000414 vl_api_mfib_entry_flags_t entry_flags;
Neale Ranns097fa662018-05-01 05:17:55 -0700415 u32 rpf_id;
416 vl_api_mprefix_t prefix;
417 u8 n_paths;
418 vl_api_mfib_path_t paths[n_paths];
419};
420
Neale Ranns28c142e2018-09-07 09:37:07 -0700421define ip_mroute_add_del
Neale Ranns32e1c012016-11-22 17:07:28 +0000422{
423 u32 client_index;
424 u32 context;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200425 bool is_add [default=true];
Ole Troan668605f2019-12-09 16:08:27 +0100426 bool is_multipath;
Neale Ranns097fa662018-05-01 05:17:55 -0700427 vl_api_ip_mroute_t route;
Neale Ranns32e1c012016-11-22 17:07:28 +0000428};
Neale Ranns28c142e2018-09-07 09:37:07 -0700429define ip_mroute_add_del_reply
430{
431 u32 context;
432 i32 retval;
433 u32 stats_index;
434};
435
Neale Ranns5a8123b2017-01-26 01:18:23 -0800436/** \brief Dump IP multicast fib table
Neale Ranns097fa662018-05-01 05:17:55 -0700437 @param table - The table from which to dump routes (ony ID an AF are needed)
Neale Ranns5a8123b2017-01-26 01:18:23 -0800438*/
Neale Ranns097fa662018-05-01 05:17:55 -0700439define ip_mroute_dump
Neale Ranns5a8123b2017-01-26 01:18:23 -0800440{
441 u32 client_index;
442 u32 context;
Neale Ranns097fa662018-05-01 05:17:55 -0700443 vl_api_ip_table_t table;
Neale Ranns5a8123b2017-01-26 01:18:23 -0800444};
445
Neale Ranns097fa662018-05-01 05:17:55 -0700446/** \brief IP Multicast Route Details
447 @param route - Details of the route
Neale Ranns5a8123b2017-01-26 01:18:23 -0800448*/
Ole Troandf87f802020-11-18 19:17:48 +0100449define ip_mroute_details
Neale Ranns5a8123b2017-01-26 01:18:23 -0800450{
451 u32 context;
Neale Ranns097fa662018-05-01 05:17:55 -0700452 vl_api_ip_mroute_t route;
Neale Ranns5a8123b2017-01-26 01:18:23 -0800453};
454
Dave Barachb5e8a772016-12-06 12:04:42 -0500455define ip_address_details
456{
Dave Barachb5e8a772016-12-06 12:04:42 -0500457 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100458 vl_api_interface_index_t sw_if_index;
Ole Troan75761b92019-09-11 17:49:08 +0200459 vl_api_address_with_prefix_t prefix;
Dave Barachb5e8a772016-12-06 12:04:42 -0500460};
461
462define ip_address_dump
463{
464 u32 client_index;
465 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100466 vl_api_interface_index_t sw_if_index;
467 bool is_ipv6;
Dave Barachb5e8a772016-12-06 12:04:42 -0500468};
469
Neale Ranns9e2f9152018-05-18 02:27:10 -0700470/** \brief IP unnumbered configurations
471 @param sw_if_index The interface that has unnumbered configuration
Paul Vinciguerrac0e94412020-04-28 01:12:04 -0400472 @param ip_sw_if_index The IP interface that it is unnumbered to
Neale Ranns9e2f9152018-05-18 02:27:10 -0700473*/
474define ip_unnumbered_details
475{
Neale Ranns9e2f9152018-05-18 02:27:10 -0700476 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100477 vl_api_interface_index_t sw_if_index;
478 vl_api_interface_index_t ip_sw_if_index;
Neale Ranns9e2f9152018-05-18 02:27:10 -0700479};
480
481/** \brief Dump IP unnumbered configurations
482 @param sw_if_index ~0 for all interfaces, else the interface desired
483*/
484define ip_unnumbered_dump
485{
486 u32 client_index;
487 u32 context;
Paul Vinciguerrac0e94412020-04-28 01:12:04 -0400488 vl_api_interface_index_t sw_if_index [default=0xffffffff];
Neale Ranns9e2f9152018-05-18 02:27:10 -0700489};
490
Dave Barachb5e8a772016-12-06 12:04:42 -0500491define ip_details
492{
Dave Barachb5e8a772016-12-06 12:04:42 -0500493 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100494 vl_api_interface_index_t sw_if_index;
495 bool is_ipv6;
Dave Barachb5e8a772016-12-06 12:04:42 -0500496};
497
498define ip_dump
499{
500 u32 client_index;
501 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100502 bool is_ipv6;
Dave Barachb5e8a772016-12-06 12:04:42 -0500503};
504
Neale Ranns32e1c012016-11-22 17:07:28 +0000505define mfib_signal_dump
506{
507 u32 client_index;
508 u32 context;
509};
510
511define mfib_signal_details
512{
Neale Ranns32e1c012016-11-22 17:07:28 +0000513 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100514 vl_api_interface_index_t sw_if_index;
Neale Ranns32e1c012016-11-22 17:07:28 +0000515 u32 table_id;
Neale Ranns097fa662018-05-01 05:17:55 -0700516 vl_api_mprefix_t prefix;
Neale Ranns32e1c012016-11-22 17:07:28 +0000517 u16 ip_packet_len;
518 u8 ip_packet_data[256];
519};
Dave Barachb5e8a772016-12-06 12:04:42 -0500520
Neale Rannsd91c1db2017-07-31 02:30:50 -0700521/** \brief IP punt policer
522 @param client_index - opaque cookie to identify the sender
523 @param context - sender context, to match reply w/ request
524 @param is_add - 1 to add neighbor, 0 to delete
525 @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
526 @param policer_index - Index of policer to use
527*/
528autoreply define ip_punt_police
529{
530 u32 client_index;
531 u32 context;
532 u32 policer_index;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200533 bool is_add [default=true];
Ole Troan668605f2019-12-09 16:08:27 +0100534 bool is_ip6;
Neale Rannsd91c1db2017-07-31 02:30:50 -0700535};
536
Pavel Kotucek609e1212018-11-27 09:59:44 +0100537/** \brief Punt redirect type
Neale Ranns47527b22018-11-16 00:53:53 -0800538 @param rx_sw_if_index - specify the original RX interface of traffic
539 that should be redirected. ~0 means any interface.
Paul Vinciguerrac0e94412020-04-28 01:12:04 -0400540 @param tx_sw_if_index - the TX interface to which traffic should be
Neale Rannsd91c1db2017-07-31 02:30:50 -0700541 redirected.
Pavel Kotucek609e1212018-11-27 09:59:44 +0100542 @param nh - the next-hop to redirect the traffic to.
543 @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
544*/
Paul Vinciguerrae7174822019-08-07 00:05:59 -0400545typedef punt_redirect
Pavel Kotucek609e1212018-11-27 09:59:44 +0100546{
Ole Troan668605f2019-12-09 16:08:27 +0100547 vl_api_interface_index_t rx_sw_if_index;
548 vl_api_interface_index_t tx_sw_if_index;
Pavel Kotucek609e1212018-11-27 09:59:44 +0100549 vl_api_address_t nh;
550};
551
552/** \brief IP punt redirect
553 @param client_index - opaque cookie to identify the sender
554 @param context - sender context, to match reply w/ request
555 @param punt - punt definition
556 @param is_add - 1 to add neighbor, 0 to delete
Neale Rannsd91c1db2017-07-31 02:30:50 -0700557*/
558autoreply define ip_punt_redirect
559{
Nathan Skrzypczak2a1783f2021-08-10 15:05:29 +0200560 option deprecated;
Neale Rannsd91c1db2017-07-31 02:30:50 -0700561 u32 client_index;
562 u32 context;
Pavel Kotucek609e1212018-11-27 09:59:44 +0100563 vl_api_punt_redirect_t punt;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200564 bool is_add [default=true];
Pavel Kotucek609e1212018-11-27 09:59:44 +0100565};
566
567define ip_punt_redirect_dump
568{
569 u32 client_index;
570 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100571 vl_api_interface_index_t sw_if_index;
572 bool is_ipv6;
Pavel Kotucek609e1212018-11-27 09:59:44 +0100573};
574
575define ip_punt_redirect_details
576{
577 u32 context;
578 vl_api_punt_redirect_t punt;
Neale Rannsd91c1db2017-07-31 02:30:50 -0700579};
580
Nathan Skrzypczak2a1783f2021-08-10 15:05:29 +0200581/** \brief Punt redirect type
582 @param rx_sw_if_index - specify the original RX interface of traffic
583 that should be redirected. ~0 means any interface.
584 @param af - Address family (ip4 or ip6)
585 @param paths - the TX paths to which traffic should be redirected.
586*/
587typedef punt_redirect_v2
588{
589 vl_api_interface_index_t rx_sw_if_index [default=0xffffffff];
590 vl_api_address_family_t af;
591 u32 n_paths;
592 vl_api_fib_path_t paths[n_paths];
593};
594
595/** \brief Add IP punt redirect rule
596 @param client_index - opaque cookie to identify the sender
597 @param context - sender context, to match reply w/ request
598 @param punt - punt definition
599 @param is_add - 1 to add punt_redirect rule, 0 to delete
600*/
601autoreply define add_del_ip_punt_redirect_v2
602{
603 u32 client_index;
604 u32 context;
605 bool is_add [default=true];
606 vl_api_punt_redirect_v2_t punt;
607};
608
609define ip_punt_redirect_v2_dump
610{
611 u32 client_index;
612 u32 context;
613 vl_api_interface_index_t sw_if_index;
614 vl_api_address_family_t af;
615};
616
617define ip_punt_redirect_v2_details
618{
619 u32 context;
620 vl_api_punt_redirect_v2_t punt;
621};
622
Florin Coras595992c2017-11-06 17:17:08 -0800623autoreply define ip_container_proxy_add_del
624{
625 u32 client_index;
626 u32 context;
Neale Ranns37029302018-08-10 05:30:06 -0700627 vl_api_prefix_t pfx;
Ole Troan668605f2019-12-09 16:08:27 +0100628 vl_api_interface_index_t sw_if_index;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200629 bool is_add [default=true];
Florin Coras595992c2017-11-06 17:17:08 -0800630};
631
Matus Fabian75b9f452018-10-02 23:27:21 -0700632define ip_container_proxy_dump
633{
634 u32 client_index;
635 u32 context;
636};
637
638define ip_container_proxy_details
639{
640 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100641 vl_api_interface_index_t sw_if_index;
Matus Fabian75b9f452018-10-02 23:27:21 -0700642 vl_api_prefix_t prefix;
643};
644
Neale Rannsb8d44812017-11-10 06:53:54 -0800645/** \brief Configure IP source and L4 port-range check
646 @param client_index - opaque cookie to identify the sender
647 @param context - sender context, to match reply w/ request
648 @param is_ip6 - 1 if source address type is IPv6
649 @param is_add - 1 if add, 0 if delete
Neale Ranns37029302018-08-10 05:30:06 -0700650 @param ip - prefix to match
Neale Rannsb8d44812017-11-10 06:53:54 -0800651 @param number_of_ranges - length of low_port and high_port arrays (must match)
652 @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
653 @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
654 @param vrf_id - fib table/vrf id to associate the source and port-range check with
655 @note To specify a single port set low_port and high_port entry the same
656*/
657autoreply define ip_source_and_port_range_check_add_del
658{
659 u32 client_index;
660 u32 context;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200661 bool is_add [default=true];
Neale Ranns37029302018-08-10 05:30:06 -0700662 vl_api_prefix_t prefix;
Neale Rannsb8d44812017-11-10 06:53:54 -0800663 u8 number_of_ranges;
664 u16 low_ports[32];
665 u16 high_ports[32];
666 u32 vrf_id;
667};
668
669/** \brief Set interface source and L4 port-range request
670 @param client_index - opaque cookie to identify the sender
671 @param context - sender context, to match reply w/ request
672 @param interface_id - interface index
673 @param tcp_vrf_id - VRF associated with source and TCP port-range check
674 @param udp_vrf_id - VRF associated with source and TCP port-range check
675*/
676autoreply define ip_source_and_port_range_check_interface_add_del
677{
678 u32 client_index;
679 u32 context;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200680 bool is_add [default=true];
Ole Troan668605f2019-12-09 16:08:27 +0100681 vl_api_interface_index_t sw_if_index;
Neale Rannsb8d44812017-11-10 06:53:54 -0800682 u32 tcp_in_vrf_id;
683 u32 tcp_out_vrf_id;
684 u32 udp_in_vrf_id;
685 u32 udp_out_vrf_id;
686};
687
Neale Rannscbe25aa2019-09-30 10:53:31 +0000688/** \brief IPv6 set link local address on interface request
John Lo7f358b32018-04-28 01:19:24 -0400689 @param client_index - opaque cookie to identify the sender
690 @param context - sender context, to match reply w/ request
Neale Rannscbe25aa2019-09-30 10:53:31 +0000691 @param sw_if_index - interface to set link local on
692 @param ip - the new link local address
John Lo7f358b32018-04-28 01:19:24 -0400693*/
Neale Rannscbe25aa2019-09-30 10:53:31 +0000694autoreply define sw_interface_ip6_set_link_local_address
Neale Rannsb8d44812017-11-10 06:53:54 -0800695{
696 u32 client_index;
697 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100698 vl_api_interface_index_t sw_if_index;
Neale Rannscbe25aa2019-09-30 10:53:31 +0000699 vl_api_ip6_address_t ip;
Neale Rannsb8d44812017-11-10 06:53:54 -0800700};
701
BenoƮt Ganne58a19152021-01-18 19:24:34 +0100702/** \brief IPv6 get link local address on interface request
703 @param client_index - opaque cookie to identify the sender
704 @param context - sender context, to match reply w/ request
705 @param sw_if_index - interface to set link local on
706*/
707define sw_interface_ip6_get_link_local_address
708{
709 u32 client_index;
710 u32 context;
711 vl_api_interface_index_t sw_if_index;
712};
713
714/** \brief IPv6 link local address detail
715 @param context - sender context, to match reply w/ request
716 @param ip - the link local address
717*/
718define sw_interface_ip6_get_link_local_address_reply
719{
720 u32 context;
721 i32 retval;
722 vl_api_ip6_address_t ip;
723};
724
Neale Rannsb8d44812017-11-10 06:53:54 -0800725/** \brief IOAM enable : Enable in-band OAM
726 @param id - profile id
727 @param seqno - To enable Seqno Processing
Jakub Grajciar58989a32019-10-08 14:05:18 +0200728 @param analyse - Enabling analysis of iOAM at decap node
729 @param pow_enable - Proof of Work enabled or not flag
Neale Rannsb8d44812017-11-10 06:53:54 -0800730 @param trace_enable - iOAM Trace enabled or not flag
731*/
732autoreply define ioam_enable
733{
734 u32 client_index;
735 u32 context;
736 u16 id;
Jakub Grajciar58989a32019-10-08 14:05:18 +0200737 bool seqno;
738 bool analyse;
739 bool pot_enable;
740 bool trace_enable;
Neale Rannsb8d44812017-11-10 06:53:54 -0800741 u32 node_id;
742};
743
744/** \brief iOAM disable
745 @param client_index - opaque cookie to identify the sender
746 @param context - sender context, to match reply w/ request
747 @param index - MAP Domain index
748*/
749autoreply define ioam_disable
750{
751 u32 client_index;
752 u32 context;
753 u16 id;
754};
755
Klement Sekerade34c352019-06-25 11:19:22 +0000756enum ip_reass_type
757{
758 IP_REASS_TYPE_FULL = 0,
759 IP_REASS_TYPE_SHALLOW_VIRTUAL = 0x1,
760};
761
Klement Sekera75e7d132017-09-20 08:26:30 +0200762autoreply define ip_reassembly_set
763{
764 u32 client_index;
765 u32 context;
766 u32 timeout_ms;
767 u32 max_reassemblies;
Klement Sekera3a343d42019-05-16 14:35:46 +0200768 u32 max_reassembly_length;
Klement Sekera75e7d132017-09-20 08:26:30 +0200769 u32 expire_walk_interval_ms;
Ole Troan668605f2019-12-09 16:08:27 +0100770 bool is_ip6;
Klement Sekerade34c352019-06-25 11:19:22 +0000771 vl_api_ip_reass_type_t type;
Klement Sekera75e7d132017-09-20 08:26:30 +0200772};
773
774define ip_reassembly_get
775{
776 u32 client_index;
777 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100778 bool is_ip6;
Klement Sekerade34c352019-06-25 11:19:22 +0000779 vl_api_ip_reass_type_t type;
Klement Sekera75e7d132017-09-20 08:26:30 +0200780};
781
782define ip_reassembly_get_reply
783{
Klement Sekera75e7d132017-09-20 08:26:30 +0200784 u32 context;
785 i32 retval;
786 u32 timeout_ms;
787 u32 max_reassemblies;
Klement Sekera3a343d42019-05-16 14:35:46 +0200788 u32 max_reassembly_length;
Klement Sekera75e7d132017-09-20 08:26:30 +0200789 u32 expire_walk_interval_ms;
Ole Troan668605f2019-12-09 16:08:27 +0100790 bool is_ip6;
Klement Sekera75e7d132017-09-20 08:26:30 +0200791};
792
Klement Sekera4c533132018-02-22 11:41:12 +0100793/** \brief Enable/disable reassembly feature
794 @param client_index - opaque cookie to identify the sender
795 @param context - sender context, to match reply w/ request
796 @param sw_if_index - interface to enable/disable feature on
797 @param enable_ip4 - enable ip4 reassembly if non-zero, disable if 0
798 @param enable_ip6 - enable ip6 reassembly if non-zero, disable if 0
799*/
800autoreply define ip_reassembly_enable_disable
801{
802 u32 client_index;
803 u32 context;
Ole Troan668605f2019-12-09 16:08:27 +0100804 vl_api_interface_index_t sw_if_index;
805 bool enable_ip4;
806 bool enable_ip6;
Klement Sekerade34c352019-06-25 11:19:22 +0000807 vl_api_ip_reass_type_t type;
Klement Sekera4c533132018-02-22 11:41:12 +0100808};
809
Neale Ranns8f5fef22020-12-21 08:29:34 +0000810/**
811 @brief Set a Path MTU value. i.e. a MTU value for a given neighbour.
812 The neighbour can be described as attached (w/ interface and next-hop)
813 or remote (w/ table_id and next-hop);
814 @param client_index - opaque cookie to identify the sender
815 @param context - sender context, to match reply w/ request
816 @param table_id - table-ID for next-hop
817 @param nh - Next hop
818 @param path_mtu - value to set, 0 is disable.
819*/
820typedef ip_path_mtu
821{
822 u32 client_index;
823 u32 context;
824 u32 table_id;
825 vl_api_address_t nh;
826 u16 path_mtu;
827};
828autoreply define ip_path_mtu_update
829{
830 u32 client_index;
831 u32 context;
832 vl_api_ip_path_mtu_t pmtu;
833};
834define ip_path_mtu_get
835{
836 u32 client_index;
837 u32 context;
838 u32 cursor;
839};
840define ip_path_mtu_get_reply
841{
842 u32 context;
843 i32 retval;
844 u32 cursor;
845};
846define ip_path_mtu_details
847{
848 u32 context;
849 vl_api_ip_path_mtu_t pmtu;
850};
851service {
852 rpc ip_path_mtu_get returns ip_path_mtu_get_reply
853 stream ip_path_mtu_details;
854};
855
856autoreply define ip_path_mtu_replace_begin
857{
858 u32 client_index;
859 u32 context;
860};
861autoreply define ip_path_mtu_replace_end
862{
863 u32 client_index;
864 u32 context;
865};
866
Dave Barachb5e8a772016-12-06 12:04:42 -0500867/*
868 * Local Variables:
869 * eval: (c-set-style "gnu")
870 * End:
871 */