FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
ip.api
Go to the documentation of this file.
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 vpp IP control-plane API messages which are generally
20  called through a shared memory interface.
21 */
22 
23 option version = "3.0.1";
24 
25 import "vnet/interface_types.api";
26 import "vnet/fib/fib_types.api";
27 import "vnet/ethernet/ethernet_types.api";
28 import "vnet/mfib/mfib_types.api";
29 import "vnet/interface_types.api";
30 
31 /** \brief An IP table
32  @param is_ipv6 - V4 or V6 table
33  @param table_id - table ID associated with the route
34  This table ID will apply to both the unicats
35  and mlticast FIBs
36  @param name - A client provided name/tag for the table. If this is
37  not set by the client, then VPP will generate something
38  meaningfull.
39 */
40 typedef ip_table
41 {
42  u32 table_id;
43  bool is_ip6;
44  string name[64];
45 };
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 */
52 autoreply define ip_table_add_del
53 {
56  bool is_add [default=true];
57  vl_api_ip_table_t table;
58 };
59 
60 /** \brief Dump IP all fib tables
61  @param client_index - opaque cookie to identify the sender
62  @param context - sender context, to match reply w/ request
63 */
64 define ip_table_dump
65 {
68 };
69 
70 /** \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
76  going to delete anything that already eixts.
77  the CP delcartes the start of this procedure with this begin_replace
78  API Call, and when it has populated all the entries it wants, it calls
79  the below end_replace API. From this point on it is of coursce free
80  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 */
88 autoreply define ip_table_replace_begin
89 {
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 */
103 autoreply define ip_table_replace_end
104 {
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 */
116 autoreply define ip_table_flush
117 {
120  vl_api_ip_table_t table;
121 };
122 
123 /** \brief IP FIB table response
124  @param context - sender context
125  @param table - description of the table
126 */
127 manual_endian manual_print define ip_table_details
128 {
130  vl_api_ip_table_t table;
131 };
132 
133 /** \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
138  @param paths The paths of the route
139 */
140 typedef ip_route
141 {
142  u32 table_id;
144  vl_api_prefix_t prefix;
146  vl_api_fib_path_t paths[n_paths];
147 };
148 
149 /** \brief Add / del route request
150  @param client_index - opaque cookie to identify the sender
151  @param context - sender context, to match reply w/ request
152  @param is_multipath - Set to 1 if these paths will be added/removed
153  to/from the existing set, or 0 to replace
154  the existing set.
155  is_add=0 & is_multipath=0 implies delete all paths
156  @param is_add - Are the paths being added or removed
157 */
158 define ip_route_add_del
159 {
162  bool is_add [default=true];
164  vl_api_ip_route_t route;
165 };
166 define ip_route_add_del_reply
167 {
171 };
172 
173 /** \brief Dump IP routes from a table
174  @param client_index - opaque cookie to identify the sender
175  @param table - The table from which to dump routes (ony ID an AF are needed)
176 */
177 define ip_route_dump
178 {
181  vl_api_ip_table_t table;
182 };
183 
184 /** \brief IP FIB table entry response
185  @param route The route entry in the table
186 */
187 manual_endian manual_print define ip_route_details
188 {
190  vl_api_ip_route_t route;
191 };
192 
193 /** \brief Set the ip flow hash config for a fib request
194  @param client_index - opaque cookie to identify the sender
195  @param context - sender context, to match reply w/ request
196  @param vrf_id - vrf/fib id
197  @param is_ipv6 - if non-zero the fib is ip6, else ip4
198  @param src - if non-zero include src in flow hash
199  @param dst - if non-zero include dst in flow hash
200  @param sport - if non-zero include sport in flow hash
201  @param dport - if non-zero include dport in flow hash
202  @param proto -if non-zero include proto in flow hash
203  @param reverse - if non-zero include reverse in flow hash
204  @param symmetric - if non-zero include symmetry in flow hash
205 */
206 autoreply define set_ip_flow_hash
207 {
211  bool is_ipv6;
212  bool src;
213  bool dst;
214  bool sport;
215  bool dport;
216  bool proto;
217  bool reverse;
218  bool symmetric;
219 };
220 
221 /** \brief IPv6 interface enable / disable request
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 - interface used to reach neighbor
225  @param enable - if non-zero enable ip6 on interface, else disable
226 */
227 autoreply define sw_interface_ip6_enable_disable
228 {
231  vl_api_interface_index_t sw_if_index;
232  bool enable; /* set to true if enable */
233 };
234 
235 /** \brief Dump IP multicast fib table
236  @param client_index - opaque cookie to identify the sender
237 */
238 define ip_mtable_dump
239 {
242 };
243 define ip_mtable_details
244 {
247  vl_api_ip_table_t table;
248 };
249 
250 /** \brief Add / del route request
251 
252  Adds a route, consisting both of the MFIB entry to match packets
253  (which may already exist) and a path to send those packets down.
254  Routes can be entered repeatedly to add multiple paths. Deletions are
255  per-path.
256 
257  @param client_index - opaque cookie to identify the sender
258  @param context - sender context, to match reply w/ request
259  @param table_id - fib table /vrf associated with the route
260  @param is_add - true if adding a route; false if deleting one
261  @param is_ipv6 - true iff all the addresses are v6
262  @param entry_flags - see fib_entry_flag_t
263  @param itf_flags - see mfib_entry_flags_t
264  @param next_hop_afi - see dpo_proto_t; the type of destination description
265  @param src_address - the source of the packet
266  @param grp_address - the group the packet is destined to
267  @param nh_address - the nexthop to forward the packet to
268  @param next_hop_sw_if_index - interface to emit packet on
269 
270  BIER AFIs use the BIER imposition ID. v4 and v6 AFIs use either the
271  interface or the nexthop address.
272 
273  Note that if the route is source-specific (S is supplied, not all 0s),
274  the prefix match is treated as exact (prefixlen /32 or /128).
275 
276  FIXME not complete yet
277 */
278 typedef ip_mroute
279 {
280  u32 table_id;
283  vl_api_mprefix_t prefix;
284  u8 n_paths;
285  vl_api_mfib_path_t paths[n_paths];
286 };
287 
288 define ip_mroute_add_del
289 {
292  bool is_add [default=true];
294  vl_api_ip_mroute_t route;
295 };
296 define ip_mroute_add_del_reply
297 {
301 };
302 
303 /** \brief Dump IP multicast fib table
304  @param table - The table from which to dump routes (ony ID an AF are needed)
305 */
306 define ip_mroute_dump
307 {
310  vl_api_ip_table_t table;
311 };
312 
313 /** \brief IP Multicast Route Details
314  @param route - Details of the route
315 */
316 manual_endian manual_print define ip_mroute_details
317 {
319  vl_api_ip_mroute_t route;
320 };
321 
322 define ip_address_details
323 {
325  vl_api_interface_index_t sw_if_index;
326  vl_api_address_with_prefix_t prefix;
327 };
328 
329 define ip_address_dump
330 {
333  vl_api_interface_index_t sw_if_index;
334  bool is_ipv6;
335 };
336 
337 /** \brief IP unnumbered configurations
338  @param sw_if_index The interface that has unnumbered configuration
339  @param ip_sw_if_index The IP interface that it is unnnumbered to
340 */
341 define ip_unnumbered_details
342 {
344  vl_api_interface_index_t sw_if_index;
345  vl_api_interface_index_t ip_sw_if_index;
346 };
347 
348 /** \brief Dump IP unnumbered configurations
349  @param sw_if_index ~0 for all interfaces, else the interface desired
350 */
351 define ip_unnumbered_dump
352 {
355  vl_api_interface_index_t sw_if_index;
356 };
357 
358 define ip_details
359 {
361  vl_api_interface_index_t sw_if_index;
362  bool is_ipv6;
363 };
364 
365 define ip_dump
366 {
369  bool is_ipv6;
370 };
371 
372 define mfib_signal_dump
373 {
376 };
377 
378 define mfib_signal_details
379 {
381  vl_api_interface_index_t sw_if_index;
383  vl_api_mprefix_t prefix;
385  u8 ip_packet_data[256];
386 };
387 
388 /** \brief IP punt policer
389  @param client_index - opaque cookie to identify the sender
390  @param context - sender context, to match reply w/ request
391  @param is_add - 1 to add neighbor, 0 to delete
392  @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
393  @param policer_index - Index of policer to use
394 */
395 autoreply define ip_punt_police
396 {
400  bool is_add [default=true];
401  bool is_ip6;
402 };
403 
404 /** \brief Punt redirect type
405  @param rx_sw_if_index - specify the original RX interface of traffic
406  that should be redirected. ~0 means any interface.
407  @param tx_sw_if_index - the TX interface to which traffic shoulde be
408  redirected.
409  @param nh - the next-hop to redirect the traffic to.
410  @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
411 */
412 typedef punt_redirect
413 {
414  vl_api_interface_index_t rx_sw_if_index;
415  vl_api_interface_index_t tx_sw_if_index;
416  vl_api_address_t nh;
417 };
418 
419 /** \brief IP punt redirect
420  @param client_index - opaque cookie to identify the sender
421  @param context - sender context, to match reply w/ request
422  @param punt - punt definition
423  @param is_add - 1 to add neighbor, 0 to delete
424 */
425 autoreply define ip_punt_redirect
426 {
429  vl_api_punt_redirect_t punt;
430  bool is_add [default=true];
431 };
432 
433 define ip_punt_redirect_dump
434 {
437  vl_api_interface_index_t sw_if_index;
438  bool is_ipv6;
439 };
440 
441 define ip_punt_redirect_details
442 {
444  vl_api_punt_redirect_t punt;
445 };
446 
447 autoreply define ip_container_proxy_add_del
448 {
451  vl_api_prefix_t pfx;
452  vl_api_interface_index_t sw_if_index;
453  bool is_add [default=true];
454 };
455 
456 define ip_container_proxy_dump
457 {
460 };
461 
462 define ip_container_proxy_details
463 {
465  vl_api_interface_index_t sw_if_index;
466  vl_api_prefix_t prefix;
467 };
468 
469 /** \brief Configure IP source and L4 port-range check
470  @param client_index - opaque cookie to identify the sender
471  @param context - sender context, to match reply w/ request
472  @param is_ip6 - 1 if source address type is IPv6
473  @param is_add - 1 if add, 0 if delete
474  @param ip - prefix to match
475  @param number_of_ranges - length of low_port and high_port arrays (must match)
476  @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
477  @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
478  @param vrf_id - fib table/vrf id to associate the source and port-range check with
479  @note To specify a single port set low_port and high_port entry the same
480 */
481 autoreply define ip_source_and_port_range_check_add_del
482 {
485  bool is_add [default=true];
486  vl_api_prefix_t prefix;
488  u16 low_ports[32];
489  u16 high_ports[32];
491 };
492 
493 /** \brief Set interface source and L4 port-range request
494  @param client_index - opaque cookie to identify the sender
495  @param context - sender context, to match reply w/ request
496  @param interface_id - interface index
497  @param tcp_vrf_id - VRF associated with source and TCP port-range check
498  @param udp_vrf_id - VRF associated with source and TCP port-range check
499 */
500 autoreply define ip_source_and_port_range_check_interface_add_del
501 {
504  bool is_add [default=true];
505  vl_api_interface_index_t sw_if_index;
510 };
511 
512 /** \brief Set interface source check request
513  @param client_index - opaque cookie to identify the sender
514  @param context - sender context, to match reply w/ request
515  @param is_add - add or del
516  @param loose - strict or loose
517  @param sw_if_index - interface index
518 */
519 autoreply define ip_source_check_interface_add_del
520 {
523  bool is_add [default=true];
524  bool loose;
525  vl_api_interface_index_t sw_if_index;
526 };
527 
528 /** \brief IPv6 set link local address on interface request
529  @param client_index - opaque cookie to identify the sender
530  @param context - sender context, to match reply w/ request
531  @param sw_if_index - interface to set link local on
532  @param ip - the new link local address
533 */
534 autoreply define sw_interface_ip6_set_link_local_address
535 {
538  vl_api_interface_index_t sw_if_index;
539  vl_api_ip6_address_t ip;
540 };
541 
542 /** \brief IOAM enable : Enable in-band OAM
543  @param id - profile id
544  @param seqno - To enable Seqno Processing
545  @param analyse - Enabling analysis of iOAM at decap node
546  @param pow_enable - Proof of Work enabled or not flag
547  @param trace_enable - iOAM Trace enabled or not flag
548 */
549 autoreply define ioam_enable
550 {
554  bool seqno;
555  bool analyse;
559 };
560 
561 /** \brief iOAM disable
562  @param client_index - opaque cookie to identify the sender
563  @param context - sender context, to match reply w/ request
564  @param index - MAP Domain index
565 */
566 autoreply define ioam_disable
567 {
571 };
572 
574 {
577 };
578 
579 autoreply define ip_reassembly_set
580 {
587  bool is_ip6;
588  vl_api_ip_reass_type_t type;
589 };
590 
591 define ip_reassembly_get
592 {
595  bool is_ip6;
596  vl_api_ip_reass_type_t type;
597 };
598 
599 define ip_reassembly_get_reply
600 {
607  bool is_ip6;
608 };
609 
610 /** \brief Enable/disable reassembly feature
611  @param client_index - opaque cookie to identify the sender
612  @param context - sender context, to match reply w/ request
613  @param sw_if_index - interface to enable/disable feature on
614  @param enable_ip4 - enable ip4 reassembly if non-zero, disable if 0
615  @param enable_ip6 - enable ip6 reassembly if non-zero, disable if 0
616 */
617 autoreply define ip_reassembly_enable_disable
618 {
621  vl_api_interface_index_t sw_if_index;
624  vl_api_ip_reass_type_t type;
625 };
626 
627 /*
628  * Local Variables:
629  * eval: (c-set-style "gnu")
630  * End:
631  */
vl_api_ip_reass_type_t type
Definition: ip.api:596
vl_api_ip_table_t table
Definition: ip.api:181
vl_api_ip_table_t table
Definition: ip.api:310
vl_api_ip_table_t table
Definition: ip.api:120
bool is_ipv6
Definition: ip.api:369
vl_api_punt_redirect_t punt
Definition: ip.api:429
vl_api_ip_reass_type_t type
Definition: ip.api:624
typedef ip_route
An IP route.
Definition: ip.api:141
typedef ip_table
An IP table.
Definition: ip.api:41
vl_api_prefix_t prefix
Definition: ip.api:144
vl_api_interface_index_t sw_if_index
Definition: ip.api:325
unsigned char u8
Definition: types.h:56
vl_api_interface_index_t sw_if_index
Definition: ip.api:333
vl_api_interface_index_t sw_if_index
Definition: ip.api:621
vl_api_ip_mroute_t route
Definition: ip.api:294
vl_api_interface_index_t sw_if_index
Definition: ip.api:344
vl_api_ip_table_t table
Definition: ip.api:57
unsigned int u32
Definition: types.h:88
vl_api_interface_index_t sw_if_index
Definition: ip.api:231
vl_api_address_with_prefix_t prefix
Definition: ip.api:326
bool is_ip6
Definition: ip.api:43
vl_api_ip_route_t route
Definition: ip.api:164
typedef punt_redirect
Punt redirect type.
Definition: ip.api:413
unsigned short u16
Definition: types.h:57
vl_api_interface_index_t sw_if_index
Definition: ip.api:452
vl_api_mprefix_t prefix
Definition: ip.api:383
u8 n_paths
Definition: ip.api:145
string name[64]
Definition: ip.api:44
vl_api_fib_path_t paths[n_paths]
Definition: ip.api:146
signed int i32
Definition: types.h:77
vl_api_interface_index_t sw_if_index
Definition: ip.api:465
vl_api_interface_index_t tx_sw_if_index
Definition: ip.api:415
u32 stats_index
Definition: ip.api:143
vl_api_ip_mroute_t route
Definition: ip.api:319
vl_api_interface_index_t sw_if_index
Definition: ip.api:355
vl_api_interface_index_t ip_sw_if_index
Definition: ip.api:345
vl_api_ip_table_t table
Definition: ip.api:247
static uword ip_punt_redirect(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 arc_index, fib_protocol_t fproto)
Definition: ip_punt_drop.h:277
vl_api_punt_redirect_t punt
Definition: ip.api:444
vl_api_interface_index_t sw_if_index
Definition: ip.api:381
typedef ip_mroute
Add / del route request.
Definition: ip.api:279
option version
Definition: ip.api:23
vl_api_ip_table_t table
Definition: ip.api:130
vl_api_ip_table_t table
Definition: ip.api:92
vl_api_ip_reass_type_t type
Definition: ip.api:588
vl_api_ip_route_t route
Definition: ip.api:190
u32 client_index
Definition: ip.api:367
vl_api_address_t nh
Definition: ip.api:416
u32 entry_flags
Definition: ip.api:281
vl_api_interface_index_t sw_if_index
Definition: ip.api:361
vl_api_interface_index_t sw_if_index
Definition: ip.api:525
u32 rpf_id
Definition: ip.api:282
vl_api_ip_table_t table
Definition: ip.api:107
ip_reass_type
Definition: ip.api:573
u32 table_id
Definition: fib_types.api:118
vl_api_interface_index_t sw_if_index
Definition: ip.api:437