tests: clean up gbp calls from vpp_papi_provider
[vpp.git] / src / plugins / gbp / gbp.api
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Copyright (c) 2018 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 option version = "2.0.0";
18
19 import "vnet/ip/ip_types.api";
20 import "vnet/ethernet/ethernet_types.api";
21 import "vnet/interface_types.api";
22
23 enum gbp_bridge_domain_flags
24 {
25   GBP_BD_API_FLAG_NONE = 0,
26   GBP_BD_API_FLAG_DO_NOT_LEARN = 1,
27   GBP_BD_API_FLAG_UU_FWD_DROP = 2,
28   GBP_BD_API_FLAG_MCAST_DROP = 4,
29   GBP_BD_API_FLAG_UCAST_ARP = 8,
30 };
31
32 typedef gbp_bridge_domain
33 {
34   u32 bd_id;
35   u32 rd_id;
36   vl_api_gbp_bridge_domain_flags_t flags;
37   vl_api_interface_index_t bvi_sw_if_index;
38   vl_api_interface_index_t uu_fwd_sw_if_index;
39   vl_api_interface_index_t bm_flood_sw_if_index;
40 };
41
42  autoreply define gbp_bridge_domain_add
43 {
44   option status="in_progress";
45   u32 client_index;
46   u32 context;
47   vl_api_gbp_bridge_domain_t bd;
48 };
49  autoreply define gbp_bridge_domain_del
50 {
51   option status="in_progress";
52   u32 client_index;
53   u32 context;
54   u32 bd_id;
55 };
56 autoreply define gbp_bridge_domain_dump
57 {
58   option status="in_progress";
59   u32 client_index;
60   u32 context;
61 };
62 define gbp_bridge_domain_details
63 {
64   option status="in_progress";
65   u32 context;
66   vl_api_gbp_bridge_domain_t bd;
67 };
68
69 typedef u16 gbp_scope;
70
71 typedef gbp_route_domain
72 {
73   u32 rd_id;
74   u32 ip4_table_id;
75   u32 ip6_table_id;
76   vl_api_interface_index_t ip4_uu_sw_if_index;
77   vl_api_interface_index_t ip6_uu_sw_if_index;
78   vl_api_gbp_scope_t scope;
79 };
80
81  autoreply define gbp_route_domain_add
82 {
83   option status="in_progress";
84   u32 client_index;
85   u32 context;
86   vl_api_gbp_route_domain_t rd;
87 };
88  autoreply define gbp_route_domain_del
89 {
90   option status="in_progress";
91   u32 client_index;
92   u32 context;
93   u32 rd_id;
94 };
95 autoreply define gbp_route_domain_dump
96 {
97   option status="in_progress";
98   u32 client_index;
99   u32 context;
100 };
101 define gbp_route_domain_details
102 {
103   option status="in_progress";
104   u32 context;
105   vl_api_gbp_route_domain_t rd;
106 };
107
108 /** \brief Endpoint
109     @param client_index - opaque cookie to identify the sender
110     @param context - sender context, to match reply w/ request
111 */
112
113 enum gbp_endpoint_flags
114 {
115   GBP_API_ENDPOINT_FLAG_NONE = 0,
116   GBP_API_ENDPOINT_FLAG_BOUNCE = 0x1,
117   GBP_API_ENDPOINT_FLAG_REMOTE = 0x2,
118   GBP_API_ENDPOINT_FLAG_LEARNT = 0x4,
119   GBP_API_ENDPOINT_FLAG_EXTERNAL = 0x8,
120 };
121
122 typedef gbp_endpoint_tun
123 {
124   vl_api_address_t src;
125   vl_api_address_t dst;
126 };
127
128 typedef gbp_endpoint
129 {
130   vl_api_interface_index_t sw_if_index;
131   u16 sclass;
132   vl_api_gbp_endpoint_flags_t flags;
133   vl_api_mac_address_t mac;
134   vl_api_gbp_endpoint_tun_t tun;
135   u8 n_ips;
136   vl_api_address_t ips[n_ips];
137 };
138
139  define gbp_endpoint_add
140 {
141   option status="in_progress";
142   u32 client_index;
143   u32 context;
144   vl_api_gbp_endpoint_t endpoint;
145 };
146
147 define gbp_endpoint_add_reply
148 {
149   option status="in_progress";
150   u32 context;
151   i32 retval;
152   u32 handle;
153 };
154
155  autoreply define gbp_endpoint_del
156 {
157   option status="in_progress";
158   u32 client_index;
159   u32 context;
160   u32 handle;
161 };
162
163 define gbp_endpoint_dump
164 {
165   option status="in_progress";
166   u32 client_index;
167   u32 context;
168 };
169
170 define gbp_endpoint_details
171 {
172   option status="in_progress";
173   u32 context;
174   f64 age;
175   u32 handle;
176   vl_api_gbp_endpoint_t endpoint;
177 };
178
179 typedef gbp_endpoint_retention
180 {
181   u32 remote_ep_timeout;
182 };
183
184 typedef gbp_endpoint_group
185 {
186   u32 vnid;
187   u16 sclass;
188   u32 bd_id;
189   u32 rd_id;
190   vl_api_interface_index_t uplink_sw_if_index;
191   vl_api_gbp_endpoint_retention_t retention;
192 };
193
194  autoreply define gbp_endpoint_group_add
195 {
196   option status="in_progress";
197   u32 client_index;
198   u32 context;
199   vl_api_gbp_endpoint_group_t epg;
200 };
201  autoreply define gbp_endpoint_group_del
202 {
203   option status="in_progress";
204   u32 client_index;
205   u32 context;
206   u16 sclass;
207 };
208
209 define gbp_endpoint_group_dump
210 {
211   option status="in_progress";
212   u32 client_index;
213   u32 context;
214 };
215
216 define gbp_endpoint_group_details
217 {
218   option status="in_progress";
219   u32 context;
220   vl_api_gbp_endpoint_group_t epg;
221 };
222
223 typedef gbp_recirc
224 {
225   vl_api_interface_index_t sw_if_index;
226   u16 sclass;
227   bool is_ext;
228 };
229
230  autoreply define gbp_recirc_add_del
231 {
232   option status="in_progress";
233   u32 client_index;
234   u32 context;
235   bool is_add;
236   vl_api_gbp_recirc_t recirc;
237 };
238
239 define gbp_recirc_dump
240 {
241   option status="in_progress";
242   u32 client_index;
243   u32 context;
244 };
245
246 define gbp_recirc_details
247 {
248   option status="in_progress";
249   u32 context;
250   vl_api_gbp_recirc_t recirc;
251 };
252
253 enum gbp_subnet_type
254 {
255   GBP_API_SUBNET_TRANSPORT,
256   GBP_API_SUBNET_STITCHED_INTERNAL,
257   GBP_API_SUBNET_STITCHED_EXTERNAL,
258   GBP_API_SUBNET_L3_OUT,
259   GBP_API_SUBNET_ANON_L3_OUT,
260 };
261
262 typedef gbp_subnet
263 {
264   u32 rd_id;
265   vl_api_interface_index_t sw_if_index [default= 0xffffffff];
266   u16 sclass [default=0xffffffff];
267   vl_api_gbp_subnet_type_t type;
268   vl_api_prefix_t prefix;
269 };
270
271  autoreply define gbp_subnet_add_del
272 {
273   option status="in_progress";
274   u32 client_index;
275   u32 context;
276   bool is_add;
277   vl_api_gbp_subnet_t subnet;
278 };
279
280 define gbp_subnet_dump
281 {
282   option status="in_progress";
283   u32 client_index;
284   u32 context;
285 };
286
287 define gbp_subnet_details
288 {
289   option status="in_progress";
290   u32 context;
291   vl_api_gbp_subnet_t subnet;
292 };
293
294 typedef gbp_next_hop
295 {
296   vl_api_address_t ip;
297   vl_api_mac_address_t mac;
298   u32 bd_id;
299   u32 rd_id;
300 };
301
302 enum gbp_hash_mode
303 {
304   GBP_API_HASH_MODE_SRC_IP,
305   GBP_API_HASH_MODE_DST_IP,
306   GBP_API_HASH_MODE_SYMMETRIC,
307 };
308
309 typedef gbp_next_hop_set
310 {
311   vl_api_gbp_hash_mode_t hash_mode;
312   u8 n_nhs;
313   vl_api_gbp_next_hop_t nhs[8];
314 };
315
316 enum gbp_rule_action
317 {
318   GBP_API_RULE_PERMIT,
319   GBP_API_RULE_DENY,
320   GBP_API_RULE_REDIRECT,
321 };
322
323 typedef gbp_rule
324 {
325   vl_api_gbp_rule_action_t action;
326   vl_api_gbp_next_hop_set_t nh_set;
327 };
328
329 typedef gbp_contract
330 {
331   vl_api_gbp_scope_t scope;
332   u16 sclass;
333   u16 dclass;
334   u32 acl_index;
335   u8 n_ether_types;
336   u16 allowed_ethertypes[16];
337   u8  n_rules;
338   vl_api_gbp_rule_t rules[n_rules];
339 };
340
341  define gbp_contract_add_del
342 {
343   option status="in_progress";
344   u32 client_index;
345   u32 context;
346   bool is_add;
347   vl_api_gbp_contract_t contract;
348 };
349 define gbp_contract_add_del_reply
350 {
351   option status="in_progress";
352   u32 context;
353   i32 retval;
354   u32 stats_index;
355 };
356
357 define gbp_contract_dump
358 {
359   option status="in_progress";
360   u32 client_index;
361   u32 context;
362 };
363
364 define gbp_contract_details
365 {
366   option status="in_progress";
367   u32 context;
368   vl_api_gbp_contract_t contract;
369 };
370
371 /**
372  * @brief Configure a 'base' tunnel from which learned tunnels
373  *        are permitted to derive
374  *        A base tunnel consists only of the VNI, any src,dst IP
375  *        pair is thus allowed.
376  */
377 enum gbp_vxlan_tunnel_mode
378 {
379   GBP_VXLAN_TUNNEL_MODE_L2,
380   GBP_VXLAN_TUNNEL_MODE_L3,
381 };
382
383 typedef gbp_vxlan_tunnel
384 {
385   u32 vni;
386   vl_api_gbp_vxlan_tunnel_mode_t mode;
387   u32 bd_rd_id;
388   vl_api_ip4_address_t src;
389 };
390
391  define gbp_vxlan_tunnel_add
392 {
393   option status="in_progress";
394   u32 client_index;
395   u32 context;
396   vl_api_gbp_vxlan_tunnel_t tunnel;
397 };
398
399 define gbp_vxlan_tunnel_add_reply
400 {
401   option status="in_progress";
402   u32 context;
403   i32 retval;
404   vl_api_interface_index_t sw_if_index;
405 };
406
407  autoreply define gbp_vxlan_tunnel_del
408 {
409   option status="in_progress";
410   u32 client_index;
411   u32 context;
412   u32 vni;
413 };
414
415 define gbp_vxlan_tunnel_dump
416 {
417   option status="in_progress";
418   u32 client_index;
419   u32 context;
420 };
421
422 define gbp_vxlan_tunnel_details
423 {
424   option status="in_progress";
425   u32 context;
426   vl_api_gbp_vxlan_tunnel_t tunnel;
427 };
428
429 enum gbp_ext_itf_flags
430 {
431   GBP_API_EXT_ITF_F_NONE = 0,
432   GBP_API_EXT_ITF_F_ANON = 1,
433 };
434
435 typedef gbp_ext_itf
436 {
437   vl_api_interface_index_t sw_if_index;
438   u32 bd_id;
439   u32 rd_id;
440   vl_api_gbp_ext_itf_flags_t flags;
441 };
442
443  autoreply define gbp_ext_itf_add_del
444 {
445   option status="in_progress";
446   u32 client_index;
447   u32 context;
448   bool is_add;
449   vl_api_gbp_ext_itf_t ext_itf;
450 };
451
452 define gbp_ext_itf_dump
453 {
454   option status="in_progress";
455   u32 client_index;
456   u32 context;
457 };
458
459 define gbp_ext_itf_details
460 {
461   option status="in_progress";
462   u32 context;
463   vl_api_gbp_ext_itf_t ext_itf;
464 };
465
466 /*
467  * Local Variables:
468  * eval: (c-set-style "gnu")
469  * End:
470  */