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 Is Address Reachable request - DISABLED
139 @param client_index - opaque cookie to identify the sender
140 @param context - sender context, to match reply w/ request
141 @param next_hop_sw_if_index - index of interface used to get to next hop
142 @param is_ipv6 - 1 for IPv6, 0 for IPv4
143 @param is_error - address not found or does not match intf
144 @param address[] - Address in question
146 define is_address_reachable
148 u32 client_index; /* (api_main_t *) am->my_client_index */
150 u32 next_hop_sw_if_index;
151 u8 is_known; /* on reply, this is the answer */
153 u8 is_error; /* address not found or does not match intf */
157 /** \brief Want Stats, register for stats updates
158 @param client_index - opaque cookie to identify the sender
159 @param context - sender context, to match reply w/ request
160 @param enable_disable - 1 = enable stats, 0 = disable
161 @param pid - pid of process requesting stats updates
163 autoreply define want_stats
171 typeonly manual_print manual_endian define ip4_fib_counter
179 manual_print manual_endian define vnet_ip4_fib_counters
183 vl_api_ip4_fib_counter_t c[count];
186 typeonly manual_print manual_endian define ip4_nbr_counter
195 * @brief Per-neighbour (i.e. per-adjacency) coutners
196 * @param count The size of the array of counters
197 * @param sw_if_index The interface the adjacency is on
198 * @param begin Flag to indicate this is the first set of stats for this
199 * interface. If this flag is not set the it is a continuation of
200 * stats for this interface
203 manual_print manual_endian define vnet_ip4_nbr_counters
208 vl_api_ip4_nbr_counter_t c[count];
211 typeonly manual_print manual_endian define ip6_fib_counter
219 manual_print manual_endian define vnet_ip6_fib_counters
223 vl_api_ip6_fib_counter_t c[count];
226 typeonly manual_print manual_endian define ip6_nbr_counter
234 manual_print manual_endian define vnet_ip6_nbr_counters
239 vl_api_ip6_nbr_counter_t c[count];
242 /** \brief Request for a single block of summary stats
243 @param client_index - opaque cookie to identify the sender
244 @param context - sender context, to match reply w/ request
246 define vnet_get_summary_stats
252 /** \brief Reply for vnet_get_summary_stats request
253 @param context - sender context, to match reply w/ request
254 @param retval - return code for request
259 define vnet_summary_stats_reply
268 /** \brief OAM event structure
269 @param dst_address[] -
278 /** \brief Want OAM events request
279 @param client_index - opaque cookie to identify the sender
280 @param context - sender context, to match reply w/ request
281 @param enable_disable- enable if non-zero, else disable
282 @param pid - pid of the requesting process
284 autoreply define want_oam_events
292 /** \brief OAM add / del target 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_id of the target
296 @param src_address[] - source address to use for the updates
297 @param dst_address[] - destination address of the target
298 @param is_add - add target if non-zero, else delete
300 autoreply define oam_add_del
310 /** \brief Reset fib table request
311 @param client_index - opaque cookie to identify the sender
312 @param context - sender context, to match reply w/ request
313 @param vrf_id - vrf/table id of the fib table to reset
314 @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
316 autoreply define reset_fib
324 /** \brief Create loopback interface request
325 @param client_index - opaque cookie to identify the sender
326 @param context - sender context, to match reply w/ request
327 @param mac_address - mac addr to assign to the interface if none-zero
329 define create_loopback
336 /** \brief Create loopback interface response
337 @param context - sender context, to match reply w/ request
338 @param sw_if_index - sw index of the interface that was created
339 @param retval - return code for the request
341 define create_loopback_reply
348 /** \brief Create loopback interface instance request
349 @param client_index - opaque cookie to identify the sender
350 @param context - sender context, to match reply w/ request
351 @param mac_address - mac addr to assign to the interface if none-zero
352 @param is_specified - if non-0, a specific user_instance is being requested
353 @param user_instance - requested instance, ~0 => dynamically allocate
355 define create_loopback_instance
364 /** \brief Create loopback interface instance response
365 @param context - sender context, to match reply w/ request
366 @param sw_if_index - sw index of the interface that was created
367 @param retval - return code for the request
369 define create_loopback_instance_reply
376 /** \brief Delete loopback interface request
377 @param client_index - opaque cookie to identify the sender
378 @param context - sender context, to match reply w/ request
379 @param sw_if_index - sw index of the interface that was created
381 autoreply define delete_loopback
388 /** \brief Control ping from client to api server request
389 @param client_index - opaque cookie to identify the sender
390 @param context - sender context, to match reply w/ request
398 /** \brief Control ping from the client to the server response
399 @param client_index - opaque cookie to identify the sender
400 @param context - sender context, to match reply w/ request
401 @param retval - return code for the request
402 @param vpe_pid - the pid of the vpe, returned by the server
404 define control_ping_reply
412 /** \brief Process a vpe parser cli string request
413 @param client_index - opaque cookie to identify the sender
414 @param context - sender context, to match reply w/ request
415 @param cmd_in_shmem - pointer to cli command string
431 /** \brief vpe parser cli string response
432 @param context - sender context, to match reply w/ request
433 @param retval - return code for request
434 @param reply_in_shmem - Reply string from cli processing if any
442 define cli_inband_reply
450 /** \brief Set max allowed ARP or ip6 neighbor entries request
451 @param client_index - opaque cookie to identify the sender
452 @param context - sender context, to match reply w/ request
453 @param is_ipv6 - neighbor limit if non-zero, else ARP limit
454 @param arp_neighbor_limit - the new limit, defaults are ~ 50k
456 autoreply define set_arp_neighbor_limit
461 u32 arp_neighbor_limit;
464 /** \brief L2 interface patch add / del request
465 @param client_index - opaque cookie to identify the sender
466 @param context - sender context, to match reply w/ request
467 @param rx_sw_if_index - receive side interface
468 @param tx_sw_if_index - transmit side interface
469 @param is_add - if non-zero set up the interface patch, else remove it
471 autoreply define l2_patch_add_del
480 /** \brief Interface set vpath request
481 @param client_index - opaque cookie to identify the sender
482 @param context - sender context, to match reply w/ request
483 @param sw_if_index - interface used to reach neighbor
484 @param enable - if non-zero enable, else disable
486 autoreply define sw_interface_set_vpath
494 /** \brief Set L2 XConnect between two interfaces request
495 @param client_index - opaque cookie to identify the sender
496 @param context - sender context, to match reply w/ request
497 @param rx_sw_if_index - Receive interface index
498 @param tx_sw_if_index - Transmit interface index
499 @param enable - enable xconnect if not 0, else set to L3 mode
501 autoreply define sw_interface_set_l2_xconnect
510 /** \brief Interface bridge mode request
511 @param client_index - opaque cookie to identify the sender
512 @param context - sender context, to match reply w/ request
513 @param rx_sw_if_index - the interface
514 @param bd_id - bridge domain id
515 @param bvi - Setup interface as a bvi, bridge mode only
516 @param shg - Shared horizon group, for bridge mode only
517 @param enable - Enable beige mode if not 0, else set to L3 mode
519 autoreply define sw_interface_set_l2_bridge
530 /** \brief Set bridge domain ip to mac entry request
531 @param client_index - opaque cookie to identify the sender
532 @param context - sender context, to match reply w/ request
533 @param bd_id - the bridge domain to set the flags for
534 @param is_add - if non-zero, add the entry, else clear it
535 @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
536 @param mac_address - MAC address
539 autoreply define bd_ip_mac_add_del
550 /** \brief Set/unset the classification table for an interface request
551 @param client_index - opaque cookie to identify the sender
552 @param context - sender context, to match reply w/ request
553 @param is_ipv6 - ipv6 if non-zero, else ipv4
554 @param sw_if_index - interface to associate with the table
555 @param table_index - index of the table, if ~0 unset the table
557 autoreply define classify_set_interface_ip_table
563 u32 table_index; /* ~0 => off */
566 /** \brief Set/unset l2 classification tables for an interface request
567 @param client_index - opaque cookie to identify the sender
568 @param context - sender context, to match reply w/ request
569 @param sw_if_index - interface to set/unset tables for
570 @param ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset
571 @param ip6_table_index - ip6 index
572 @param other_table_index - other index
574 autoreply define classify_set_interface_l2_tables
582 u32 other_table_index;
586 /** \brief Get node index using name request
587 @param client_index - opaque cookie to identify the sender
588 @param context - sender context, to match reply w/ request
589 @param node_name[] - name of the node
591 define get_node_index
598 /** \brief Get node index using name request
599 @param context - sender context, to match reply w/ request
600 @param retval - return code for the request
601 @param node_index - index of the desired node if found, else ~0
603 define get_node_index_reply
610 /** \brief Set the next node for a given node request
611 @param client_index - opaque cookie to identify the sender
612 @param context - sender context, to match reply w/ request
613 @param node_name[] - node to add the next node to
614 @param next_name[] - node to add as the next node
624 /** \brief IP Set the next node for a given node response
625 @param context - sender context, to match reply w/ request
626 @param retval - return code for the add next node request
627 @param next_index - the index of the next node if success, else ~0
629 define add_node_next_reply
636 /** \brief L2 interface ethernet flow point filtering enable/disable request
637 @param client_index - opaque cookie to identify the sender
638 @param context - sender context, to match reply w/ request
639 @param sw_if_index - interface to enable/disable filtering on
640 @param enable_disable - if non-zero enable filtering, else disable
642 autoreply define l2_interface_efp_filter
657 /* These fields map directly onto the subif template */
661 u8 dot1ad; // 0 = dot1q, 1=dot1ad
664 u8 outer_vlan_id_any;
665 u8 inner_vlan_id_any;
670 define create_subif_reply
677 /** \brief show version
678 @param client_index - opaque cookie to identify the sender
679 @param context - sender context, to match reply w/ request
687 /** \brief show version response
688 @param context - sender context, to match reply w/ request
689 @param retval - return code for the request
690 @param program - name of the program (vpe)
691 @param version - version of the program
692 @param build_directory - root of the workspace where the program was built
694 define show_version_reply
701 u8 build_directory[256];
704 /* Gross kludge, DGMS */
705 autoreply define interface_name_renumber
710 u32 new_show_dev_instance;
713 /** \brief Register for ip4 arp resolution events
714 @param client_index - opaque cookie to identify the sender
715 @param context - sender context, to match reply w/ request
716 @param enable_disable - 1 => register for events, 0 => cancel registration
717 @param pid - sender's pid
718 @param address - the exact ip4 address of interest
720 autoreply define want_ip4_arp_events
729 /** \brief Tell client about an ip4 arp resolution event
730 @param client_index - opaque cookie to identify the sender
731 @param context - sender context, to match reply w/ request
732 @param address - the exact ip4 address of interest
733 @param pid - client pid registered to receive notification
734 @param sw_if_index - interface which received ARP packet
735 @param new_mac - the new mac address
736 @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
749 /** \brief Register for ip6 nd resolution events
750 @param client_index - opaque cookie to identify the sender
751 @param context - sender context, to match reply w/ request
752 @param enable_disable - 1 => register for events, 0 => cancel registration
753 @param pid - sender's pid
754 @param address - the exact ip6 address of interest
756 autoreply define want_ip6_nd_events
765 /** \brief Tell client about an ip6 nd resolution or mac/ip event
766 @param client_index - opaque cookie to identify the sender
767 @param context - sender context, to match reply w/ request
768 @param pid - client pid registered to receive notification
769 @param sw_if_index - interface which received ARP packet
770 @param address - the exact ip6 address of interest
771 @param new_mac - the new mac address
772 @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
785 /** \brief Set/unset input ACL interface
786 @param client_index - opaque cookie to identify the sender
787 @param context - sender context, to match reply w/ request
788 @param sw_if_index - interface to set/unset input ACL
789 @param ip4_table_index - ip4 classify table index (~0 for skip)
790 @param ip6_table_index - ip6 classify table index (~0 for skip)
791 @param l2_table_index - l2 classify table index (~0 for skip)
792 @param is_add - Set input ACL if non-zero, else unset
793 Note: User is recommeneded to use just one valid table_index per call.
794 (ip4_table_index, ip6_table_index, or l2_table_index)
796 autoreply define input_acl_set_interface
807 define get_node_graph
813 /** \brief get_node_graph_reply
814 @param context - returned sender context, to match reply w/ request
815 @param retval - return code
816 @param reply_in_shmem - result from vlib_node_serialize, in shared
817 memory. Process with vlib_node_unserialize, remember to switch
818 heaps and free the result.
821 define get_node_graph_reply
828 /** \brief IOAM enable : Enable in-band OAM
829 @param id - profile id
830 @param seqno - To enable Seqno Processing
831 @param analyse - Enabling analysis of iOAM at decap node
832 @param pow_enable - Proof of Work enabled or not flag
833 @param trace_enable - iOAM Trace enabled or not flag
835 autoreply define ioam_enable
847 /** \brief iOAM disable
848 @param client_index - opaque cookie to identify the sender
849 @param context - sender context, to match reply w/ request
850 @param index - MAP Domain index
852 autoreply define ioam_disable
859 /** \brief Query relative index via node names
860 @param client_index - opaque cookie to identify the sender
861 @param context - sender context, to match reply w/ request
862 @param node_name - name of node to find relative index from
863 @param next_name - next node from node_name to find relative index of
865 define get_next_index
873 /** \brief Reply for get next node index
874 @param context - sender context which was passed in the request
875 @param retval - return value
876 @param next_index - index of the next_node
878 define get_next_index_reply
885 /** \brief PacketGenerator create interface request
886 @param client_index - opaque cookie to identify the sender
887 @param context - sender context, to match reply w/ request
888 @param interface_id - interface index
890 define pg_create_interface
897 /** \brief PacketGenerator create interface response
898 @param context - sender context, to match reply w/ request
899 @param retval - return value for request
901 define pg_create_interface_reply
908 /** \brief PacketGenerator capture packets on given interface request
909 @param client_index - opaque cookie to identify the sender
910 @param context - sender context, to match reply w/ request
911 @param interface_id - pg interface index
912 @param is_enabled - 1 if enabling streams, 0 if disabling
913 @param count - number of packets to be captured
914 @param pcap_file - pacp file name to store captured packets
916 autoreply define pg_capture
923 u32 pcap_name_length;
924 u8 pcap_file_name[pcap_name_length];
927 /** \brief Enable / disable packet generator request
928 @param client_index - opaque cookie to identify the sender
929 @param context - sender context, to match reply w/ request
930 @param is_enabled - 1 if enabling streams, 0 if disabling
931 @param stream - stream name to be enable/disabled, if not specified handle all streams
933 autoreply define pg_enable_disable
938 u32 stream_name_length;
939 u8 stream_name[stream_name_length];
942 /** \brief Configure IP source and L4 port-range check
943 @param client_index - opaque cookie to identify the sender
944 @param context - sender context, to match reply w/ request
945 @param is_ip6 - 1 if source address type is IPv6
946 @param is_add - 1 if add, 0 if delete
947 @param mask_length - mask length for address entry
948 @param address - array of address bytes
949 @param number_of_ranges - length of low_port and high_port arrays (must match)
950 @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
951 @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
952 @param vrf_id - fib table/vrf id to associate the source and port-range check with
953 @note To specify a single port set low_port and high_port entry the same
955 autoreply define ip_source_and_port_range_check_add_del
969 /** \brief Set interface source and L4 port-range request
970 @param client_index - opaque cookie to identify the sender
971 @param context - sender context, to match reply w/ request
972 @param interface_id - interface index
973 @param tcp_vrf_id - VRF associated with source and TCP port-range check
974 @param udp_vrf_id - VRF associated with source and TCP port-range check
976 autoreply define ip_source_and_port_range_check_interface_add_del
988 /** \brief Delete sub interface request
989 @param client_index - opaque cookie to identify the sender
990 @param context - sender context, to match reply w/ request
991 @param sw_if_index - sw index of the interface that was created by create_subif
993 autoreply define delete_subif {
999 /** \brief Punt traffic to the host
1000 @param client_index - opaque cookie to identify the sender
1001 @param context - sender context, to match reply w/ request
1002 @param is_add - add punt if non-zero, else delete
1003 @param ipv - L3 protocol 4 - IPv4, 6 - IPv6, ~0 - All
1004 @param l4_protocol - L4 protocol to be punted, only UDP (0x11) is supported
1005 @param l4_port - TCP/UDP port to be punted
1007 autoreply define punt {
1016 /** \brief Feature path enable/disable request
1017 @param client_index - opaque cookie to identify the sender
1018 @param context - sender context, to match reply w/ request
1019 @param sw_if_index - the interface
1020 @param enable - 1 = on, 0 = off
1022 autoreply define feature_enable_disable {
1028 u8 feature_name[64];
1033 * eval: (c-set-style "gnu")