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