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 = "2.0.0";
24 import "vnet/ip/ip_types.api";
25 import "vnet/fib/fib_types.api";
26 import "vnet/ethernet/ethernet_types.api";
28 /** \brief Add / del table request
29 A table can be added multiple times, but need be deleted only once.
30 @param client_index - opaque cookie to identify the sender
31 @param context - sender context, to match reply w/ request
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
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
40 autoreply define ip_table_add_del
50 /** \brief Dump IP fib table
51 @param client_index - opaque cookie to identify the sender
59 /** \brief IP FIB table response
60 @param table_id - IP fib table id
61 @address_length - mask length
63 @param count - the number of fib_path in path
64 @param path - array of of fib_path structures
66 manual_endian manual_print define ip_fib_details
75 vl_api_fib_path_t path[count];
78 /** \brief Dump IP6 fib table
79 @param client_index - opaque cookie to identify the sender
87 /** \brief IP6 FIB table entry response
88 @param table_id - IP6 fib table id
89 @param address_length - mask length
90 @param address - ip6 prefix
91 @param count - the number of fib_path in path
92 @param path - array of of fib_path structures
94 manual_endian manual_print define ip6_fib_details
103 vl_api_fib_path_t path[count];
106 /** \brief IP neighbor flags
107 @param is_static - A static neighbor Entry - there are not flushed
108 If the interface goes down.
109 @param is_no_fib_entry - Do not create a corresponding entry in the FIB
110 table for the neighbor.
112 enum ip_neighbor_flags
114 IP_API_NEIGHBOR_FLAG_NONE = 0,
115 IP_API_NEIGHBOR_FLAG_STATIC = 0x1,
116 IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY = 0x2,
119 /** \brief IP neighbor
120 @param sw_if_index - interface used to reach neighbor
121 @param mac_address - l2 address of the neighbor
122 @param ip_address - ip4 or ip6 address of the neighbor
123 @param flags - flags for the nieghbor
125 typedef ip_neighbor {
127 vl_api_ip_neighbor_flags_t flags;
128 vl_api_mac_address_t mac_address;
129 vl_api_address_t ip_address;
132 /** \brief IP neighbor add / del request
133 @param client_index - opaque cookie to identify the sender
134 @param context - sender context, to match reply w/ request
135 @param is_add - 1 to add neighbor, 0 to delete
136 @param neighbor - the neighor to add/remove
138 define ip_neighbor_add_del
142 /* 1 = add, 0 = delete */
144 vl_api_ip_neighbor_t neighbor;
146 define ip_neighbor_add_del_reply
153 /** \brief Dump IP neighboors
154 @param client_index - opaque cookie to identify the sender
155 @param context - sender context, to match reply w/ request
156 @param sw_if_index - the interface to dump neighboors, ~0 == all
157 @param is_ipv6 - [1|0] to indicate if address family is ipv[6|4]
159 define ip_neighbor_dump
167 /** \brief IP neighboors dump response
168 @param context - sender context which was passed in the request
169 @param neighbour - the neighbor
171 define ip_neighbor_details {
173 vl_api_ip_neighbor_t neighbor;
176 /** \brief Set the ip flow hash config for a fib request
177 @param client_index - opaque cookie to identify the sender
178 @param context - sender context, to match reply w/ request
179 @param vrf_id - vrf/fib id
180 @param is_ipv6 - if non-zero the fib is ip6, else ip4
181 @param src - if non-zero include src in flow hash
182 @param dst - if non-zero include dst in flow hash
183 @param sport - if non-zero include sport in flow hash
184 @param dport - if non-zero include dport in flow hash
185 @param proto -if non-zero include proto in flow hash
186 @param reverse - if non-zero include reverse in flow hash
187 @param symmetric - if non-zero include symmetry in flow hash
189 autoreply define set_ip_flow_hash
204 /** \brief IPv6 router advertisement config request
205 @param client_index - opaque cookie to identify the sender
206 @param context - sender context, to match reply w/ request
211 @param send_unicast -
214 @param default_router -
215 @param max_interval -
216 @param min_interval -
218 @param initial_count -
219 @param initial_interval -
221 autoreply define sw_interface_ip6nd_ra_config
238 u32 initial_interval;
241 /** \brief IPv6 router advertisement prefix config request
242 @param client_index - opaque cookie to identify the sender
243 @param context - sender context, to match reply w/ request
244 @param sw_if_index - The interface the RA prefix information is for
245 @param prefix - The prefix to advertise
246 @param use_default - Revert to default settings
247 @param no_advertise - Do not advertise this prefix
248 @param off_link - The prefix is off link (it is not configured on the interface)
249 Configures the L-flag, When set, indicates that this
250 prefix can be used for on-link determination.
251 @param no_autoconfig - Setting for the A-flag. When
252 set indicates that this prefix can be used for
253 stateless address configuration.
254 @param no_onlink - The prefix is not on link. Make sure this is consistent
255 with the off_link parameter else YMMV
256 @param is_no - add/delete
257 @param val_lifetime - The length of time in
258 seconds (relative to the time the packet is sent)
259 that the prefix is valid for the purpose of on-link
260 determination. A value of all one bits
261 (0xffffffff) represents infinity
262 @param pref_lifetime - The length of time in
263 seconds (relative to the time the packet is sent)
264 that addresses generated from the prefix via
265 stateless address autoconfiguration remain
266 preferred [ADDRCONF]. A value of all one bits
267 (0xffffffff) represents infinity.
269 autoreply define sw_interface_ip6nd_ra_prefix
274 vl_api_prefix_t prefix;
285 /** \brief IPv6 ND proxy config
286 @param client_index - opaque cookie to identify the sender
287 @param context - sender context, to match reply w/ request
288 @param sw_if_index - The interface the host is on
289 @param address - The address of the host for which to proxy for
290 @param is_add - Adding or deleting
292 autoreply define ip6nd_proxy_add_del
298 vl_api_ip6_address_t ip;
301 /** \brief IPv6 ND proxy details returned after request
302 @param context - sender context, to match reply w/ request
303 @param retval - return code for the request
305 define ip6nd_proxy_details
309 vl_api_ip6_address_t ip;
312 /** \brief IPv6 ND proxy dump request
313 @param context - sender context, to match reply w/ request
314 @param retval - return code for the request
315 @param sw_if_index - The interface the host is on
316 @param address - The address of the host for which to proxy for
318 define ip6nd_proxy_dump
324 /** \brief Start / stop sending router solicitation
325 @param client_index - opaque cookie to identify the sender
326 @param context - sender context, to match reply w/ request
327 @param irt - initial retransmission time
328 @param mrt - maximum retransmission time
329 @param mrc - maximum retransmission count
330 @param mrd - maximum retransmission duration
331 @param sw_if_index - software interface index of interface
332 for sending router solicitation
333 @param stop - if non-zero then stop sending router solicitation,
334 otherwise start sending router solicitation
336 autoreply define ip6nd_send_router_solicitation
348 /** \brief IPv6 interface enable / disable request
349 @param client_index - opaque cookie to identify the sender
350 @param context - sender context, to match reply w/ request
351 @param sw_if_index - interface used to reach neighbor
352 @param enable - if non-zero enable ip6 on interface, else disable
354 autoreply define sw_interface_ip6_enable_disable
359 u8 enable; /* set to true if enable */
362 /** \brief Add / del route request
363 @param client_index - opaque cookie to identify the sender
364 @param context - sender context, to match reply w/ request
365 @param sw_if_index - software index of the new vlan's parent interface
366 @param vrf_id - fib table /vrf associated with the route
367 @param lookup_in_vrf -
368 @param classify_table_index -
369 @param is_add - 1 if adding the route, 0 if deleting
370 @param is_drop - Drop the packet
371 @param is_unreach - Drop the packet and rate limit send ICMP unreachable
372 @param is_prohibit - Drop the packet and rate limit send ICMP prohibited
373 @param is_ipv6 - 0 if an ip4 route, else ip6
374 @param is_local - The route will result in packets sent to VPP IP stack
375 @param is_udp_encap - The path describes a UDP-o-IP encapsulation.
377 @param is_multipath - Set to 1 if this is a multipath route, else 0
378 @param is_dvr - Does the route resolve via a DVR interface.
379 @param is_source_lookup - The the path is a deaggregate path (i.e. a lookup
380 in another table) is the lookup on the packet's
381 source address or destination.
382 @param next_hop_weight - Weight for Unequal cost multi-path
383 @param next_hop_preference - Path that are up that have the best preference are
384 are used for forwarding. lower value is better.
385 @param next_hop_id - Used when the path resolves via an object that has a unique
387 @param dst_address_length -
388 @param dst_address[16] -
389 @param next_hop_address[16] -
390 @param next_hop_n_out_labels - the number of labels in the label stack
391 @param next_hop_out_label_stack - the next-hop output label stack, outer most first
392 @param next_hop_via_label - The next-hop is a resolved via a local label
394 define ip_add_del_route
398 u32 next_hop_sw_if_index;
400 u32 classify_table_index;
401 u32 next_hop_table_id;
412 u8 is_resolve_attached;
417 u8 next_hop_preference;
419 u8 dst_address_length;
421 u8 next_hop_address[16];
422 u8 next_hop_n_out_labels;
423 u32 next_hop_via_label;
424 vl_api_fib_mpls_label_t next_hop_out_label_stack[next_hop_n_out_labels];
427 define ip_add_del_route_reply
434 /** \brief Add / del route request
436 Adds a route, consisting both of the MFIB entry to match packets
437 (which may already exist) and a path to send those packets down.
438 Routes can be entered repeatedly to add multiple paths. Deletions are
441 @param client_index - opaque cookie to identify the sender
442 @param context - sender context, to match reply w/ request
443 @param table_id - fib table /vrf associated with the route
444 @param is_add - true if adding a route; false if deleting one
445 @param is_ipv6 - true iff all the addresses are v6
446 @param entry_flags - see fib_entry_flag_t
447 @param itf_flags - see mfib_entry_flags_t
448 @param next_hop_afi - see dpo_proto_t; the type of destination description
449 @param src_address - the source of the packet
450 @param grp_address - the group the packet is destined to
451 @param nh_address - the nexthop to forward the packet to
452 @param next_hop_sw_if_index - interface to emit packet on
454 BIER AFIs use the BIER imposition ID. v4 and v6 AFIs use either the
455 interface or the nexthop address.
457 Note that if the route is source-specific (S is supplied, not all 0s),
458 the prefix match is treated as exact (prefixlen /32 or /128).
460 FIXME not complete yet
462 define ip_mroute_add_del
466 u32 next_hop_sw_if_index;
472 u16 grp_address_length;
482 define ip_mroute_add_del_reply
489 /** \brief Dump IP multicast fib table
490 @param client_index - opaque cookie to identify the sender
498 /** \brief IP Multicast FIB table response
499 @param table_id - IP fib table id
500 @address_length - mask length
501 @grp_address - Group address/prefix
502 @src_address - Source address
503 @param count - the number of fib_path in path
504 @param path - array of of fib_path structures
508 vl_api_fib_path_t path;
512 manual_endian manual_print define ip_mfib_details
523 vl_api_mfib_path_t path[count];
526 /** \brief Dump IP6 multicast fib table
527 @param client_index - opaque cookie to identify the sender
535 /** \brief IP6 Multicast FIB table response
536 @param table_id - IP fib table id
537 @address_length - mask length
538 @grp_address - Group address/prefix
539 @src_address - Source address
540 @param count - the number of fib_path in path
541 @param path - array of of fib_path structures
543 manual_endian manual_print define ip6_mfib_details
551 vl_api_mfib_path_t path[count];
554 define ip_address_details
563 define ip_address_dump
571 /** \brief IP unnumbered configurations
572 @param sw_if_index The interface that has unnumbered configuration
573 @param ip_sw_if_index The IP interface that it is unnnumbered to
575 define ip_unnumbered_details
582 /** \brief Dump IP unnumbered configurations
583 @param sw_if_index ~0 for all interfaces, else the interface desired
585 define ip_unnumbered_dump
606 define mfib_signal_dump
612 define mfib_signal_details
621 u8 ip_packet_data[256];
624 /** \brief IP punt policer
625 @param client_index - opaque cookie to identify the sender
626 @param context - sender context, to match reply w/ request
627 @param is_add - 1 to add neighbor, 0 to delete
628 @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
629 @param policer_index - Index of policer to use
631 autoreply define ip_punt_police
640 /** \brief Punt redirect type
641 @param rx_sw_if_index - specify the original RX interface of traffic
642 that should be redirected. ~0 means any interface.
643 @param tx_sw_if_index - the TX interface to which traffic shoulde be
645 @param nh - the next-hop to redirect the traffic to.
646 @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
648 typeonly define punt_redirect
655 /** \brief IP punt redirect
656 @param client_index - opaque cookie to identify the sender
657 @param context - sender context, to match reply w/ request
658 @param punt - punt definition
659 @param is_add - 1 to add neighbor, 0 to delete
661 autoreply define ip_punt_redirect
665 vl_api_punt_redirect_t punt;
669 define ip_punt_redirect_dump
677 define ip_punt_redirect_details
680 vl_api_punt_redirect_t punt;
683 autoreply define ip_container_proxy_add_del
692 define ip_container_proxy_dump
698 define ip_container_proxy_details
702 vl_api_prefix_t prefix;
705 /** \brief Configure IP source and L4 port-range check
706 @param client_index - opaque cookie to identify the sender
707 @param context - sender context, to match reply w/ request
708 @param is_ip6 - 1 if source address type is IPv6
709 @param is_add - 1 if add, 0 if delete
710 @param ip - prefix to match
711 @param number_of_ranges - length of low_port and high_port arrays (must match)
712 @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
713 @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
714 @param vrf_id - fib table/vrf id to associate the source and port-range check with
715 @note To specify a single port set low_port and high_port entry the same
717 autoreply define ip_source_and_port_range_check_add_del
722 vl_api_prefix_t prefix;
729 /** \brief Set interface source and L4 port-range request
730 @param client_index - opaque cookie to identify the sender
731 @param context - sender context, to match reply w/ request
732 @param interface_id - interface index
733 @param tcp_vrf_id - VRF associated with source and TCP port-range check
734 @param udp_vrf_id - VRF associated with source and TCP port-range check
736 autoreply define ip_source_and_port_range_check_interface_add_del
748 /** \brief Set interface source check request
749 @param client_index - opaque cookie to identify the sender
750 @param context - sender context, to match reply w/ request
751 @param is_add - add or del
752 @param loose - strict or loose
753 @param sw_if_index - interface index
755 autoreply define ip_source_check_interface_add_del
764 /** \brief Enable/disable periodic IP neighbor scan
765 @param client_index - opaque cookie to identify the sender
766 @param context - sender context, to match reply w/ request
767 @param mode - 0: disable, 1: IPv4, 2: IPv6, 3: both IPv4/v6
768 @param scan_interval - neighbor scan interval in minutes, 0: default to 1
769 @param max_proc_time - max processing time per run in usec, 0: default to 20
770 @param max_update - max neighbor probe/delete per run, 0: default to 10
771 @param scan_int_delay - delay in msec to resume scan if exceed max proc
772 time or update, 0: default to 1
773 @param stale_threshold - threshold in minutes for neighbor deletion,
774 0: default to 4*scan_interval
776 autoreply define ip_scan_neighbor_enable_disable
788 /** \brief IP probe neighbor address on an interface by sending an
789 ARP request (for IP4) or ICMP6 Neighbor Solicitation (for IP6)
790 @param client_index - opaque cookie to identify the sender
791 @param context - sender context, to match reply w/ request
792 @param sw_if_index - interface index
793 @param dst - target IP address to send IP addr resolution request
795 autoreply define ip_probe_neighbor
800 vl_api_address_t dst;
803 /** \brief Register for IP4 ARP resolution event on receing ARP reply or
804 MAC/IP info from ARP requests in L2 BDs
805 @param client_index - opaque cookie to identify the sender
806 @param context - sender context, to match reply w/ request
807 @param enable_disable - 1 => register for events, 0 => cancel registration
808 @param pid - sender's pid
809 @param ip - exact IP4 address of interested arp resolution event, or
810 0 to get MAC/IP info from ARP requests in BDs
812 autoreply define want_ip4_arp_events
818 vl_api_ip4_address_t ip;
821 /** \brief Tell client about an IP4 ARP resolution event or
822 MAC/IP info from ARP requests in L2 BDs
823 @param client_index - opaque cookie to identify the sender
824 @param ip - the exact ip4 address of interest
825 @param pid - client pid registered to receive notification
826 @param sw_if_index - interface which received ARP packet
827 @param mac - the new mac address
828 @param mac_ip - 0: ARP resolution event, 1: MAC/IP info from L2 BDs
833 vl_api_ip4_address_t ip;
836 vl_api_mac_address_t mac;
841 rpc want_ip4_arp_events returns want_ip4_arp_events_reply
842 events ip4_arp_event;
845 /** \brief Register for IP6 ND resolution event on recieving NA reply
846 MAC/IP info from ICMP6 Neighbor Solicitation in L2 BDs
847 @param client_index - opaque cookie to identify the sender
848 @param context - sender context, to match reply w/ request
849 @param enable_disable - 1 => register for events, 0 => cancel registration
850 @param pid - sender's pid
851 @param ip - the exact IP6 address of interested ND resolution event, or
852 0 to get MAC/IP info from ICMP6 NS in L2 BDs.
854 autoreply define want_ip6_nd_events
860 vl_api_ip6_address_t ip;
863 /** \brief Tell client about an IP6 ND resolution or
864 MAC/IP info from ICMP6 Neighbor Solicitation in L2 BDs.
865 @param client_index - opaque cookie to identify the sender
866 @param pid - client pid registered to receive notification
867 @param sw_if_index - interface which received ARP packet
868 @param ip - the exact ip6 address of interest
869 @param new_mac - the new mac address
870 @param mac_ip - 0: ND resolution event, 1: MAC/IP info from L2 BDs
877 vl_api_ip6_address_t ip;
878 vl_api_mac_address_t mac;
883 rpc want_ip6_ra_events returns want_ip6_ra_events_reply
887 /** \brief Register for ip6 router advertisement events
888 @param client_index - opaque cookie to identify the sender
889 @param context - sender context, to match reply w/ request
890 @param enable_disable - 1 => register for events, 0 => cancel registration
891 @param pid - sender's pid
893 autoreply define want_ip6_ra_events
901 /** \brief Struct representing RA prefix info
902 @param prefix - RA prefix info destination address
903 @param flags - RA prefix info flags
904 @param valid_time - RA prefix info valid time
905 @param preferred_time - RA prefix info preferred time
907 typeonly define ip6_ra_prefix_info
909 vl_api_prefix_t prefix;
915 /** \brief Tell client about a router advertisement event
916 @param client_index - opaque cookie to identify the sender
917 @param pid - client pid registered to receive notification
918 @param current_hop_limit - RA current hop limit
919 @param flags - RA flags
920 @param router_lifetime_in_sec - RA lifetime in seconds
921 @param router_addr - The router's address
922 @param neighbor_reachable_time_in_msec - RA neighbor reachable time in msec
923 @param time_in_msec_between_retransmitted_neighbor_solicitations -
924 time in msec between retransmitted neighbor solicitations
933 vl_api_ip6_address_t router_addr;
934 u8 current_hop_limit;
936 u16 router_lifetime_in_sec;
937 u32 neighbor_reachable_time_in_msec;
938 u32 time_in_msec_between_retransmitted_neighbor_solicitations;
940 vl_api_ip6_ra_prefix_info_t prefixes[n_prefixes];
944 rpc want_ip6_nd_events returns want_ip6_nd_events_reply
948 /** \brief Proxy ARP configuration type
949 @param table_id - VRF / Fib table ID
950 @param low - Low address of the Proxy ARP range
951 @param hi - High address of the Proxy ARP range
953 typeonly define proxy_arp
956 vl_api_ip4_address_t low;
957 vl_api_ip4_address_t hi;
960 /** \brief Proxy ARP add / del request
961 @param client_index - opaque cookie to identify the sender
962 @param context - sender context, to match reply w/ request
963 @param is_add - 1 if adding the Proxy ARP range, 0 if deleting
964 @param proxy - Proxy configuration
966 autoreply define proxy_arp_add_del
971 vl_api_proxy_arp_t proxy;
974 /** \brief Proxy ARP dump request
976 define proxy_arp_dump
982 /** \brief Proxy ARP dump details reply
983 * @param proxy - Same data as used to configure
985 define proxy_arp_details
988 vl_api_proxy_arp_t proxy;
991 /** \brief Proxy ARP add / del interface request
992 @param client_index - opaque cookie to identify the sender
993 @param context - sender context, to match reply w/ request
994 @param sw_if_index - Which interface to enable / disable Proxy Arp on
995 @param enable_disable - 1 to enable Proxy ARP on interface, 0 to disable
997 autoreply define proxy_arp_intfc_enable_disable
1002 /* 1 = on, 0 = off */
1006 /** \brief Proxy ARP interface dump request
1008 define proxy_arp_intfc_dump
1014 /** \brief Proxy ARP interface dump details reply
1015 * @param sw_if_index The interface on which ARP proxy is enabled.
1017 define proxy_arp_intfc_details
1023 /** \brief Reset fib table request
1024 @param client_index - opaque cookie to identify the sender
1025 @param context - sender context, to match reply w/ request
1026 @param vrf_id - vrf/table id of the fib table to reset
1027 @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
1029 autoreply define reset_fib
1037 /** \brief Set max allowed ARP or ip6 neighbor entries request
1038 @param client_index - opaque cookie to identify the sender
1039 @param context - sender context, to match reply w/ request
1040 @param is_ipv6 - neighbor limit if non-zero, else ARP limit
1041 @param arp_neighbor_limit - the new limit, defaults are ~ 50k
1043 autoreply define set_arp_neighbor_limit
1048 u32 arp_neighbor_limit;
1051 /** \brief IOAM enable : Enable in-band OAM
1052 @param id - profile id
1053 @param seqno - To enable Seqno Processing
1054 @param analyse - Enabling analysis of iOAM at decap node
1055 @param pow_enable - Proof of Work enabled or not flag
1056 @param trace_enable - iOAM Trace enabled or not flag
1058 autoreply define ioam_enable
1070 /** \brief iOAM disable
1071 @param client_index - opaque cookie to identify the sender
1072 @param context - sender context, to match reply w/ request
1073 @param index - MAP Domain index
1075 autoreply define ioam_disable
1082 autoreply define ip_reassembly_set
1087 u32 max_reassemblies;
1088 u32 expire_walk_interval_ms;
1092 define ip_reassembly_get
1099 define ip_reassembly_get_reply
1104 u32 max_reassemblies;
1105 u32 expire_walk_interval_ms;
1109 /** \brief Enable/disable reassembly feature
1110 @param client_index - opaque cookie to identify the sender
1111 @param context - sender context, to match reply w/ request
1112 @param sw_if_index - interface to enable/disable feature on
1113 @param enable_ip4 - enable ip4 reassembly if non-zero, disable if 0
1114 @param enable_ip6 - enable ip6 reassembly if non-zero, disable if 0
1116 autoreply define ip_reassembly_enable_disable
1127 * eval: (c-set-style "gnu")