http: ignore http_proxy env in tests
[vpp.git] / src / plugins / linux-cp / lcp.api
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Linux Control Plane API
4  *
5  * Copyright 2020 Rubicon Communications, LLC.
6  *
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:
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  */
19
20 option version = "1.0.0";
21
22 import "vnet/interface_types.api";
23
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
28 */
29 autoreply define lcp_default_ns_set
30 {
31   u32 client_index;
32   u32 context;
33   string netns[32];             /* LCP_NS_LEN */
34   option in_progress;
35 };
36
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
40 */
41 define lcp_default_ns_get
42 {
43   u32 client_index;
44   u32 context;
45 };
46
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
51 */
52 define lcp_default_ns_get_reply
53 {
54   u32 context;
55   string netns[32];             /* LCP_NS_LEN */
56   option in_progress;
57 };
58
59 enum lcp_itf_host_type : u8
60 {
61   LCP_API_ITF_HOST_TAP = 0,
62   LCP_API_ITF_HOST_TUN = 1,
63 };
64
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
73 */
74 autoreply autoendian define lcp_itf_pair_add_del
75 {
76   option deprecated;
77
78   u32 client_index;
79   u32 context;
80   bool is_add;
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 */
85 };
86 autoendian define lcp_itf_pair_add_del_v2
87 {
88   option in_progress;
89
90   u32 client_index;
91   u32 context;
92   bool is_add;
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 */
97 };
98 define lcp_itf_pair_add_del_v2_reply
99 {
100   option in_progress;
101
102   u32 context;
103   i32 retval;
104   vl_api_interface_index_t host_sw_if_index;
105 };
106 autoendian define lcp_itf_pair_add_del_v3
107 {
108   option in_progress;
109
110   u32 client_index;
111   u32 context;
112   bool is_add;
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 */
117 };
118 define lcp_itf_pair_add_del_v3_reply
119 {
120   option in_progress;
121
122   u32 context;
123   i32 retval;
124   u32 vif_index;
125   vl_api_interface_index_t host_sw_if_index;
126 };
127
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")
132 */
133 autoendian define lcp_itf_pair_get
134 {
135   u32 client_index;
136   u32 context;
137   u32 cursor;
138 };
139 autoendian define lcp_itf_pair_get_reply
140 {
141   u32 context;
142   i32 retval;
143   u32 cursor;
144 };
145 autoendian define lcp_itf_pair_get_v2
146 {
147   u32 client_index;
148   u32 context;
149   u32 cursor;
150   vl_api_interface_index_t sw_if_index;
151 };
152 autoendian define lcp_itf_pair_get_v2_reply
153 {
154   u32 context;
155   i32 retval;
156   u32 cursor;
157 };
158
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
167 */
168 autoendian define lcp_itf_pair_details
169 {
170   u32 context;
171   vl_api_interface_index_t phy_sw_if_index;
172   vl_api_interface_index_t host_sw_if_index;
173   u32 vif_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 */
177   option in_progress;
178 };
179
180 service {
181   rpc lcp_itf_pair_get returns lcp_itf_pair_get_reply
182     stream lcp_itf_pair_details;
183 };
184
185 service {
186   rpc lcp_itf_pair_get_v2 returns lcp_itf_pair_get_v2_reply
187     stream lcp_itf_pair_details;
188 };
189
190 /** \brief Replace end/begin
191  */
192 autoreply define lcp_itf_pair_replace_begin
193 {
194   u32 client_index;
195   u32 context;
196 };
197 autoreply define lcp_itf_pair_replace_end
198 {
199   u32 client_index;
200   u32 context;
201 };
202
203 /*
204  * Linux-CP Error counters/messages
205  */
206 counters linuxcp {
207   packets {
208     severity info;
209     type counter64;
210     units "packets";
211     description "ARP packets processed";
212   };
213   copies {
214     severity info;
215     type counter64;
216     units "packets";
217     description "ARP replies copied to host";
218   };
219 };
220
221 paths {
222   "/err/linux-cp-arp-phy" "linuxcp";
223   "/err/linux-cp-arp-host" "linuxcp";
224 };
225
226 /*
227  * Local Variables:
228  * eval: (c-set-style "gnu")
229  * End:
230  */