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 netns
25 @param client_index - opaque cookie to identify the sender
26 @param context - sender context, to match reply w/ request
27 @param netns - the new default netns; netns[0] == 0 if none
29 autoreply define lcp_default_ns_set
33 string netns[32]; /* LCP_NS_LEN */
37 /** \brief get the default Linux Control Plane netns
38 @param client_index - opaque cookie to identify the sender
39 @param context - sender context, to match reply w/ request
41 define lcp_default_ns_get
47 /** \brief get the default Linux Control Plane netns
48 @param client_index - opaque cookie to identify the sender
49 @param context - sender context, to match reply w/ request
50 @param netns - the default netns; netns[0] == 0 if none
52 define lcp_default_ns_get_reply
55 string netns[32]; /* LCP_NS_LEN */
59 enum lcp_itf_host_type : u8
61 LCP_API_ITF_HOST_TAP = 0,
62 LCP_API_ITF_HOST_TUN = 1,
65 /** \brief Add or delete a Linux Conrol Plane interface pair
66 @param client_index - opaque cookie to identify the sender
67 @param context - sender context, to match reply w/ request
68 @param is_add - 0 if deleting, != 0 if adding
69 @param sw_if_index - index of VPP PHY SW interface
70 @param host_if_name - host tap interface name
71 @param host_if_type - the type of host interface to create (tun, tap)
72 @param netns - optional tap netns; netns[0] == 0 if none
74 autoreply autoendian define lcp_itf_pair_add_del
81 vl_api_interface_index_t sw_if_index;
82 string host_if_name[16]; /* IFNAMSIZ */
83 vl_api_lcp_itf_host_type_t host_if_type;
84 string netns[32]; /* LCP_NS_LEN */
86 autoendian define lcp_itf_pair_add_del_v2
93 vl_api_interface_index_t sw_if_index;
94 string host_if_name[16]; /* IFNAMSIZ */
95 vl_api_lcp_itf_host_type_t host_if_type;
96 string netns[32]; /* LCP_NS_LEN */
98 define lcp_itf_pair_add_del_v2_reply
104 vl_api_interface_index_t host_sw_if_index;
106 autoendian define lcp_itf_pair_add_del_v3
113 vl_api_interface_index_t sw_if_index;
114 string host_if_name[16]; /* IFNAMSIZ */
115 vl_api_lcp_itf_host_type_t host_if_type;
116 string netns[32]; /* LCP_NS_LEN */
118 define lcp_itf_pair_add_del_v3_reply
125 vl_api_interface_index_t host_sw_if_index;
128 /** \brief Dump Linux Control Plane interface pair data
129 @param client_index - opaque cookie to identify the sender
130 @param context - sender context, to match reply w/ request
131 @param sw_if_index - interface to use as filter (~0 == "all")
133 autoendian define lcp_itf_pair_get
139 autoendian define lcp_itf_pair_get_reply
145 autoendian define lcp_itf_pair_get_v2
150 vl_api_interface_index_t sw_if_index;
152 autoendian define lcp_itf_pair_get_v2_reply
159 /** \brief Linux Control Plane interface pair dump response
160 @param context - sender context which was passed in the request
161 @param phy_sw_if_index - VPP's sw_if_index for the PHY
162 @param host_sw_if_index - VPP's sw_if_index for the host tap
163 @param vif_index - tap linux index
164 @param host_if_name - host interface name
165 @param host_if_type - host interface type (tun, tap)
166 @param netns - host interface netns
168 autoendian define lcp_itf_pair_details
171 vl_api_interface_index_t phy_sw_if_index;
172 vl_api_interface_index_t host_sw_if_index;
174 string host_if_name[16]; /* IFNAMSIZ */
175 vl_api_lcp_itf_host_type_t host_if_type;
176 string netns[32]; /* LCP_NS_LEN */
181 rpc lcp_itf_pair_get returns lcp_itf_pair_get_reply
182 stream lcp_itf_pair_details;
186 rpc lcp_itf_pair_get_v2 returns lcp_itf_pair_get_v2_reply
187 stream lcp_itf_pair_details;
190 /** \brief Replace end/begin
192 autoreply define lcp_itf_pair_replace_begin
197 autoreply define lcp_itf_pair_replace_end
204 * Linux-CP Error counters/messages
211 description "ARP packets processed";
217 description "ARP replies copied to host";
222 "/err/linux-cp-arp-phy" "linuxcp";
223 "/err/linux-cp-arp-host" "linuxcp";
228 * eval: (c-set-style "gnu")