1 /* Hey Emacs use -*- mode: C -*- */
3 * Linux Control Plane API
5 * Copyright 2020 Rubicon Communications, LLC.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at:
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 option version = "1.0.0";
22 import "vnet/interface_types.api";
24 /** \brief Set the default Linux Control Plane namespace
25 @param client_index - opaque cookie to identify the sender
26 @param context - sender context, to match reply w/ request
27 @param namespace - the new default namespace; namespace[0] == 0 iff none
29 autoreply define lcp_default_ns_set
33 string namespace[32]; /* LCP_NS_LEN */
36 /** \brief get the default Linux Control Plane namespace
37 @param client_index - opaque cookie to identify the sender
38 @param context - sender context, to match reply w/ request
40 define lcp_default_ns_get
46 /** \brief get the default Linux Control Plane namespace
47 @param client_index - opaque cookie to identify the sender
48 @param context - sender context, to match reply w/ request
49 @param namespace - the default namespace; namespace[0] == 0 iff none
51 define lcp_default_ns_get_reply
54 string namespace[32]; /* LCP_NS_LEN */
57 enum lcp_itf_host_type : u8
59 LCP_API_ITF_HOST_TAP = 0,
60 LCP_API_ITF_HOST_TUN = 1,
63 /** \brief Add or delete a Linux Conrol Plane interface pair
64 @param client_index - opaque cookie to identify the sender
65 @param context - sender context, to match reply w/ request
66 @param is_add - 0 if deleting, != 0 if adding
67 @param sw_if_index - index of VPP PHY SW interface
68 @param host_if_name - host tap interface name
69 @param host_if_type - the type of host interface to create (tun, tap)
70 @param namespace - optional tap namespace; namespace[0] == 0 iff none
72 autoreply autoendian define lcp_itf_pair_add_del
77 vl_api_interface_index_t sw_if_index;
78 string host_if_name[16]; /* IFNAMSIZ */
79 vl_api_lcp_itf_host_type_t host_if_type;
80 string namespace[32]; /* LCP_NS_LEN */
82 autoendian define lcp_itf_pair_add_del_v2
87 vl_api_interface_index_t sw_if_index;
88 string host_if_name[16]; /* IFNAMSIZ */
89 vl_api_lcp_itf_host_type_t host_if_type;
90 string namespace[32]; /* LCP_NS_LEN */
92 define lcp_itf_pair_add_del_v2_reply
96 vl_api_interface_index_t host_sw_if_index;
99 /** \brief Dump Linux Control Plane interface pair data
100 @param client_index - opaque cookie to identify the sender
101 @param context - sender context, to match reply w/ request
102 @param sw_if_index - interface to use as filter (~0 == "all")
104 define lcp_itf_pair_get
110 define lcp_itf_pair_get_reply
117 /** \brief Linux Control Plane interface pair dump response
118 @param context - sender context which was passed in the request
119 @param phy_sw_if_index - VPP's sw_if_index for the PHY
120 @param host_sw_if_index - VPP's sw_if_index for the host tap
121 @param vif_index - tap linux index
122 @param host_if_name - host interface name
123 @param host_if_type - host interface type (tun, tap)
124 @param namespace - host interface namespace
126 autoendian define lcp_itf_pair_details
129 vl_api_interface_index_t phy_sw_if_index;
130 vl_api_interface_index_t host_sw_if_index;
132 string host_if_name[16]; /* IFNAMSIZ */
133 vl_api_lcp_itf_host_type_t host_if_type;
134 string namespace[32]; /* LCP_NS_LEN */
138 rpc lcp_itf_pair_get returns lcp_itf_pair_get_reply
139 stream lcp_itf_pair_details;
142 /** \brief Replace end/begin
144 autoreply define lcp_itf_pair_replace_begin
149 autoreply define lcp_itf_pair_replace_end
156 * Linux-CP Error counters/messages
163 description "ARP packets processed";
169 description "ARP replies copied to host";
174 "/err/linux-cp-arp-phy" "linuxcp";
175 "/err/linux-cp-arp-host" "linuxcp";
180 * eval: (c-set-style "gnu")