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 * AF-PACKET APIs: see ... /vnet/devices/af_packet/{af_packet.api, af_packet_api.c}
30 * NETMAP APIs: see ... /src/vnet/devices/netmap/{netmap.api, netmap_api.c}
31 * VHOST-USER APIs: see .../vnet/devices/virtio/{vhost_user.api, vhost_user_api.c}
32 * VXLAN GPE APIs: see .../src/vnet/vxlan-gpe/{vxlan_gpe.api, vxlan_gpe_api.c}
33 * GRE APIs: see .../src/vnet/gre/{gre.api, gre_api.c}
34 * L2 APIs: see .../src/vnet/l2/{l2.api, l2_api.c}
35 * L2TP APIs: see .../src/vnet/l2tp/{l2tp.api, l2tp_api.c}
36 * BFD APIs: see .../src/vnet/bfd/{bfd.api, bfd_api.c}
37 * IPSEC APIs: see .../src/vnet/ipsec/{ipsec.api, ipsec_api.c}
38 * IPSEC-GRE APIs: see .../src/vnet/ipsec-gre/{ipsec_gre.api, ipsec_gre_api.c}
39 * LISP APIs: see .../src/vnet/lisp/{lisp.api, lisp_api.c}
40 * LISP-GPE APIs: see .../src/vnet/lisp-gpe/{lisp_gpe.api, lisp_gpe_api.c}
41 * SESSION APIs: .../vnet/session/{session.api session_api.c}
42 * MPLS APIs: see .../src/vnet/mpls/{mpls.api, mpls_api.c}
43 * SR APIs: see .../src/vnet/srv6/{sr.api, sr_api.c}
44 * CLASSIFY APIs: see ... /src/vnet/classify/{classify.api, classify_api.c}
45 * FLOW APIs: see ... /src/vnet/flow/{flow.api, flow_api.c}
46 * DHCP APIs: see ... /src/vnet/dhcp/{dhcpk.api, dhcp_api.c}
47 * COP APIs: see ... /src/vnet/cop/{cop.api, cop_api.c}
48 * POLICER APIs: see ... /src/vnet/policer/{policer.api, policer_api.c}
51 /** \brief Create a new subinterface with the given vlan id
52 @param client_index - opaque cookie to identify the sender
53 @param context - sender context, to match reply w/ request
54 @param sw_if_index - software index of the new vlan's parent interface
55 @param vlan_id - vlan tag of the new interface
57 define create_vlan_subif
65 /** \brief Reply for the vlan subinterface create request
66 @param context - returned sender context, to match reply w/ request
67 @param retval - return code
68 @param sw_if_index - software index allocated for the new subinterface
70 define create_vlan_subif_reply
77 /** \brief Enable or Disable MPLS on and interface
78 @param client_index - opaque cookie to identify the sender
79 @param context - sender context, to match reply w/ request
80 @param sw_if_index - index of the interface
81 @param enable - if non-zero enable, else disable
83 autoreply define sw_interface_set_mpls_enable
91 /** \brief Proxy ARP add / del request
92 @param client_index - opaque cookie to identify the sender
93 @param context - sender context, to match reply w/ request
94 @param vrf_id - VRF / Fib table ID
95 @param is_add - 1 if adding the Proxy ARP range, 0 if deleting
96 @param low_address[4] - Low address of the Proxy ARP range
97 @param hi_address[4] - High address of the Proxy ARP range
99 autoreply define proxy_arp_add_del
109 /** \brief Proxy ARP add / del request
110 @param client_index - opaque cookie to identify the sender
111 @param context - sender context, to match reply w/ request
112 @param sw_if_index - Which interface to enable / disable Proxy Arp on
113 @param enable_disable - 1 to enable Proxy ARP on interface, 0 to disable
115 autoreply define proxy_arp_intfc_enable_disable
120 /* 1 = on, 0 = off */
124 /** \brief Reset VRF (remove all routes etc) request
125 @param client_index - opaque cookie to identify the sender
126 @param context - sender context, to match reply w/ request
127 @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
128 @param vrf_id - ID of th FIB table / VRF to reset
130 autoreply define reset_vrf
138 /** \brief Want Stats, register for stats updates
139 @param client_index - opaque cookie to identify the sender
140 @param context - sender context, to match reply w/ request
141 @param enable_disable - 1 = enable stats, 0 = disable
142 @param pid - pid of process requesting stats updates
144 autoreply define want_stats
152 typeonly manual_print manual_endian define ip4_fib_counter
160 manual_print manual_endian define vnet_ip4_fib_counters
164 vl_api_ip4_fib_counter_t c[count];
167 typeonly manual_print manual_endian define ip4_nbr_counter
176 * @brief Per-neighbour (i.e. per-adjacency) coutners
177 * @param count The size of the array of counters
178 * @param sw_if_index The interface the adjacency is on
179 * @param begin Flag to indicate this is the first set of stats for this
180 * interface. If this flag is not set the it is a continuation of
181 * stats for this interface
184 manual_print manual_endian define vnet_ip4_nbr_counters
189 vl_api_ip4_nbr_counter_t c[count];
192 typeonly manual_print manual_endian define ip6_fib_counter
200 manual_print manual_endian define vnet_ip6_fib_counters
204 vl_api_ip6_fib_counter_t c[count];
207 typeonly manual_print manual_endian define ip6_nbr_counter
215 manual_print manual_endian define vnet_ip6_nbr_counters
220 vl_api_ip6_nbr_counter_t c[count];
223 /** \brief Request for a single block of summary stats
224 @param client_index - opaque cookie to identify the sender
225 @param context - sender context, to match reply w/ request
227 define vnet_get_summary_stats
233 /** \brief Reply for vnet_get_summary_stats request
234 @param context - sender context, to match reply w/ request
235 @param retval - return code for request
240 define vnet_get_summary_stats_reply
249 /** \brief OAM event structure
250 @param dst_address[] -
259 /** \brief Want OAM events request
260 @param client_index - opaque cookie to identify the sender
261 @param context - sender context, to match reply w/ request
262 @param enable_disable- enable if non-zero, else disable
263 @param pid - pid of the requesting process
265 autoreply define want_oam_events
273 /** \brief OAM add / del target request
274 @param client_index - opaque cookie to identify the sender
275 @param context - sender context, to match reply w/ request
276 @param vrf_id - vrf_id of the target
277 @param src_address[] - source address to use for the updates
278 @param dst_address[] - destination address of the target
279 @param is_add - add target if non-zero, else delete
281 autoreply define oam_add_del
291 /** \brief Reset fib table request
292 @param client_index - opaque cookie to identify the sender
293 @param context - sender context, to match reply w/ request
294 @param vrf_id - vrf/table id of the fib table to reset
295 @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
297 autoreply define reset_fib
305 /** \brief Create loopback interface request
306 @param client_index - opaque cookie to identify the sender
307 @param context - sender context, to match reply w/ request
308 @param mac_address - mac addr to assign to the interface if none-zero
310 define create_loopback
317 /** \brief Create loopback interface response
318 @param context - sender context, to match reply w/ request
319 @param sw_if_index - sw index of the interface that was created
320 @param retval - return code for the request
322 define create_loopback_reply
329 /** \brief Create loopback interface instance request
330 @param client_index - opaque cookie to identify the sender
331 @param context - sender context, to match reply w/ request
332 @param mac_address - mac addr to assign to the interface if none-zero
333 @param is_specified - if non-0, a specific user_instance is being requested
334 @param user_instance - requested instance, ~0 => dynamically allocate
336 define create_loopback_instance
345 /** \brief Create loopback interface instance response
346 @param context - sender context, to match reply w/ request
347 @param sw_if_index - sw index of the interface that was created
348 @param retval - return code for the request
350 define create_loopback_instance_reply
357 /** \brief Delete loopback interface request
358 @param client_index - opaque cookie to identify the sender
359 @param context - sender context, to match reply w/ request
360 @param sw_if_index - sw index of the interface that was created
362 autoreply define delete_loopback
369 /** \brief Control ping from client to api server request
370 @param client_index - opaque cookie to identify the sender
371 @param context - sender context, to match reply w/ request
379 /** \brief Control ping from the client to the server response
380 @param client_index - opaque cookie to identify the sender
381 @param context - sender context, to match reply w/ request
382 @param retval - return code for the request
383 @param vpe_pid - the pid of the vpe, returned by the server
385 define control_ping_reply
393 /** \brief Process a vpe parser cli string request
394 @param client_index - opaque cookie to identify the sender
395 @param context - sender context, to match reply w/ request
396 @param cmd_in_shmem - pointer to cli command string
412 /** \brief vpe parser cli string response
413 @param context - sender context, to match reply w/ request
414 @param retval - return code for request
415 @param reply_in_shmem - Reply string from cli processing if any
423 define cli_inband_reply
431 /** \brief Set max allowed ARP or ip6 neighbor entries request
432 @param client_index - opaque cookie to identify the sender
433 @param context - sender context, to match reply w/ request
434 @param is_ipv6 - neighbor limit if non-zero, else ARP limit
435 @param arp_neighbor_limit - the new limit, defaults are ~ 50k
437 autoreply define set_arp_neighbor_limit
442 u32 arp_neighbor_limit;
445 /** \brief L2 interface patch add / del request
446 @param client_index - opaque cookie to identify the sender
447 @param context - sender context, to match reply w/ request
448 @param rx_sw_if_index - receive side interface
449 @param tx_sw_if_index - transmit side interface
450 @param is_add - if non-zero set up the interface patch, else remove it
452 autoreply define l2_patch_add_del
461 /** \brief Interface set vpath request
462 @param client_index - opaque cookie to identify the sender
463 @param context - sender context, to match reply w/ request
464 @param sw_if_index - interface used to reach neighbor
465 @param enable - if non-zero enable, else disable
467 autoreply define sw_interface_set_vpath
475 /** \brief Set L2 XConnect between two interfaces request
476 @param client_index - opaque cookie to identify the sender
477 @param context - sender context, to match reply w/ request
478 @param rx_sw_if_index - Receive interface index
479 @param tx_sw_if_index - Transmit interface index
480 @param enable - enable xconnect if not 0, else set to L3 mode
482 autoreply define sw_interface_set_l2_xconnect
491 /** \brief Interface bridge mode request
492 @param client_index - opaque cookie to identify the sender
493 @param context - sender context, to match reply w/ request
494 @param rx_sw_if_index - the interface
495 @param bd_id - bridge domain id
496 @param bvi - Setup interface as a bvi, bridge mode only
497 @param shg - Shared horizon group, for bridge mode only
498 @param enable - Enable beige mode if not 0, else set to L3 mode
500 autoreply define sw_interface_set_l2_bridge
511 /** \brief Set bridge domain ip to mac entry request
512 @param client_index - opaque cookie to identify the sender
513 @param context - sender context, to match reply w/ request
514 @param bd_id - the bridge domain to set the flags for
515 @param is_add - if non-zero, add the entry, else clear it
516 @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
517 @param mac_address - MAC address
520 autoreply define bd_ip_mac_add_del
531 /** \brief Set/unset the classification table for an interface request
532 @param client_index - opaque cookie to identify the sender
533 @param context - sender context, to match reply w/ request
534 @param is_ipv6 - ipv6 if non-zero, else ipv4
535 @param sw_if_index - interface to associate with the table
536 @param table_index - index of the table, if ~0 unset the table
538 autoreply define classify_set_interface_ip_table
544 u32 table_index; /* ~0 => off */
547 /** \brief Set/unset l2 classification tables for an interface request
548 @param client_index - opaque cookie to identify the sender
549 @param context - sender context, to match reply w/ request
550 @param sw_if_index - interface to set/unset tables for
551 @param ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset
552 @param ip6_table_index - ip6 index
553 @param other_table_index - other index
555 autoreply define classify_set_interface_l2_tables
563 u32 other_table_index;
567 /** \brief Get node index using name request
568 @param client_index - opaque cookie to identify the sender
569 @param context - sender context, to match reply w/ request
570 @param node_name[] - name of the node
572 define get_node_index
579 /** \brief Get node index using name request
580 @param context - sender context, to match reply w/ request
581 @param retval - return code for the request
582 @param node_index - index of the desired node if found, else ~0
584 define get_node_index_reply
591 /** \brief Set the next node for a given node request
592 @param client_index - opaque cookie to identify the sender
593 @param context - sender context, to match reply w/ request
594 @param node_name[] - node to add the next node to
595 @param next_name[] - node to add as the next node
605 /** \brief IP Set the next node for a given node response
606 @param context - sender context, to match reply w/ request
607 @param retval - return code for the add next node request
608 @param next_index - the index of the next node if success, else ~0
610 define add_node_next_reply
617 /** \brief L2 interface ethernet flow point filtering enable/disable request
618 @param client_index - opaque cookie to identify the sender
619 @param context - sender context, to match reply w/ request
620 @param sw_if_index - interface to enable/disable filtering on
621 @param enable_disable - if non-zero enable filtering, else disable
623 autoreply define l2_interface_efp_filter
638 /* These fields map directly onto the subif template */
642 u8 dot1ad; // 0 = dot1q, 1=dot1ad
645 u8 outer_vlan_id_any;
646 u8 inner_vlan_id_any;
651 define create_subif_reply
658 /** \brief show version
659 @param client_index - opaque cookie to identify the sender
660 @param context - sender context, to match reply w/ request
668 /** \brief show version response
669 @param context - sender context, to match reply w/ request
670 @param retval - return code for the request
671 @param program - name of the program (vpe)
672 @param version - version of the program
673 @param build_directory - root of the workspace where the program was built
675 define show_version_reply
682 u8 build_directory[256];
685 /* Gross kludge, DGMS */
686 autoreply define interface_name_renumber
691 u32 new_show_dev_instance;
694 /** \brief Register for ip4 arp resolution events
695 @param client_index - opaque cookie to identify the sender
696 @param context - sender context, to match reply w/ request
697 @param enable_disable - 1 => register for events, 0 => cancel registration
698 @param pid - sender's pid
699 @param address - the exact ip4 address of interest
701 autoreply define want_ip4_arp_events
710 /** \brief Tell client about an ip4 arp resolution event
711 @param client_index - opaque cookie to identify the sender
712 @param context - sender context, to match reply w/ request
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
730 /** \brief Register for ip6 nd resolution events
731 @param client_index - opaque cookie to identify the sender
732 @param context - sender context, to match reply w/ request
733 @param enable_disable - 1 => register for events, 0 => cancel registration
734 @param pid - sender's pid
735 @param address - the exact ip6 address of interest
737 autoreply define want_ip6_nd_events
746 /** \brief Tell client about an ip6 nd resolution or mac/ip event
747 @param client_index - opaque cookie to identify the sender
748 @param context - sender context, to match reply w/ request
749 @param pid - client pid registered to receive notification
750 @param sw_if_index - interface which received ARP packet
751 @param address - the exact ip6 address of interest
752 @param new_mac - the new mac address
753 @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
766 /** \brief Set/unset input ACL interface
767 @param client_index - opaque cookie to identify the sender
768 @param context - sender context, to match reply w/ request
769 @param sw_if_index - interface to set/unset input ACL
770 @param ip4_table_index - ip4 classify table index (~0 for skip)
771 @param ip6_table_index - ip6 classify table index (~0 for skip)
772 @param l2_table_index - l2 classify table index (~0 for skip)
773 @param is_add - Set input ACL if non-zero, else unset
774 Note: User is recommeneded to use just one valid table_index per call.
775 (ip4_table_index, ip6_table_index, or l2_table_index)
777 autoreply define input_acl_set_interface
788 define get_node_graph
794 /** \brief get_node_graph_reply
795 @param context - returned sender context, to match reply w/ request
796 @param retval - return code
797 @param reply_in_shmem - result from vlib_node_serialize, in shared
798 memory. Process with vlib_node_unserialize, remember to switch
799 heaps and free the result.
802 define get_node_graph_reply
809 /** \brief IOAM enable : Enable in-band OAM
810 @param id - profile id
811 @param seqno - To enable Seqno Processing
812 @param analyse - Enabling analysis of iOAM at decap node
813 @param pow_enable - Proof of Work enabled or not flag
814 @param trace_enable - iOAM Trace enabled or not flag
816 autoreply define ioam_enable
828 /** \brief iOAM disable
829 @param client_index - opaque cookie to identify the sender
830 @param context - sender context, to match reply w/ request
831 @param index - MAP Domain index
833 autoreply define ioam_disable
840 /** \brief Query relative index via node names
841 @param client_index - opaque cookie to identify the sender
842 @param context - sender context, to match reply w/ request
843 @param node_name - name of node to find relative index from
844 @param next_name - next node from node_name to find relative index of
846 define get_next_index
854 /** \brief Reply for get next node index
855 @param context - sender context which was passed in the request
856 @param retval - return value
857 @param next_index - index of the next_node
859 define get_next_index_reply
866 /** \brief PacketGenerator create interface request
867 @param client_index - opaque cookie to identify the sender
868 @param context - sender context, to match reply w/ request
869 @param interface_id - interface index
871 define pg_create_interface
878 /** \brief PacketGenerator create interface response
879 @param context - sender context, to match reply w/ request
880 @param retval - return value for request
882 define pg_create_interface_reply
889 /** \brief PacketGenerator capture packets on given interface request
890 @param client_index - opaque cookie to identify the sender
891 @param context - sender context, to match reply w/ request
892 @param interface_id - pg interface index
893 @param is_enabled - 1 if enabling streams, 0 if disabling
894 @param count - number of packets to be captured
895 @param pcap_file - pacp file name to store captured packets
897 autoreply define pg_capture
904 u32 pcap_name_length;
905 u8 pcap_file_name[pcap_name_length];
908 /** \brief Enable / disable packet generator request
909 @param client_index - opaque cookie to identify the sender
910 @param context - sender context, to match reply w/ request
911 @param is_enabled - 1 if enabling streams, 0 if disabling
912 @param stream - stream name to be enable/disabled, if not specified handle all streams
914 autoreply define pg_enable_disable
919 u32 stream_name_length;
920 u8 stream_name[stream_name_length];
923 /** \brief Configure IP source and L4 port-range check
924 @param client_index - opaque cookie to identify the sender
925 @param context - sender context, to match reply w/ request
926 @param is_ip6 - 1 if source address type is IPv6
927 @param is_add - 1 if add, 0 if delete
928 @param mask_length - mask length for address entry
929 @param address - array of address bytes
930 @param number_of_ranges - length of low_port and high_port arrays (must match)
931 @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
932 @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
933 @param vrf_id - fib table/vrf id to associate the source and port-range check with
934 @note To specify a single port set low_port and high_port entry the same
936 autoreply define ip_source_and_port_range_check_add_del
950 /** \brief Set interface source and L4 port-range request
951 @param client_index - opaque cookie to identify the sender
952 @param context - sender context, to match reply w/ request
953 @param interface_id - interface index
954 @param tcp_vrf_id - VRF associated with source and TCP port-range check
955 @param udp_vrf_id - VRF associated with source and TCP port-range check
957 autoreply define ip_source_and_port_range_check_interface_add_del
969 /** \brief Delete sub interface request
970 @param client_index - opaque cookie to identify the sender
971 @param context - sender context, to match reply w/ request
972 @param sw_if_index - sw index of the interface that was created by create_subif
974 autoreply define delete_subif {
980 /** \brief Punt traffic to the host
981 @param client_index - opaque cookie to identify the sender
982 @param context - sender context, to match reply w/ request
983 @param is_add - add punt if non-zero, else delete
984 @param ipv - L3 protocol 4 - IPv4, 6 - IPv6, ~0 - All
985 @param l4_protocol - L4 protocol to be punted, only UDP (0x11) is supported
986 @param l4_port - TCP/UDP port to be punted
988 autoreply define punt {
997 /** \brief Feature path enable/disable request
998 @param client_index - opaque cookie to identify the sender
999 @param context - sender context, to match reply w/ request
1000 @param sw_if_index - the interface
1001 @param enable - 1 = on, 0 = off
1003 autoreply define feature_enable_disable {
1009 u8 feature_name[64];
1014 * eval: (c-set-style "gnu")