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