2 * Copyright (c) 2015-2016 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
18 This file defines vpe control-plane API messages which are generally
19 called through a shared memory interface.
23 * Note: API placement cleanup in progress
24 * If you're looking for interface APIs, please
25 * see .../src/vnet/{interface.api,interface_api.c}
26 * IP APIs: see .../src/vnet/ip/{ip.api, ip_api.c}
27 * TAP APIs: see .../src/vnet/unix/{tap.api, tap_api.c}
28 * VXLAN APIs: see .../src/vnet/vxlan/{vxlan.api, vxlan_api.c}
29 * LLDP APIs: see .../src/vnet/lldp/{lldp.api, lldp_api.c}
30 * AF-PACKET APIs: see ... /vnet/devices/af_packet/{af_packet.api, af_packet_api.c}
31 * NETMAP APIs: see ... /src/vnet/devices/netmap/{netmap.api, netmap_api.c}
32 * VHOST-USER APIs: see .../vnet/devices/virtio/{vhost_user.api, vhost_user_api.c}
33 * VXLAN GPE APIs: see .../src/vnet/vxlan-gpe/{vxlan_gpe.api, vxlan_gpe_api.c}
34 * GRE APIs: see .../src/vnet/gre/{gre.api, gre_api.c}
35 * L2 APIs: see .../src/vnet/l2/{l2.api, l2_api.c}
36 * L2TP APIs: see .../src/vnet/l2tp/{l2tp.api, l2tp_api.c}
37 * BFD APIs: see .../src/vnet/bfd/{bfd.api, bfd_api.c}
38 * IPSEC APIs: see .../src/vnet/ipsec/{ipsec.api, ipsec_api.c}
39 * IPSEC-GRE APIs: see .../src/vnet/ipsec-gre/{ipsec_gre.api, ipsec_gre_api.c}
40 * LISP APIs: see .../src/vnet/lisp/{lisp.api, lisp_api.c}
41 * LISP-GPE APIs: see .../src/vnet/lisp-gpe/{lisp_gpe.api, lisp_gpe_api.c}
42 * SESSION APIs: .../vnet/session/{session.api session_api.c}
43 * MPLS APIs: see .../src/vnet/mpls/{mpls.api, mpls_api.c}
44 * SR APIs: see .../src/vnet/srv6/{sr.api, sr_api.c}
45 * CLASSIFY APIs: see ... /src/vnet/classify/{classify.api, classify_api.c}
46 * FLOW APIs: see ... /src/vnet/flow/{flow.api, flow_api.c}
47 * DHCP APIs: see ... /src/vnet/dhcp/{dhcpk.api, dhcp_api.c}
48 * COP APIs: see ... /src/vnet/cop/{cop.api, cop_api.c}
49 * POLICER APIs: see ... /src/vnet/policer/{policer.api, policer_api.c}
52 /** \brief Create a new subinterface with the given vlan id
53 @param client_index - opaque cookie to identify the sender
54 @param context - sender context, to match reply w/ request
55 @param sw_if_index - software index of the new vlan's parent interface
56 @param vlan_id - vlan tag of the new interface
58 define create_vlan_subif
66 /** \brief Reply for the vlan subinterface create request
67 @param context - returned sender context, to match reply w/ request
68 @param retval - return code
69 @param sw_if_index - software index allocated for the new subinterface
71 define create_vlan_subif_reply
78 /** \brief Enable or Disable MPLS on and interface
79 @param client_index - opaque cookie to identify the sender
80 @param context - sender context, to match reply w/ request
81 @param sw_if_index - index of the interface
82 @param enable - if non-zero enable, else disable
84 autoreply define sw_interface_set_mpls_enable
92 /** \brief Proxy ARP add / del request
93 @param client_index - opaque cookie to identify the sender
94 @param context - sender context, to match reply w/ request
95 @param vrf_id - VRF / Fib table ID
96 @param is_add - 1 if adding the Proxy ARP range, 0 if deleting
97 @param low_address[4] - Low address of the Proxy ARP range
98 @param hi_address[4] - High address of the Proxy ARP range
100 autoreply define proxy_arp_add_del
110 /** \brief Proxy ARP add / del request
111 @param client_index - opaque cookie to identify the sender
112 @param context - sender context, to match reply w/ request
113 @param sw_if_index - Which interface to enable / disable Proxy Arp on
114 @param enable_disable - 1 to enable Proxy ARP on interface, 0 to disable
116 autoreply define proxy_arp_intfc_enable_disable
121 /* 1 = on, 0 = off */
125 /** \brief Reset VRF (remove all routes etc) request
126 @param client_index - opaque cookie to identify the sender
127 @param context - sender context, to match reply w/ request
128 @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
129 @param vrf_id - ID of th FIB table / VRF to reset
131 autoreply define reset_vrf
139 /** \brief Want Stats, register for stats updates
140 @param client_index - opaque cookie to identify the sender
141 @param context - sender context, to match reply w/ request
142 @param enable_disable - 1 = enable stats, 0 = disable
143 @param pid - pid of process requesting stats updates
145 autoreply define want_stats
153 typeonly manual_print manual_endian define ip4_fib_counter
161 manual_print manual_endian define vnet_ip4_fib_counters
165 vl_api_ip4_fib_counter_t c[count];
168 typeonly manual_print manual_endian define ip4_nbr_counter
177 * @brief Per-neighbour (i.e. per-adjacency) coutners
178 * @param count The size of the array of counters
179 * @param sw_if_index The interface the adjacency is on
180 * @param begin Flag to indicate this is the first set of stats for this
181 * interface. If this flag is not set the it is a continuation of
182 * stats for this interface
185 manual_print manual_endian define vnet_ip4_nbr_counters
190 vl_api_ip4_nbr_counter_t c[count];
193 typeonly manual_print manual_endian define ip6_fib_counter
201 manual_print manual_endian define vnet_ip6_fib_counters
205 vl_api_ip6_fib_counter_t c[count];
208 typeonly manual_print manual_endian define ip6_nbr_counter
216 manual_print manual_endian define vnet_ip6_nbr_counters
221 vl_api_ip6_nbr_counter_t c[count];
224 /** \brief Request for a single block of summary stats
225 @param client_index - opaque cookie to identify the sender
226 @param context - sender context, to match reply w/ request
228 define vnet_get_summary_stats
234 /** \brief Reply for vnet_get_summary_stats request
235 @param context - sender context, to match reply w/ request
236 @param retval - return code for request
241 define vnet_get_summary_stats_reply
250 /** \brief OAM event structure
251 @param dst_address[] -
260 /** \brief Want OAM events request
261 @param client_index - opaque cookie to identify the sender
262 @param context - sender context, to match reply w/ request
263 @param enable_disable- enable if non-zero, else disable
264 @param pid - pid of the requesting process
266 autoreply define want_oam_events
274 /** \brief OAM add / del target request
275 @param client_index - opaque cookie to identify the sender
276 @param context - sender context, to match reply w/ request
277 @param vrf_id - vrf_id of the target
278 @param src_address[] - source address to use for the updates
279 @param dst_address[] - destination address of the target
280 @param is_add - add target if non-zero, else delete
282 autoreply define oam_add_del
292 /** \brief Reset fib table request
293 @param client_index - opaque cookie to identify the sender
294 @param context - sender context, to match reply w/ request
295 @param vrf_id - vrf/table id of the fib table to reset
296 @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
298 autoreply define reset_fib
306 /** \brief Create loopback interface request
307 @param client_index - opaque cookie to identify the sender
308 @param context - sender context, to match reply w/ request
309 @param mac_address - mac addr to assign to the interface if none-zero
311 define create_loopback
318 /** \brief Create loopback interface response
319 @param context - sender context, to match reply w/ request
320 @param sw_if_index - sw index of the interface that was created
321 @param retval - return code for the request
323 define create_loopback_reply
330 /** \brief Create loopback interface instance request
331 @param client_index - opaque cookie to identify the sender
332 @param context - sender context, to match reply w/ request
333 @param mac_address - mac addr to assign to the interface if none-zero
334 @param is_specified - if non-0, a specific user_instance is being requested
335 @param user_instance - requested instance, ~0 => dynamically allocate
337 define create_loopback_instance
346 /** \brief Create loopback interface instance response
347 @param context - sender context, to match reply w/ request
348 @param sw_if_index - sw index of the interface that was created
349 @param retval - return code for the request
351 define create_loopback_instance_reply
358 /** \brief Delete loopback interface request
359 @param client_index - opaque cookie to identify the sender
360 @param context - sender context, to match reply w/ request
361 @param sw_if_index - sw index of the interface that was created
363 autoreply define delete_loopback
370 /** \brief Control ping from client to api server request
371 @param client_index - opaque cookie to identify the sender
372 @param context - sender context, to match reply w/ request
380 /** \brief Control ping from the client to the server response
381 @param client_index - opaque cookie to identify the sender
382 @param context - sender context, to match reply w/ request
383 @param retval - return code for the request
384 @param vpe_pid - the pid of the vpe, returned by the server
386 define control_ping_reply
394 /** \brief Process a vpe parser cli string request
395 @param client_index - opaque cookie to identify the sender
396 @param context - sender context, to match reply w/ request
397 @param cmd_in_shmem - pointer to cli command string
413 /** \brief vpe parser cli string response
414 @param context - sender context, to match reply w/ request
415 @param retval - return code for request
416 @param reply_in_shmem - Reply string from cli processing if any
424 define cli_inband_reply
432 /** \brief Set max allowed ARP or ip6 neighbor entries request
433 @param client_index - opaque cookie to identify the sender
434 @param context - sender context, to match reply w/ request
435 @param is_ipv6 - neighbor limit if non-zero, else ARP limit
436 @param arp_neighbor_limit - the new limit, defaults are ~ 50k
438 autoreply define set_arp_neighbor_limit
443 u32 arp_neighbor_limit;
446 /** \brief L2 interface patch add / del request
447 @param client_index - opaque cookie to identify the sender
448 @param context - sender context, to match reply w/ request
449 @param rx_sw_if_index - receive side interface
450 @param tx_sw_if_index - transmit side interface
451 @param is_add - if non-zero set up the interface patch, else remove it
453 autoreply define l2_patch_add_del
462 /** \brief Interface set vpath request
463 @param client_index - opaque cookie to identify the sender
464 @param context - sender context, to match reply w/ request
465 @param sw_if_index - interface used to reach neighbor
466 @param enable - if non-zero enable, else disable
468 autoreply define sw_interface_set_vpath
476 /** \brief Set L2 XConnect between two interfaces request
477 @param client_index - opaque cookie to identify the sender
478 @param context - sender context, to match reply w/ request
479 @param rx_sw_if_index - Receive interface index
480 @param tx_sw_if_index - Transmit interface index
481 @param enable - enable xconnect if not 0, else set to L3 mode
483 autoreply define sw_interface_set_l2_xconnect
492 /** \brief Interface bridge mode request
493 @param client_index - opaque cookie to identify the sender
494 @param context - sender context, to match reply w/ request
495 @param rx_sw_if_index - the interface
496 @param bd_id - bridge domain id
497 @param bvi - Setup interface as a bvi, bridge mode only
498 @param shg - Shared horizon group, for bridge mode only
499 @param enable - Enable beige mode if not 0, else set to L3 mode
501 autoreply define sw_interface_set_l2_bridge
512 /** \brief Set bridge domain ip to mac entry request
513 @param client_index - opaque cookie to identify the sender
514 @param context - sender context, to match reply w/ request
515 @param bd_id - the bridge domain to set the flags for
516 @param is_add - if non-zero, add the entry, else clear it
517 @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
518 @param mac_address - MAC address
521 autoreply define bd_ip_mac_add_del
532 /** \brief Set/unset the classification table for an interface request
533 @param client_index - opaque cookie to identify the sender
534 @param context - sender context, to match reply w/ request
535 @param is_ipv6 - ipv6 if non-zero, else ipv4
536 @param sw_if_index - interface to associate with the table
537 @param table_index - index of the table, if ~0 unset the table
539 autoreply define classify_set_interface_ip_table
545 u32 table_index; /* ~0 => off */
548 /** \brief Set/unset l2 classification tables for an interface request
549 @param client_index - opaque cookie to identify the sender
550 @param context - sender context, to match reply w/ request
551 @param sw_if_index - interface to set/unset tables for
552 @param ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset
553 @param ip6_table_index - ip6 index
554 @param other_table_index - other index
556 autoreply define classify_set_interface_l2_tables
564 u32 other_table_index;
568 /** \brief Get node index using name request
569 @param client_index - opaque cookie to identify the sender
570 @param context - sender context, to match reply w/ request
571 @param node_name[] - name of the node
573 define get_node_index
580 /** \brief Get node index using name request
581 @param context - sender context, to match reply w/ request
582 @param retval - return code for the request
583 @param node_index - index of the desired node if found, else ~0
585 define get_node_index_reply
592 /** \brief Set the next node for a given node request
593 @param client_index - opaque cookie to identify the sender
594 @param context - sender context, to match reply w/ request
595 @param node_name[] - node to add the next node to
596 @param next_name[] - node to add as the next node
606 /** \brief IP Set the next node for a given node response
607 @param context - sender context, to match reply w/ request
608 @param retval - return code for the add next node request
609 @param next_index - the index of the next node if success, else ~0
611 define add_node_next_reply
618 /** \brief L2 interface ethernet flow point filtering enable/disable request
619 @param client_index - opaque cookie to identify the sender
620 @param context - sender context, to match reply w/ request
621 @param sw_if_index - interface to enable/disable filtering on
622 @param enable_disable - if non-zero enable filtering, else disable
624 autoreply define l2_interface_efp_filter
639 /* These fields map directly onto the subif template */
643 u8 dot1ad; // 0 = dot1q, 1=dot1ad
646 u8 outer_vlan_id_any;
647 u8 inner_vlan_id_any;
652 define create_subif_reply
659 /** \brief show version
660 @param client_index - opaque cookie to identify the sender
661 @param context - sender context, to match reply w/ request
669 /** \brief show version response
670 @param context - sender context, to match reply w/ request
671 @param retval - return code for the request
672 @param program - name of the program (vpe)
673 @param version - version of the program
674 @param build_directory - root of the workspace where the program was built
676 define show_version_reply
683 u8 build_directory[256];
686 /* Gross kludge, DGMS */
687 autoreply define interface_name_renumber
692 u32 new_show_dev_instance;
695 /** \brief Register for ip4 arp resolution events
696 @param client_index - opaque cookie to identify the sender
697 @param context - sender context, to match reply w/ request
698 @param enable_disable - 1 => register for events, 0 => cancel registration
699 @param pid - sender's pid
700 @param address - the exact ip4 address of interest
702 autoreply define want_ip4_arp_events
711 /** \brief Tell client about an ip4 arp resolution event
712 @param client_index - opaque cookie to identify the sender
713 @param address - the exact ip4 address of interest
714 @param pid - client pid registered to receive notification
715 @param sw_if_index - interface which received ARP packet
716 @param new_mac - the new mac address
717 @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
729 /** \brief Register for ip6 nd resolution events
730 @param client_index - opaque cookie to identify the sender
731 @param context - sender context, to match reply w/ request
732 @param enable_disable - 1 => register for events, 0 => cancel registration
733 @param pid - sender's pid
734 @param address - the exact ip6 address of interest
736 autoreply define want_ip6_nd_events
745 /** \brief Tell client about an ip6 nd resolution or mac/ip event
746 @param client_index - opaque cookie to identify the sender
747 @param pid - client pid registered to receive notification
748 @param sw_if_index - interface which received ARP packet
749 @param address - the exact ip6 address of interest
750 @param new_mac - the new mac address
751 @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
763 /** \brief Set/unset input ACL interface
764 @param client_index - opaque cookie to identify the sender
765 @param context - sender context, to match reply w/ request
766 @param sw_if_index - interface to set/unset input ACL
767 @param ip4_table_index - ip4 classify table index (~0 for skip)
768 @param ip6_table_index - ip6 classify table index (~0 for skip)
769 @param l2_table_index - l2 classify table index (~0 for skip)
770 @param is_add - Set input ACL if non-zero, else unset
771 Note: User is recommeneded to use just one valid table_index per call.
772 (ip4_table_index, ip6_table_index, or l2_table_index)
774 autoreply define input_acl_set_interface
785 define get_node_graph
791 /** \brief get_node_graph_reply
792 @param context - returned sender context, to match reply w/ request
793 @param retval - return code
794 @param reply_in_shmem - result from vlib_node_serialize, in shared
795 memory. Process with vlib_node_unserialize, remember to switch
796 heaps and free the result.
799 define get_node_graph_reply
806 /** \brief IOAM enable : Enable in-band OAM
807 @param id - profile id
808 @param seqno - To enable Seqno Processing
809 @param analyse - Enabling analysis of iOAM at decap node
810 @param pow_enable - Proof of Work enabled or not flag
811 @param trace_enable - iOAM Trace enabled or not flag
813 autoreply define ioam_enable
825 /** \brief iOAM disable
826 @param client_index - opaque cookie to identify the sender
827 @param context - sender context, to match reply w/ request
828 @param index - MAP Domain index
830 autoreply define ioam_disable
837 /** \brief Query relative index via node names
838 @param client_index - opaque cookie to identify the sender
839 @param context - sender context, to match reply w/ request
840 @param node_name - name of node to find relative index from
841 @param next_name - next node from node_name to find relative index of
843 define get_next_index
851 /** \brief Reply for get next node index
852 @param context - sender context which was passed in the request
853 @param retval - return value
854 @param next_index - index of the next_node
856 define get_next_index_reply
863 /** \brief PacketGenerator create interface request
864 @param client_index - opaque cookie to identify the sender
865 @param context - sender context, to match reply w/ request
866 @param interface_id - interface index
868 define pg_create_interface
875 /** \brief PacketGenerator create interface response
876 @param context - sender context, to match reply w/ request
877 @param retval - return value for request
879 define pg_create_interface_reply
886 /** \brief PacketGenerator capture packets on given interface request
887 @param client_index - opaque cookie to identify the sender
888 @param context - sender context, to match reply w/ request
889 @param interface_id - pg interface index
890 @param is_enabled - 1 if enabling streams, 0 if disabling
891 @param count - number of packets to be captured
892 @param pcap_file - pacp file name to store captured packets
894 autoreply define pg_capture
901 u32 pcap_name_length;
902 u8 pcap_file_name[pcap_name_length];
905 /** \brief Enable / disable packet generator request
906 @param client_index - opaque cookie to identify the sender
907 @param context - sender context, to match reply w/ request
908 @param is_enabled - 1 if enabling streams, 0 if disabling
909 @param stream - stream name to be enable/disabled, if not specified handle all streams
911 autoreply define pg_enable_disable
916 u32 stream_name_length;
917 u8 stream_name[stream_name_length];
920 /** \brief Configure IP source and L4 port-range check
921 @param client_index - opaque cookie to identify the sender
922 @param context - sender context, to match reply w/ request
923 @param is_ip6 - 1 if source address type is IPv6
924 @param is_add - 1 if add, 0 if delete
925 @param mask_length - mask length for address entry
926 @param address - array of address bytes
927 @param number_of_ranges - length of low_port and high_port arrays (must match)
928 @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
929 @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
930 @param vrf_id - fib table/vrf id to associate the source and port-range check with
931 @note To specify a single port set low_port and high_port entry the same
933 autoreply define ip_source_and_port_range_check_add_del
947 /** \brief Set interface source and L4 port-range request
948 @param client_index - opaque cookie to identify the sender
949 @param context - sender context, to match reply w/ request
950 @param interface_id - interface index
951 @param tcp_vrf_id - VRF associated with source and TCP port-range check
952 @param udp_vrf_id - VRF associated with source and TCP port-range check
954 autoreply define ip_source_and_port_range_check_interface_add_del
966 /** \brief Delete sub interface request
967 @param client_index - opaque cookie to identify the sender
968 @param context - sender context, to match reply w/ request
969 @param sw_if_index - sw index of the interface that was created by create_subif
971 autoreply define delete_subif {
977 /** \brief Punt traffic to the host
978 @param client_index - opaque cookie to identify the sender
979 @param context - sender context, to match reply w/ request
980 @param is_add - add punt if non-zero, else delete
981 @param ipv - L3 protocol 4 - IPv4, 6 - IPv6, ~0 - All
982 @param l4_protocol - L4 protocol to be punted, only UDP (0x11) is supported
983 @param l4_port - TCP/UDP port to be punted
985 autoreply define punt {
994 /** \brief Punt traffic to the host via socket
995 @param client_index - opaque cookie to identify the sender
996 @param context - sender context, to match reply w/ request
997 @param header_version - expected meta data header version (currently 1)
998 @param is_ip4 - L3 protocol 1 - IPv4, 0 - IPv6
999 @param l4_protocol - L4 protocol to be punted, only UDP (0x11) is supported
1000 @param l4_port - TCP/UDP port to be punted
1002 define punt_socket_register {
1012 define punt_socket_register_reply
1019 autoreply define punt_socket_deregister {
1027 /** \brief Feature path enable/disable request
1028 @param client_index - opaque cookie to identify the sender
1029 @param context - sender context, to match reply w/ request
1030 @param sw_if_index - the interface
1031 @param enable - 1 = on, 0 = off
1033 autoreply define feature_enable_disable {
1039 u8 feature_name[64];
1044 * eval: (c-set-style "gnu")