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 */
37 /** \brief get the default Linux Control Plane namespace
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 namespace
48 @param client_index - opaque cookie to identify the sender
49 @param context - sender context, to match reply w/ request
50 @param namespace - the default namespace; namespace[0] == 0 iff none
52 define lcp_default_ns_get_reply
55 string namespace[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 namespace - optional tap namespace; namespace[0] == 0 iff none
74 autoreply autoendian define lcp_itf_pair_add_del
79 vl_api_interface_index_t sw_if_index;
80 string host_if_name[16]; /* IFNAMSIZ */
81 vl_api_lcp_itf_host_type_t host_if_type;
82 string namespace[32]; /* LCP_NS_LEN */
85 autoendian define lcp_itf_pair_add_del_v2
90 vl_api_interface_index_t sw_if_index;
91 string host_if_name[16]; /* IFNAMSIZ */
92 vl_api_lcp_itf_host_type_t host_if_type;
93 string namespace[32]; /* LCP_NS_LEN */
96 define lcp_itf_pair_add_del_v2_reply
100 vl_api_interface_index_t host_sw_if_index;
103 /** \brief Dump Linux Control Plane interface pair data
104 @param client_index - opaque cookie to identify the sender
105 @param context - sender context, to match reply w/ request
106 @param sw_if_index - interface to use as filter (~0 == "all")
108 define lcp_itf_pair_get
114 define lcp_itf_pair_get_reply
121 /** \brief Linux Control Plane interface pair dump response
122 @param context - sender context which was passed in the request
123 @param phy_sw_if_index - VPP's sw_if_index for the PHY
124 @param host_sw_if_index - VPP's sw_if_index for the host tap
125 @param vif_index - tap linux index
126 @param host_if_name - host interface name
127 @param host_if_type - host interface type (tun, tap)
128 @param namespace - host interface namespace
130 autoendian define lcp_itf_pair_details
133 vl_api_interface_index_t phy_sw_if_index;
134 vl_api_interface_index_t host_sw_if_index;
136 string host_if_name[16]; /* IFNAMSIZ */
137 vl_api_lcp_itf_host_type_t host_if_type;
138 string namespace[32]; /* LCP_NS_LEN */
143 rpc lcp_itf_pair_get returns lcp_itf_pair_get_reply
144 stream lcp_itf_pair_details;
147 /** \brief Replace end/begin
149 autoreply define lcp_itf_pair_replace_begin
154 autoreply define lcp_itf_pair_replace_end
161 * Linux-CP Error counters/messages
168 description "ARP packets processed";
174 description "ARP replies copied to host";
179 "/err/linux-cp-arp-phy" "linuxcp";
180 "/err/linux-cp-arp-host" "linuxcp";
185 * eval: (c-set-style "gnu")