GBP Endpoint Learning
[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 typedef gbp_bridge_domain
23 {
24   u32 bd_id;
25   u32 bvi_sw_if_index;
26   u32 uu_fwd_sw_if_index;
27 };
28
29 autoreply define gbp_bridge_domain_add
30 {
31   u32 client_index;
32   u32 context;
33   vl_api_gbp_bridge_domain_t bd;
34 };
35 autoreply define gbp_bridge_domain_del
36 {
37   u32 client_index;
38   u32 context;
39   u32 bd_id;
40 };
41 autoreply define gbp_bridge_domain_dump
42 {
43   u32 client_index;
44   u32 context;
45 };
46 define gbp_bridge_domain_details
47 {
48   u32 context;
49   vl_api_gbp_bridge_domain_t bd;
50 };
51
52 typedef gbp_route_domain
53 {
54   u32 rd_id;
55   u32 ip4_table_id;
56   u32 ip6_table_id;
57   u32 ip4_uu_sw_if_index;
58   u32 ip6_uu_sw_if_index;
59 };
60
61 autoreply define gbp_route_domain_add
62 {
63   u32 client_index;
64   u32 context;
65   vl_api_gbp_route_domain_t rd;
66 };
67 autoreply define gbp_route_domain_del
68 {
69   u32 client_index;
70   u32 context;
71   u32 rd_id;
72 };
73 autoreply define gbp_route_domain_dump
74 {
75   u32 client_index;
76   u32 context;
77 };
78 define gbp_route_domain_details
79 {
80   u32 context;
81   vl_api_gbp_route_domain_t rd;
82 };
83
84 /** \brief Endpoint
85     @param client_index - opaque cookie to identify the sender
86     @param context - sender context, to match reply w/ request
87 */
88
89 enum gbp_endpoint_flags
90 {
91   NONE = 0,
92   BOUNCE = 0x1,
93   REMOTE = 0x2,
94   LEARNT = 0x4,
95   /* hey Ole WTF */
96   REMOTE_LEARNT = 0x6,
97 };
98
99 typedef gbp_endpoint_tun
100 {
101   vl_api_address_t src;
102   vl_api_address_t dst;
103 };
104
105 typedef gbp_endpoint
106 {
107   u32 sw_if_index;
108   u16 epg_id;
109   vl_api_gbp_endpoint_flags_t flags;
110   vl_api_mac_address_t mac;
111   vl_api_gbp_endpoint_tun_t tun;
112   u8 n_ips;
113   vl_api_address_t ips[n_ips];
114 };
115
116 define gbp_endpoint_add
117 {
118   u32 client_index;
119   u32 context;
120   vl_api_gbp_endpoint_t endpoint;
121 };
122
123 define gbp_endpoint_add_reply
124 {
125   u32 context;
126   i32 retval;
127   u32 handle;
128 };
129
130 autoreply define gbp_endpoint_del
131 {
132   u32 client_index;
133   u32 context;
134   u32 handle;
135 };
136
137 define gbp_endpoint_dump
138 {
139   u32 client_index;
140   u32 context;
141 };
142
143 define gbp_endpoint_details
144 {
145   u32 context;
146   f64 age;
147   u32 handle;
148   vl_api_gbp_endpoint_t endpoint;
149 };
150
151 typeonly define gbp_endpoint_group
152 {
153   u16 epg_id;
154   u32 bd_id;
155   u32 rd_id;
156   u32 uplink_sw_if_index;
157 };
158
159 autoreply define gbp_endpoint_group_add
160 {
161   u32 client_index;
162   u32 context;
163   vl_api_gbp_endpoint_group_t epg;
164 };
165 autoreply define gbp_endpoint_group_del
166 {
167   u32 client_index;
168   u32 context;
169   u16 epg_id;
170 };
171
172 define gbp_endpoint_group_dump
173 {
174   u32 client_index;
175   u32 context;
176 };
177
178 define gbp_endpoint_group_details
179 {
180   u32 context;
181   vl_api_gbp_endpoint_group_t epg;
182 };
183
184 typeonly define gbp_recirc
185 {
186   u32 sw_if_index;
187   u16 epg_id;
188   u8  is_ext;
189 };
190
191 autoreply define gbp_recirc_add_del
192 {
193   u32 client_index;
194   u32 context;
195   u8  is_add;
196   vl_api_gbp_recirc_t recirc;
197 };
198
199 define gbp_recirc_dump
200 {
201   u32 client_index;
202   u32 context;
203 };
204
205 define gbp_recirc_details
206 {
207   u32 context;
208   vl_api_gbp_recirc_t recirc;
209 };
210
211 enum gbp_subnet_type
212 {
213   GBP_API_SUBNET_TRANSPORT,
214   GBP_API_SUBNET_STITCHED_INTERNAL,
215   GBP_API_SUBNET_STITCHED_EXTERNAL,
216 };
217
218 typeonly define gbp_subnet
219 {
220   u32 rd_id;
221   u32 sw_if_index;
222   u16 epg_id;
223   vl_api_gbp_subnet_type_t type;
224   vl_api_prefix_t prefix;
225 };
226
227 autoreply define gbp_subnet_add_del
228 {
229   u32 client_index;
230   u32 context;
231   u8  is_add;
232   vl_api_gbp_subnet_t subnet;
233 };
234
235 define gbp_subnet_dump
236 {
237   u32 client_index;
238   u32 context;
239 };
240
241 define gbp_subnet_details
242 {
243   u32 context;
244   vl_api_gbp_subnet_t subnet;
245 };
246
247 typeonly define gbp_contract
248 {
249   u16 src_epg;
250   u16 dst_epg;
251   u32 acl_index;
252 };
253
254 autoreply define gbp_contract_add_del
255 {
256   u32 client_index;
257   u32 context;
258   u8  is_add;
259   vl_api_gbp_contract_t contract;
260 };
261
262 define gbp_contract_dump
263 {
264   u32 client_index;
265   u32 context;
266 };
267
268 define gbp_contract_details
269 {
270   u32 context;
271   vl_api_gbp_contract_t contract;
272 };
273
274 /**
275  * @brief Set the time throeshold after which an endpoint is
276           considered inative and is aged/reaped by the scanner
277  * @param threshold In seconds
278  */
279 autoreply define gbp_endpoint_learn_set_inactive_threshold
280 {
281   u32 client_index;
282   u32 context;
283   u32 threshold;
284 };
285
286 /**
287  * @brief Configure a 'base' tunnel from which learned tunnels
288  *        are permitted to derive
289  *        A base tunnel consists only of the VNI, any src,dst IP
290  *        pair is thus allowed.
291  */
292 enum gbp_vxlan_tunnel_mode
293 {
294   GBP_VXLAN_TUNNEL_MODE_L2,
295   GBP_VXLAN_TUNNEL_MODE_L3,
296 };
297
298 typedef gbp_vxlan_tunnel
299 {
300   u32 vni;
301   vl_api_gbp_vxlan_tunnel_mode_t mode;
302   u32 bd_rd_id;
303 };
304
305 define gbp_vxlan_tunnel_add
306 {
307   u32 client_index;
308   u32 context;
309   vl_api_gbp_vxlan_tunnel_t tunnel;
310 };
311
312 define gbp_vxlan_tunnel_add_reply
313 {
314   u32 context;
315   i32 retval;
316   u32 sw_if_index;
317 };
318
319 autoreply define gbp_vxlan_tunnel_del
320 {
321   u32 client_index;
322   u32 context;
323   u32 vni;
324 };
325
326 define gbp_vxlan_tunnel_dump
327 {
328   u32 client_index;
329   u32 context;
330 };
331
332 define gbp_vxlan_tunnel_details
333 {
334   u32 context;
335   vl_api_gbp_vxlan_tunnel_t tunnel;
336 };
337
338 /*
339  * Local Variables:
340  * eval: (c-set-style "gnu")
341  * End:
342  */