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