1 /* Hey Emacs use -*- mode: C -*- */
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:
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 This file defines vpp IP control-plane API messages which are generally
20 called through a shared memory interface.
23 option version = "3.0.3";
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";
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 unicast
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
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
52 autoreply define ip_table_add_del
56 bool is_add [default=true];
57 vl_api_ip_table_t table;
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
70 /** \brief IP table replace being
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 exists.
77 the CP declares 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 course free
80 to add and delete entries as usual.
81 The underlying mechanism by which VPP implements this replace is
82 purposefully left unspecified.
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
88 autoreply define ip_table_replace_begin
92 vl_api_ip_table_t table;
95 /** \brief IP table replace end
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
103 autoreply define ip_table_replace_end
107 vl_api_ip_table_t table;
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
116 autoreply define ip_table_flush
120 vl_api_ip_table_t table;
123 /** \brief IP FIB table response
124 @param context - sender context
125 @param table - description of the table
127 define ip_table_details
130 vl_api_ip_table_t table;
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
144 vl_api_prefix_t prefix;
146 vl_api_fib_path_t paths[n_paths];
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
155 is_add=0 & is_multipath=0 implies delete all paths
156 @param is_add - Are the paths being added or removed
158 define ip_route_add_del
162 bool is_add [default=true];
164 vl_api_ip_route_t route;
166 define ip_route_add_del_reply
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)
181 vl_api_ip_table_t table;
184 /** \brief IP FIB table entry response
185 @param route The route entry in the table
187 define ip_route_details
190 vl_api_ip_route_t route;
193 /** \brief Lookup IP route from a table
194 @param client_index - opaque cookie to identify the sender
195 @param table_id - The IP table to look the route up in
196 @param exact - 0 for normal route lookup, 1 for exact match only
197 @param prefix - The prefix (or host) for route lookup.
199 define ip_route_lookup
205 vl_api_prefix_t prefix;
208 /** \brief IP FIB table lookup response
209 @param retval - return code of the lookup
210 @param route - The route entry in the table if found
212 define ip_route_lookup_reply
216 vl_api_ip_route_t route;
219 /** \brief Set the ip flow hash config for a fib request
220 @param client_index - opaque cookie to identify the sender
221 @param context - sender context, to match reply w/ request
222 @param vrf_id - vrf/fib id
223 @param is_ipv6 - if non-zero the fib is ip6, else ip4
224 @param src - if non-zero include src in flow hash
225 @param dst - if non-zero include dst in flow hash
226 @param sport - if non-zero include sport in flow hash
227 @param dport - if non-zero include dport in flow hash
228 @param proto -if non-zero include proto in flow hash
229 @param reverse - if non-zero include reverse in flow hash
230 @param symmetric - if non-zero include symmetry in flow hash
232 autoreply define set_ip_flow_hash
249 @brief flow hash settings for an IP table
250 @param src - include src in flow hash
251 @param dst - include dst in flow hash
252 @param sport - include sport in flow hash
253 @param dport - include dport in flow hash
254 @param proto - include proto in flow hash
255 @param reverse - include reverse in flow hash
256 @param symmetric - include symmetry in flow hash
257 @param flowlabel - include flowlabel in flow hash
259 enumflag ip_flow_hash_config
261 IP_API_FLOW_HASH_SRC_IP = 0x01,
262 IP_API_FLOW_HASH_DST_IP = 0x02,
263 IP_API_FLOW_HASH_SRC_PORT = 0x04,
264 IP_API_FLOW_HASH_DST_PORT = 0x08,
265 IP_API_FLOW_HASH_PROTO = 0x10,
266 IP_API_FLOW_HASH_REVERSE = 0x20,
267 IP_API_FLOW_HASH_SYMETRIC = 0x40,
268 IP_API_FLOW_HASH_FLOW_LABEL = 0x80,
271 autoreply define set_ip_flow_hash_v2
276 vl_api_address_family_t af;
277 vl_api_ip_flow_hash_config_t flow_hash_config;
280 /** \brief Set the ip flow hash router ID
281 @param client_index - opaque cookie to identify the sender
282 @param context - sender context, to match reply w/ request
283 @param router_id - The ID of the router. Mixed into the hash.
284 Used to prevent polarisation across a network,
285 since each router is assumed to have a different ID
287 autoreply define set_ip_flow_hash_router_id
294 /** \brief IPv6 interface enable / disable request
295 @param client_index - opaque cookie to identify the sender
296 @param context - sender context, to match reply w/ request
297 @param sw_if_index - interface used to reach neighbor
298 @param enable - if non-zero enable ip6 on interface, else disable
300 autoreply define sw_interface_ip6_enable_disable
304 vl_api_interface_index_t sw_if_index;
305 bool enable; /* set to true if enable */
308 /** \brief Dump IP multicast fib table
309 @param client_index - opaque cookie to identify the sender
311 define ip_mtable_dump
316 define ip_mtable_details
320 vl_api_ip_table_t table;
323 /** \brief Add / del route request
325 Adds a route, consisting both of the MFIB entry to match packets
326 (which may already exist) and a path to send those packets down.
327 Routes can be entered repeatedly to add multiple paths. Deletions are
330 @param client_index - opaque cookie to identify the sender
331 @param context - sender context, to match reply w/ request
332 @param table_id - fib table /vrf associated with the route
333 @param is_add - true if adding a route; false if deleting one
334 @param is_ipv6 - true iff all the addresses are v6
335 @param entry_flags - see fib_entry_flag_t
336 @param itf_flags - see mfib_entry_flags_t
337 @param next_hop_afi - see dpo_proto_t; the type of destination description
338 @param src_address - the source of the packet
339 @param grp_address - the group the packet is destined to
340 @param nh_address - the nexthop to forward the packet to
341 @param next_hop_sw_if_index - interface to emit packet on
343 BIER AFIs use the BIER imposition ID. v4 and v6 AFIs use either the
344 interface or the nexthop address.
346 Note that if the route is source-specific (S is supplied, not all 0s),
347 the prefix match is treated as exact (prefixlen /32 or /128).
349 FIXME not complete yet
354 vl_api_mfib_entry_flags_t entry_flags;
356 vl_api_mprefix_t prefix;
358 vl_api_mfib_path_t paths[n_paths];
361 define ip_mroute_add_del
365 bool is_add [default=true];
367 vl_api_ip_mroute_t route;
369 define ip_mroute_add_del_reply
376 /** \brief Dump IP multicast fib table
377 @param table - The table from which to dump routes (ony ID an AF are needed)
379 define ip_mroute_dump
383 vl_api_ip_table_t table;
386 /** \brief IP Multicast Route Details
387 @param route - Details of the route
389 define ip_mroute_details
392 vl_api_ip_mroute_t route;
395 define ip_address_details
398 vl_api_interface_index_t sw_if_index;
399 vl_api_address_with_prefix_t prefix;
402 define ip_address_dump
406 vl_api_interface_index_t sw_if_index;
410 /** \brief IP unnumbered configurations
411 @param sw_if_index The interface that has unnumbered configuration
412 @param ip_sw_if_index The IP interface that it is unnumbered to
414 define ip_unnumbered_details
417 vl_api_interface_index_t sw_if_index;
418 vl_api_interface_index_t ip_sw_if_index;
421 /** \brief Dump IP unnumbered configurations
422 @param sw_if_index ~0 for all interfaces, else the interface desired
424 define ip_unnumbered_dump
428 vl_api_interface_index_t sw_if_index [default=0xffffffff];
434 vl_api_interface_index_t sw_if_index;
445 define mfib_signal_dump
451 define mfib_signal_details
454 vl_api_interface_index_t sw_if_index;
456 vl_api_mprefix_t prefix;
458 u8 ip_packet_data[256];
461 /** \brief IP punt policer
462 @param client_index - opaque cookie to identify the sender
463 @param context - sender context, to match reply w/ request
464 @param is_add - 1 to add neighbor, 0 to delete
465 @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
466 @param policer_index - Index of policer to use
468 autoreply define ip_punt_police
473 bool is_add [default=true];
477 /** \brief Punt redirect type
478 @param rx_sw_if_index - specify the original RX interface of traffic
479 that should be redirected. ~0 means any interface.
480 @param tx_sw_if_index - the TX interface to which traffic should be
482 @param nh - the next-hop to redirect the traffic to.
483 @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
485 typedef punt_redirect
487 vl_api_interface_index_t rx_sw_if_index;
488 vl_api_interface_index_t tx_sw_if_index;
492 /** \brief IP punt redirect
493 @param client_index - opaque cookie to identify the sender
494 @param context - sender context, to match reply w/ request
495 @param punt - punt definition
496 @param is_add - 1 to add neighbor, 0 to delete
498 autoreply define ip_punt_redirect
502 vl_api_punt_redirect_t punt;
503 bool is_add [default=true];
506 define ip_punt_redirect_dump
510 vl_api_interface_index_t sw_if_index;
514 define ip_punt_redirect_details
517 vl_api_punt_redirect_t punt;
520 autoreply define ip_container_proxy_add_del
525 vl_api_interface_index_t sw_if_index;
526 bool is_add [default=true];
529 define ip_container_proxy_dump
535 define ip_container_proxy_details
538 vl_api_interface_index_t sw_if_index;
539 vl_api_prefix_t prefix;
542 /** \brief Configure IP source and L4 port-range check
543 @param client_index - opaque cookie to identify the sender
544 @param context - sender context, to match reply w/ request
545 @param is_ip6 - 1 if source address type is IPv6
546 @param is_add - 1 if add, 0 if delete
547 @param ip - prefix to match
548 @param number_of_ranges - length of low_port and high_port arrays (must match)
549 @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
550 @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
551 @param vrf_id - fib table/vrf id to associate the source and port-range check with
552 @note To specify a single port set low_port and high_port entry the same
554 autoreply define ip_source_and_port_range_check_add_del
558 bool is_add [default=true];
559 vl_api_prefix_t prefix;
566 /** \brief Set interface source and L4 port-range request
567 @param client_index - opaque cookie to identify the sender
568 @param context - sender context, to match reply w/ request
569 @param interface_id - interface index
570 @param tcp_vrf_id - VRF associated with source and TCP port-range check
571 @param udp_vrf_id - VRF associated with source and TCP port-range check
573 autoreply define ip_source_and_port_range_check_interface_add_del
577 bool is_add [default=true];
578 vl_api_interface_index_t sw_if_index;
585 /** \brief IPv6 set link local address on interface request
586 @param client_index - opaque cookie to identify the sender
587 @param context - sender context, to match reply w/ request
588 @param sw_if_index - interface to set link local on
589 @param ip - the new link local address
591 autoreply define sw_interface_ip6_set_link_local_address
595 vl_api_interface_index_t sw_if_index;
596 vl_api_ip6_address_t ip;
599 /** \brief IPv6 get link local address on interface request
600 @param client_index - opaque cookie to identify the sender
601 @param context - sender context, to match reply w/ request
602 @param sw_if_index - interface to set link local on
604 define sw_interface_ip6_get_link_local_address
608 vl_api_interface_index_t sw_if_index;
611 /** \brief IPv6 link local address detail
612 @param context - sender context, to match reply w/ request
613 @param ip - the link local address
615 define sw_interface_ip6_get_link_local_address_reply
619 vl_api_ip6_address_t ip;
622 /** \brief IOAM enable : Enable in-band OAM
623 @param id - profile id
624 @param seqno - To enable Seqno Processing
625 @param analyse - Enabling analysis of iOAM at decap node
626 @param pow_enable - Proof of Work enabled or not flag
627 @param trace_enable - iOAM Trace enabled or not flag
629 autoreply define ioam_enable
641 /** \brief iOAM disable
642 @param client_index - opaque cookie to identify the sender
643 @param context - sender context, to match reply w/ request
644 @param index - MAP Domain index
646 autoreply define ioam_disable
655 IP_REASS_TYPE_FULL = 0,
656 IP_REASS_TYPE_SHALLOW_VIRTUAL = 0x1,
659 autoreply define ip_reassembly_set
664 u32 max_reassemblies;
665 u32 max_reassembly_length;
666 u32 expire_walk_interval_ms;
668 vl_api_ip_reass_type_t type;
671 define ip_reassembly_get
676 vl_api_ip_reass_type_t type;
679 define ip_reassembly_get_reply
684 u32 max_reassemblies;
685 u32 max_reassembly_length;
686 u32 expire_walk_interval_ms;
690 /** \brief Enable/disable reassembly feature
691 @param client_index - opaque cookie to identify the sender
692 @param context - sender context, to match reply w/ request
693 @param sw_if_index - interface to enable/disable feature on
694 @param enable_ip4 - enable ip4 reassembly if non-zero, disable if 0
695 @param enable_ip6 - enable ip6 reassembly if non-zero, disable if 0
697 autoreply define ip_reassembly_enable_disable
701 vl_api_interface_index_t sw_if_index;
704 vl_api_ip_reass_type_t type;
709 * eval: (c-set-style "gnu")