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.0";
25 import "vnet/fib/fib_types.api";
26 import "vnet/ethernet/ethernet_types.api";
27 import "vnet/mfib/mfib_types.api";
29 /** \brief An IP table
30 @param is_ipv6 - V4 or V6 table
31 @param table_id - table ID associated with the route
32 This table ID will apply to both the unicats
34 @param name - A client provided name/tag for the table. If this is
35 not set by the client, then VPP will generate something
45 /** \brief Add / del table request
46 A table can be added multiple times, but need be deleted only once.
47 @param client_index - opaque cookie to identify the sender
48 @param context - sender context, to match reply w/ request
50 autoreply define ip_table_add_del
55 vl_api_ip_table_t table;
58 /** \brief Dump IP all fib tables
59 @param client_index - opaque cookie to identify the sender
60 @param context - sender context, to match reply w/ request
68 /** \brief IP FIB table response
69 @param context - sender context
70 @param table - description of the table
72 manual_endian manual_print define ip_table_details
75 vl_api_ip_table_t table;
78 /** \brief An IP route
79 @param table_id The IP table the route is in
80 @param stats_index The index of the route in the stats segment
81 @param prefix the prefix for the route
82 @param n_paths The number of paths the route has
83 @param paths The paths of the route
89 vl_api_prefix_t prefix;
91 vl_api_fib_path_t paths[n_paths];
94 /** \brief Add / del route request
95 @param client_index - opaque cookie to identify the sender
96 @param context - sender context, to match reply w/ request
97 @param is_multipath - Set to 1 if these paths will be added/removed
98 to/from the existing set, or 0 to replace
100 is_add=0 & is_multipath=0 implies delete all paths
101 @param is_add - Are the paths being added or removed
103 define ip_route_add_del
109 vl_api_ip_route_t route;
111 define ip_route_add_del_reply
118 /** \brief Dump IP routes from a table
119 @param client_index - opaque cookie to identify the sender
120 @param table - The table from which to dump routes (ony ID an AF are needed)
126 vl_api_ip_table_t table;
129 /** \brief IP FIB table entry response
130 @param route The route entry in the table
132 manual_endian manual_print define ip_route_details
135 vl_api_ip_route_t route;
138 /** \brief IP neighbor flags
139 @param is_static - A static neighbor Entry - there are not flushed
140 If the interface goes down.
141 @param is_no_fib_entry - Do not create a corresponding entry in the FIB
142 table for the neighbor.
144 enum ip_neighbor_flags
146 IP_API_NEIGHBOR_FLAG_NONE = 0,
147 IP_API_NEIGHBOR_FLAG_STATIC = 0x1,
148 IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY = 0x2,
151 /** \brief IP neighbor
152 @param sw_if_index - interface used to reach neighbor
153 @param mac_address - l2 address of the neighbor
154 @param ip_address - ip4 or ip6 address of the neighbor
155 @param flags - flags for the nieghbor
157 typedef ip_neighbor {
159 vl_api_ip_neighbor_flags_t flags;
160 vl_api_mac_address_t mac_address;
161 vl_api_address_t ip_address;
164 /** \brief IP neighbor add / del request
165 @param client_index - opaque cookie to identify the sender
166 @param context - sender context, to match reply w/ request
167 @param is_add - 1 to add neighbor, 0 to delete
168 @param neighbor - the neighor to add/remove
170 define ip_neighbor_add_del
174 /* 1 = add, 0 = delete */
176 vl_api_ip_neighbor_t neighbor;
178 define ip_neighbor_add_del_reply
185 /** \brief Dump IP neighboors
186 @param client_index - opaque cookie to identify the sender
187 @param context - sender context, to match reply w/ request
188 @param sw_if_index - the interface to dump neighboors, ~0 == all
189 @param is_ipv6 - [1|0] to indicate if address family is ipv[6|4]
191 define ip_neighbor_dump
199 /** \brief IP neighboors dump response
200 @param context - sender context which was passed in the request
201 @param neighbour - the neighbor
203 define ip_neighbor_details {
205 vl_api_ip_neighbor_t neighbor;
208 /** \brief Set the ip flow hash config for a fib request
209 @param client_index - opaque cookie to identify the sender
210 @param context - sender context, to match reply w/ request
211 @param vrf_id - vrf/fib id
212 @param is_ipv6 - if non-zero the fib is ip6, else ip4
213 @param src - if non-zero include src in flow hash
214 @param dst - if non-zero include dst in flow hash
215 @param sport - if non-zero include sport in flow hash
216 @param dport - if non-zero include dport in flow hash
217 @param proto -if non-zero include proto in flow hash
218 @param reverse - if non-zero include reverse in flow hash
219 @param symmetric - if non-zero include symmetry in flow hash
221 autoreply define set_ip_flow_hash
236 /** \brief IPv6 router advertisement config request
237 @param client_index - opaque cookie to identify the sender
238 @param context - sender context, to match reply w/ request
243 @param send_unicast -
246 @param default_router -
247 @param max_interval -
248 @param min_interval -
250 @param initial_count -
251 @param initial_interval -
253 autoreply define sw_interface_ip6nd_ra_config
270 u32 initial_interval;
273 /** \brief IPv6 router advertisement prefix config request
274 @param client_index - opaque cookie to identify the sender
275 @param context - sender context, to match reply w/ request
276 @param sw_if_index - The interface the RA prefix information is for
277 @param prefix - The prefix to advertise
278 @param use_default - Revert to default settings
279 @param no_advertise - Do not advertise this prefix
280 @param off_link - The prefix is off link (it is not configured on the interface)
281 Configures the L-flag, When set, indicates that this
282 prefix can be used for on-link determination.
283 @param no_autoconfig - Setting for the A-flag. When
284 set indicates that this prefix can be used for
285 stateless address configuration.
286 @param no_onlink - The prefix is not on link. Make sure this is consistent
287 with the off_link parameter else YMMV
288 @param is_no - add/delete
289 @param val_lifetime - The length of time in
290 seconds (relative to the time the packet is sent)
291 that the prefix is valid for the purpose of on-link
292 determination. A value of all one bits
293 (0xffffffff) represents infinity
294 @param pref_lifetime - The length of time in
295 seconds (relative to the time the packet is sent)
296 that addresses generated from the prefix via
297 stateless address autoconfiguration remain
298 preferred [ADDRCONF]. A value of all one bits
299 (0xffffffff) represents infinity.
301 autoreply define sw_interface_ip6nd_ra_prefix
306 vl_api_prefix_t prefix;
317 /** \brief IPv6 ND proxy config
318 @param client_index - opaque cookie to identify the sender
319 @param context - sender context, to match reply w/ request
320 @param sw_if_index - The interface the host is on
321 @param address - The address of the host for which to proxy for
322 @param is_add - Adding or deleting
324 autoreply define ip6nd_proxy_add_del
330 vl_api_ip6_address_t ip;
333 /** \brief IPv6 ND proxy details returned after request
334 @param context - sender context, to match reply w/ request
335 @param retval - return code for the request
337 define ip6nd_proxy_details
341 vl_api_ip6_address_t ip;
344 /** \brief IPv6 ND proxy dump request
345 @param context - sender context, to match reply w/ request
346 @param retval - return code for the request
347 @param sw_if_index - The interface the host is on
348 @param address - The address of the host for which to proxy for
350 define ip6nd_proxy_dump
356 /** \brief Start / stop sending router solicitation
357 @param client_index - opaque cookie to identify the sender
358 @param context - sender context, to match reply w/ request
359 @param irt - initial retransmission time
360 @param mrt - maximum retransmission time
361 @param mrc - maximum retransmission count
362 @param mrd - maximum retransmission duration
363 @param sw_if_index - software interface index of interface
364 for sending router solicitation
365 @param stop - if non-zero then stop sending router solicitation,
366 otherwise start sending router solicitation
368 autoreply define ip6nd_send_router_solicitation
380 /** \brief IPv6 interface enable / disable request
381 @param client_index - opaque cookie to identify the sender
382 @param context - sender context, to match reply w/ request
383 @param sw_if_index - interface used to reach neighbor
384 @param enable - if non-zero enable ip6 on interface, else disable
386 autoreply define sw_interface_ip6_enable_disable
391 u8 enable; /* set to true if enable */
394 /** \brief IPv6 set link local address on interface request
395 @param client_index - opaque cookie to identify the sender
396 @param context - sender context, to match reply w/ request
397 @param sw_if_index - interface to set link local on
398 @param address[] - the new link local address
400 autoreply define sw_interface_ip6_set_link_local_address
408 /** \brief Dump IP multicast fib table
409 @param client_index - opaque cookie to identify the sender
411 define ip_mtable_dump
416 define ip_mtable_details
420 vl_api_ip_table_t table;
423 /** \brief Add / del route request
425 Adds a route, consisting both of the MFIB entry to match packets
426 (which may already exist) and a path to send those packets down.
427 Routes can be entered repeatedly to add multiple paths. Deletions are
430 @param client_index - opaque cookie to identify the sender
431 @param context - sender context, to match reply w/ request
432 @param table_id - fib table /vrf associated with the route
433 @param is_add - true if adding a route; false if deleting one
434 @param is_ipv6 - true iff all the addresses are v6
435 @param entry_flags - see fib_entry_flag_t
436 @param itf_flags - see mfib_entry_flags_t
437 @param next_hop_afi - see dpo_proto_t; the type of destination description
438 @param src_address - the source of the packet
439 @param grp_address - the group the packet is destined to
440 @param nh_address - the nexthop to forward the packet to
441 @param next_hop_sw_if_index - interface to emit packet on
443 BIER AFIs use the BIER imposition ID. v4 and v6 AFIs use either the
444 interface or the nexthop address.
446 Note that if the route is source-specific (S is supplied, not all 0s),
447 the prefix match is treated as exact (prefixlen /32 or /128).
449 FIXME not complete yet
456 vl_api_mprefix_t prefix;
458 vl_api_mfib_path_t paths[n_paths];
461 define ip_mroute_add_del
467 vl_api_ip_mroute_t route;
469 define ip_mroute_add_del_reply
476 /** \brief Dump IP multicast fib table
477 @param table - The table from which to dump routes (ony ID an AF are needed)
479 define ip_mroute_dump
483 vl_api_ip_table_t table;
486 /** \brief IP Multicast Route Details
487 @param route - Details of the route
489 manual_endian manual_print define ip_mroute_details
492 vl_api_ip_mroute_t route;
495 define ip_address_details
499 vl_api_address_with_prefix_t prefix;
502 define ip_address_dump
510 /** \brief IP unnumbered configurations
511 @param sw_if_index The interface that has unnumbered configuration
512 @param ip_sw_if_index The IP interface that it is unnnumbered to
514 define ip_unnumbered_details
521 /** \brief Dump IP unnumbered configurations
522 @param sw_if_index ~0 for all interfaces, else the interface desired
524 define ip_unnumbered_dump
545 define mfib_signal_dump
551 define mfib_signal_details
556 vl_api_mprefix_t prefix;
558 u8 ip_packet_data[256];
561 /** \brief IP punt policer
562 @param client_index - opaque cookie to identify the sender
563 @param context - sender context, to match reply w/ request
564 @param is_add - 1 to add neighbor, 0 to delete
565 @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
566 @param policer_index - Index of policer to use
568 autoreply define ip_punt_police
577 /** \brief Punt redirect type
578 @param rx_sw_if_index - specify the original RX interface of traffic
579 that should be redirected. ~0 means any interface.
580 @param tx_sw_if_index - the TX interface to which traffic shoulde be
582 @param nh - the next-hop to redirect the traffic to.
583 @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
585 typedef punt_redirect
592 /** \brief IP punt redirect
593 @param client_index - opaque cookie to identify the sender
594 @param context - sender context, to match reply w/ request
595 @param punt - punt definition
596 @param is_add - 1 to add neighbor, 0 to delete
598 autoreply define ip_punt_redirect
602 vl_api_punt_redirect_t punt;
606 define ip_punt_redirect_dump
614 define ip_punt_redirect_details
617 vl_api_punt_redirect_t punt;
620 autoreply define ip_container_proxy_add_del
629 define ip_container_proxy_dump
635 define ip_container_proxy_details
639 vl_api_prefix_t prefix;
642 /** \brief Configure IP source and L4 port-range check
643 @param client_index - opaque cookie to identify the sender
644 @param context - sender context, to match reply w/ request
645 @param is_ip6 - 1 if source address type is IPv6
646 @param is_add - 1 if add, 0 if delete
647 @param ip - prefix to match
648 @param number_of_ranges - length of low_port and high_port arrays (must match)
649 @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
650 @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
651 @param vrf_id - fib table/vrf id to associate the source and port-range check with
652 @note To specify a single port set low_port and high_port entry the same
654 autoreply define ip_source_and_port_range_check_add_del
659 vl_api_prefix_t prefix;
666 /** \brief Set interface source and L4 port-range request
667 @param client_index - opaque cookie to identify the sender
668 @param context - sender context, to match reply w/ request
669 @param interface_id - interface index
670 @param tcp_vrf_id - VRF associated with source and TCP port-range check
671 @param udp_vrf_id - VRF associated with source and TCP port-range check
673 autoreply define ip_source_and_port_range_check_interface_add_del
685 /** \brief Set interface source check request
686 @param client_index - opaque cookie to identify the sender
687 @param context - sender context, to match reply w/ request
688 @param is_add - add or del
689 @param loose - strict or loose
690 @param sw_if_index - interface index
692 autoreply define ip_source_check_interface_add_del
701 /** \brief Enable/disable periodic IP neighbor scan
702 @param client_index - opaque cookie to identify the sender
703 @param context - sender context, to match reply w/ request
704 @param mode - 0: disable, 1: IPv4, 2: IPv6, 3: both IPv4/v6
705 @param scan_interval - neighbor scan interval in minutes, 0: default to 1
706 @param max_proc_time - max processing time per run in usec, 0: default to 20
707 @param max_update - max neighbor probe/delete per run, 0: default to 10
708 @param scan_int_delay - delay in msec to resume scan if exceed max proc
709 time or update, 0: default to 1
710 @param stale_threshold - threshold in minutes for neighbor deletion,
711 0: default to 4*scan_interval
713 autoreply define ip_scan_neighbor_enable_disable
725 /** \brief IP probe neighbor address on an interface by sending an
726 ARP request (for IP4) or ICMP6 Neighbor Solicitation (for IP6)
727 @param client_index - opaque cookie to identify the sender
728 @param context - sender context, to match reply w/ request
729 @param sw_if_index - interface index
730 @param dst - target IP address to send IP addr resolution request
732 autoreply define ip_probe_neighbor
737 vl_api_address_t dst;
740 /** \brief Register for IP4 ARP resolution event on receing ARP reply or
741 MAC/IP info from ARP requests in L2 BDs
742 @param client_index - opaque cookie to identify the sender
743 @param context - sender context, to match reply w/ request
744 @param enable_disable - 1 => register for events, 0 => cancel registration
745 @param pid - sender's pid
746 @param ip - exact IP4 address of interested arp resolution event, or
747 0 to get MAC/IP info from ARP requests in BDs
749 autoreply define want_ip4_arp_events
755 vl_api_ip4_address_t ip;
758 /** \brief Tell client about an IP4 ARP resolution event or
759 MAC/IP info from ARP requests in L2 BDs
760 @param client_index - opaque cookie to identify the sender
761 @param ip - the exact ip4 address of interest
762 @param pid - client pid registered to receive notification
763 @param sw_if_index - interface which received ARP packet
764 @param mac - the new mac address
765 @param mac_ip - 0: ARP resolution event, 1: MAC/IP info from L2 BDs
770 vl_api_ip4_address_t ip;
773 vl_api_mac_address_t mac;
778 rpc want_ip4_arp_events returns want_ip4_arp_events_reply
779 events ip4_arp_event;
782 /** \brief Register for IP6 ND resolution event on recieving NA reply
783 MAC/IP info from ICMP6 Neighbor Solicitation in L2 BDs
784 @param client_index - opaque cookie to identify the sender
785 @param context - sender context, to match reply w/ request
786 @param enable_disable - 1 => register for events, 0 => cancel registration
787 @param pid - sender's pid
788 @param ip - the exact IP6 address of interested ND resolution event, or
789 0 to get MAC/IP info from ICMP6 NS in L2 BDs.
791 autoreply define want_ip6_nd_events
797 vl_api_ip6_address_t ip;
800 /** \brief Tell client about an IP6 ND resolution or
801 MAC/IP info from ICMP6 Neighbor Solicitation in L2 BDs.
802 @param client_index - opaque cookie to identify the sender
803 @param pid - client pid registered to receive notification
804 @param sw_if_index - interface which received ARP packet
805 @param ip - the exact ip6 address of interest
806 @param new_mac - the new mac address
807 @param mac_ip - 0: ND resolution event, 1: MAC/IP info from L2 BDs
814 vl_api_ip6_address_t ip;
815 vl_api_mac_address_t mac;
820 rpc want_ip6_ra_events returns want_ip6_ra_events_reply
824 /** \brief Register for ip6 router advertisement events
825 @param client_index - opaque cookie to identify the sender
826 @param context - sender context, to match reply w/ request
827 @param enable_disable - 1 => register for events, 0 => cancel registration
828 @param pid - sender's pid
830 autoreply define want_ip6_ra_events
838 /** \brief Struct representing RA prefix info
839 @param prefix - RA prefix info destination address
840 @param flags - RA prefix info flags
841 @param valid_time - RA prefix info valid time
842 @param preferred_time - RA prefix info preferred time
844 typedef ip6_ra_prefix_info
846 vl_api_prefix_t prefix;
852 /** \brief Tell client about a router advertisement event
853 @param client_index - opaque cookie to identify the sender
854 @param pid - client pid registered to receive notification
855 @param current_hop_limit - RA current hop limit
856 @param flags - RA flags
857 @param router_lifetime_in_sec - RA lifetime in seconds
858 @param router_addr - The router's address
859 @param neighbor_reachable_time_in_msec - RA neighbor reachable time in msec
860 @param time_in_msec_between_retransmitted_neighbor_solicitations -
861 time in msec between retransmitted neighbor solicitations
870 vl_api_ip6_address_t router_addr;
871 u8 current_hop_limit;
873 u16 router_lifetime_in_sec;
874 u32 neighbor_reachable_time_in_msec;
875 u32 time_in_msec_between_retransmitted_neighbor_solicitations;
877 vl_api_ip6_ra_prefix_info_t prefixes[n_prefixes];
881 rpc want_ip6_nd_events returns want_ip6_nd_events_reply
885 /** \brief Proxy ARP configuration type
886 @param table_id - VRF / Fib table ID
887 @param low - Low address of the Proxy ARP range
888 @param hi - High address of the Proxy ARP range
893 vl_api_ip4_address_t low;
894 vl_api_ip4_address_t hi;
897 /** \brief Proxy ARP add / del request
898 @param client_index - opaque cookie to identify the sender
899 @param context - sender context, to match reply w/ request
900 @param is_add - 1 if adding the Proxy ARP range, 0 if deleting
901 @param proxy - Proxy configuration
903 autoreply define proxy_arp_add_del
908 vl_api_proxy_arp_t proxy;
911 /** \brief Proxy ARP dump request
913 define proxy_arp_dump
919 /** \brief Proxy ARP dump details reply
920 * @param proxy - Same data as used to configure
922 define proxy_arp_details
925 vl_api_proxy_arp_t proxy;
928 /** \brief Proxy ARP add / del interface request
929 @param client_index - opaque cookie to identify the sender
930 @param context - sender context, to match reply w/ request
931 @param sw_if_index - Which interface to enable / disable Proxy Arp on
932 @param enable_disable - 1 to enable Proxy ARP on interface, 0 to disable
934 autoreply define proxy_arp_intfc_enable_disable
939 /* 1 = on, 0 = off */
943 /** \brief Proxy ARP interface dump request
945 define proxy_arp_intfc_dump
951 /** \brief Proxy ARP interface dump details reply
952 * @param sw_if_index The interface on which ARP proxy is enabled.
954 define proxy_arp_intfc_details
960 /** \brief Reset fib table request
961 @param client_index - opaque cookie to identify the sender
962 @param context - sender context, to match reply w/ request
963 @param vrf_id - vrf/table id of the fib table to reset
964 @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
966 autoreply define reset_fib
974 /** \brief Set max allowed ARP or ip6 neighbor entries request
975 @param client_index - opaque cookie to identify the sender
976 @param context - sender context, to match reply w/ request
977 @param is_ipv6 - neighbor limit if non-zero, else ARP limit
978 @param arp_neighbor_limit - the new limit, defaults are ~ 50k
980 autoreply define set_arp_neighbor_limit
985 u32 arp_neighbor_limit;
988 /** \brief IOAM enable : Enable in-band OAM
989 @param id - profile id
990 @param seqno - To enable Seqno Processing
991 @param analyse - Enabling analysis of iOAM at decap node
992 @param pow_enable - Proof of Work enabled or not flag
993 @param trace_enable - iOAM Trace enabled or not flag
995 autoreply define ioam_enable
1007 /** \brief iOAM disable
1008 @param client_index - opaque cookie to identify the sender
1009 @param context - sender context, to match reply w/ request
1010 @param index - MAP Domain index
1012 autoreply define ioam_disable
1021 IP_REASS_TYPE_FULL = 0,
1022 IP_REASS_TYPE_SHALLOW_VIRTUAL = 0x1,
1025 autoreply define ip_reassembly_set
1030 u32 max_reassemblies;
1031 u32 max_reassembly_length;
1032 u32 expire_walk_interval_ms;
1034 vl_api_ip_reass_type_t type;
1037 define ip_reassembly_get
1042 vl_api_ip_reass_type_t type;
1045 define ip_reassembly_get_reply
1050 u32 max_reassemblies;
1051 u32 max_reassembly_length;
1052 u32 expire_walk_interval_ms;
1056 /** \brief Enable/disable reassembly feature
1057 @param client_index - opaque cookie to identify the sender
1058 @param context - sender context, to match reply w/ request
1059 @param sw_if_index - interface to enable/disable feature on
1060 @param enable_ip4 - enable ip4 reassembly if non-zero, disable if 0
1061 @param enable_ip6 - enable ip6 reassembly if non-zero, disable if 0
1063 autoreply define ip_reassembly_enable_disable
1070 vl_api_ip_reass_type_t type;
1075 * eval: (c-set-style "gnu")