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