gbp: update gbp-ext-itf API
[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   GBP_API_SUBNET_ANON_L3_OUT,
239 };
240
241 typeonly define gbp_subnet
242 {
243   u32 rd_id;
244   u32 sw_if_index;
245   u16 sclass;
246   vl_api_gbp_subnet_type_t type;
247   vl_api_prefix_t prefix;
248 };
249
250 manual_print autoreply define gbp_subnet_add_del
251 {
252   u32 client_index;
253   u32 context;
254   u8  is_add;
255   vl_api_gbp_subnet_t subnet;
256 };
257
258 define gbp_subnet_dump
259 {
260   u32 client_index;
261   u32 context;
262 };
263
264 define gbp_subnet_details
265 {
266   u32 context;
267   vl_api_gbp_subnet_t subnet;
268 };
269
270 typedef gbp_next_hop
271 {
272   vl_api_address_t ip;
273   vl_api_mac_address_t mac;
274   u32 bd_id;
275   u32 rd_id;
276 };
277
278 enum gbp_hash_mode
279 {
280   GBP_API_HASH_MODE_SRC_IP,
281   GBP_API_HASH_MODE_DST_IP,
282   GBP_API_HASH_MODE_SYMMETRIC,
283 };
284
285 typedef gbp_next_hop_set
286 {
287   vl_api_gbp_hash_mode_t hash_mode;
288   u8 n_nhs;
289   vl_api_gbp_next_hop_t nhs[8];
290 };
291
292 enum gbp_rule_action
293 {
294   GBP_API_RULE_PERMIT,
295   GBP_API_RULE_DENY,
296   GBP_API_RULE_REDIRECT,
297 };
298
299 typedef gbp_rule
300 {
301   vl_api_gbp_rule_action_t action;
302   vl_api_gbp_next_hop_set_t nh_set;
303 };
304
305 typedef gbp_contract
306 {
307   vl_api_gbp_scope_t scope;
308   u16 sclass;
309   u16 dclass;
310   u32 acl_index;
311   u8 n_ether_types;
312   u16 allowed_ethertypes[16];
313   u8  n_rules;
314   vl_api_gbp_rule_t rules[n_rules];
315 };
316
317 manual_print define gbp_contract_add_del
318 {
319   u32 client_index;
320   u32 context;
321   u8  is_add;
322   vl_api_gbp_contract_t contract;
323 };
324 define gbp_contract_add_del_reply
325 {
326   u32 context;
327   i32 retval;
328   u32 stats_index;
329 };
330
331 define gbp_contract_dump
332 {
333   u32 client_index;
334   u32 context;
335 };
336
337 define gbp_contract_details
338 {
339   u32 context;
340   vl_api_gbp_contract_t contract;
341 };
342
343 /**
344  * @brief Configure a 'base' tunnel from which learned tunnels
345  *        are permitted to derive
346  *        A base tunnel consists only of the VNI, any src,dst IP
347  *        pair is thus allowed.
348  */
349 enum gbp_vxlan_tunnel_mode
350 {
351   GBP_VXLAN_TUNNEL_MODE_L2,
352   GBP_VXLAN_TUNNEL_MODE_L3,
353 };
354
355 typedef gbp_vxlan_tunnel
356 {
357   u32 vni;
358   vl_api_gbp_vxlan_tunnel_mode_t mode;
359   u32 bd_rd_id;
360   vl_api_ip4_address_t src;
361 };
362
363 manual_print define gbp_vxlan_tunnel_add
364 {
365   u32 client_index;
366   u32 context;
367   vl_api_gbp_vxlan_tunnel_t tunnel;
368 };
369
370 define gbp_vxlan_tunnel_add_reply
371 {
372   u32 context;
373   i32 retval;
374   u32 sw_if_index;
375 };
376
377 manual_print autoreply define gbp_vxlan_tunnel_del
378 {
379   u32 client_index;
380   u32 context;
381   u32 vni;
382 };
383
384 define gbp_vxlan_tunnel_dump
385 {
386   u32 client_index;
387   u32 context;
388 };
389
390 define gbp_vxlan_tunnel_details
391 {
392   u32 context;
393   vl_api_gbp_vxlan_tunnel_t tunnel;
394 };
395
396 enum gbp_ext_itf_flags
397 {
398   GBP_API_EXT_ITF_F_NONE = 0,
399   GBP_API_EXT_ITF_F_ANON = 1,
400 };
401
402 typeonly define gbp_ext_itf
403 {
404   u32 sw_if_index;
405   u32 bd_id;
406   u32 rd_id;
407   vl_api_gbp_ext_itf_flags_t flags;
408 };
409
410 manual_print autoreply define gbp_ext_itf_add_del
411 {
412   u32 client_index;
413   u32 context;
414   u8  is_add;
415   vl_api_gbp_ext_itf_t ext_itf;
416 };
417
418 define gbp_ext_itf_dump
419 {
420   u32 client_index;
421   u32 context;
422 };
423
424 define gbp_ext_itf_details
425 {
426   u32 context;
427   vl_api_gbp_ext_itf_t ext_itf;
428 };
429
430 /*
431  * Local Variables:
432  * eval: (c-set-style "gnu")
433  * End:
434  */