2cdcfad3fc82a4812effb8da2e33d6fef222289e
[vpp.git] / src / vnet / bfd / bfd.api
1 /*
2  * Copyright (c) 2015-2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 /** \brief Set BFD echo source
17     @param client_index - opaque cookie to identify the sender
18     @param context - sender context, to match reply w/ request
19     @param sw_if_index - interface to use as echo source
20 */
21 define bfd_udp_set_echo_source
22 {
23   u32 client_index;
24   u32 context;
25   u32 sw_if_index;
26 };
27
28 /** \brief Set BFD feature response
29     @param context - sender context, to match reply w/ request
30     @param retval - return code for the request
31 */
32 define bfd_udp_set_echo_source_reply
33 {
34   u32 context;
35   i32 retval;
36 };
37
38 /** \brief Delete BFD echo source
39     @param client_index - opaque cookie to identify the sender
40     @param context - sender context, to match reply w/ request
41 */
42 define bfd_udp_del_echo_source
43 {
44   u32 client_index;
45   u32 context;
46 };
47
48 /** \brief Delete BFD echo source response
49     @param context - sender context, to match reply w/ request
50     @param retval - return code for the request
51 */
52 define bfd_udp_del_echo_source_reply
53 {
54   u32 context;
55   i32 retval;
56 };
57
58 /** \brief Add UDP BFD session on interface
59     @param client_index - opaque cookie to identify the sender
60     @param context - sender context, to match reply w/ request
61     @param sw_if_index - sw index of the interface
62     @param desired_min_tx - desired min transmit interval (microseconds)
63     @param required_min_rx - required min receive interval (microseconds)
64     @param local_addr - local address
65     @param peer_addr - peer address
66     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
67     @param detect_mult - detect multiplier (# of packets missed before connection goes down)
68     @param is_authenticated - non-zero if authentication is required
69     @param bfd_key_id - key id sent out in BFD packets (if is_authenticated)
70     @param conf_key_id - id of already configured key (if is_authenticated)
71 */
72 define bfd_udp_add
73 {
74   u32 client_index;
75   u32 context;
76   u32 sw_if_index;
77   u32 desired_min_tx;
78   u32 required_min_rx;
79   u8 local_addr[16];
80   u8 peer_addr[16];
81   u8 is_ipv6;
82   u8 detect_mult;
83   u8 is_authenticated;
84   u8 bfd_key_id;
85   u32 conf_key_id;
86 };
87
88 /** \brief Add UDP BFD session response
89     @param context - sender context, to match reply w/ request
90     @param retval - return code for the request
91 */
92 define bfd_udp_add_reply
93 {
94   u32 context;
95   i32 retval;
96 };
97
98 /** \brief Modify UDP BFD session on interface
99     @param client_index - opaque cookie to identify the sender
100     @param context - sender context, to match reply w/ request
101     @param sw_if_index - sw index of the interface
102     @param desired_min_tx - desired min transmit interval (microseconds)
103     @param required_min_rx - required min receive interval (microseconds)
104     @param local_addr - local address
105     @param peer_addr - peer address
106     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
107     @param detect_mult - detect multiplier (# of packets missed before connection goes down)
108 */
109 define bfd_udp_mod
110 {
111   u32 client_index;
112   u32 context;
113   u32 sw_if_index;
114   u32 desired_min_tx;
115   u32 required_min_rx;
116   u8 local_addr[16];
117   u8 peer_addr[16];
118   u8 is_ipv6;
119   u8 detect_mult;
120 };
121
122 /** \brief Modify UDP BFD session response
123     @param context - sender context, to match reply w/ request
124     @param retval - return code for the request
125 */
126 define bfd_udp_mod_reply
127 {
128   u32 context;
129   i32 retval;
130 };
131
132 /** \brief Delete UDP BFD session on interface
133     @param client_index - opaque cookie to identify the sender
134     @param context - sender context, to match reply w/ request
135     @param sw_if_index - sw index of the interface
136     @param local_addr - local address
137     @param peer_addr - peer address
138     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
139 */
140 define bfd_udp_del
141 {
142   u32 client_index;
143   u32 context;
144   u32 sw_if_index;
145   u8 local_addr[16];
146   u8 peer_addr[16];
147   u8 is_ipv6;
148 };
149
150 /** \brief Delete UDP BFD session response
151     @param context - sender context, to match reply w/ request
152     @param retval - return code for the request
153 */
154 define bfd_udp_del_reply
155 {
156   u32 context;
157   i32 retval;
158 };
159
160 /** \brief Get all BFD sessions
161     @param client_index - opaque cookie to identify the sender
162     @param context - sender context, to match reply w/ request
163 */
164 define bfd_udp_session_dump
165 {
166   u32 client_index;
167   u32 context;
168 };
169
170 /** \brief BFD session details structure
171     @param context - sender context, to match reply w/ request
172     @param sw_if_index - sw index of the interface
173     @param local_addr - local address
174     @param peer_addr - peer address
175     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
176     @param state - session state
177     @param is_authenticated - non-zero if authentication in-use, zero otherwise
178     @param bfd_key_id - ID of key currently in-use if auth is on
179     @param conf_key_id - configured key ID for this session
180     @param required_min_rx - required min receive interval (microseconds)
181     @param desired_min_tx - desired min transmit interval (microseconds)
182     @param detect_mult - detect multiplier (# of packets missed before connection goes down)
183 */
184 define bfd_udp_session_details
185 {
186   u32 context;
187   u32 sw_if_index;
188   u8 local_addr[16];
189   u8 peer_addr[16];
190   u8 is_ipv6;
191   u8 state;
192   u8 is_authenticated;
193   u8 bfd_key_id;
194   u32 conf_key_id;
195   u32 required_min_rx;
196   u32 desired_min_tx;
197   u8 detect_mult;
198 };
199
200 /** \brief Set flags of BFD UDP session
201     @param client_index - opaque cookie to identify the sender
202     @param context - sender context, to match reply w/ request
203     @param sw_if_index - sw index of the interface
204     @param local_addr - local address
205     @param peer_addr - peer address
206     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
207     @param admin_up_down - set the admin state, 1 = up, 0 = down
208 */
209 define bfd_udp_session_set_flags
210 {
211   u32 client_index;
212   u32 context;
213   u32 sw_if_index;
214   u8 local_addr[16];
215   u8 peer_addr[16];
216   u8 is_ipv6;
217   u8 admin_up_down;
218 };
219
220 /** \brief Reply to bfd_udp_session_set_flags
221     @param context - sender context which was passed in the request
222     @param retval - return code of the set flags request
223 */
224 define bfd_udp_session_set_flags_reply
225 {
226   u32 context;
227   i32 retval;
228 };
229
230 /** \brief Register for BFD events
231     @param client_index - opaque cookie to identify the sender
232     @param context - sender context, to match reply w/ request
233     @param enable_disable - 1 => register for events, 0 => cancel registration
234     @param pid - sender's pid
235 */
236 define want_bfd_events
237 {
238   u32 client_index;
239   u32 context;
240   u32 enable_disable;
241   u32 pid;
242 };
243
244 /** \brief Reply for BFD events registration
245     @param context - returned sender context, to match reply w/ request
246     @param retval - return code
247 */
248 define want_bfd_events_reply
249 {
250   u32 context;
251   i32 retval;
252 };
253
254 /** \brief BFD UDP - add/replace key to configuration
255     @param client_index - opaque cookie to identify the sender
256     @param context - sender context, to match reply w/ request
257     @param conf_key_id - key ID to add/replace/delete
258     @param key_len - length of key (must be non-zero)
259     @param auth_type - authentication type (RFC 5880/4.1/Auth Type)
260     @param key - key data
261 */
262 define bfd_auth_set_key
263 {
264   u32 client_index;
265   u32 context;
266   u32 conf_key_id;
267   u8 key_len;
268   u8 auth_type;
269   u8 key[20];
270 };
271
272 /** \brief BFD UDP - add/replace key reply
273     @param context - returned sender context, to match reply w/ request
274     @param retval - return code
275 */
276 define bfd_auth_set_key_reply
277 {
278   u32 context;
279   i32 retval;
280 };
281
282 /** \brief BFD UDP - delete key from configuration
283     @param client_index - opaque cookie to identify the sender
284     @param context - sender context, to match reply w/ request
285     @param conf_key_id - key ID to add/replace/delete
286     @param key_len - length of key (must be non-zero)
287     @param key - key data
288 */
289 define bfd_auth_del_key
290 {
291   u32 client_index;
292   u32 context;
293   u32 conf_key_id;
294 };
295
296 /** \brief BFD UDP - delete key reply
297     @param context - returned sender context, to match reply w/ request
298     @param retval - return code
299 */
300 define bfd_auth_del_key_reply
301 {
302   u32 context;
303   i32 retval;
304 };
305
306 /** \brief Get a list of configured authentication keys
307     @param client_index - opaque cookie to identify the sender
308     @param context - sender context, to match reply w/ request
309 */
310 define bfd_auth_keys_dump
311 {
312   u32 client_index;
313   u32 context;
314 };
315
316 /** \brief BFD authentication key details
317     @param context - sender context, to match reply w/ request
318     @param conf_key_id - configured key ID
319     @param use_count - how many BFD sessions currently use this key
320     @param auth_type - authentication type (RFC 5880/4.1/Auth Type)
321 */
322 define bfd_auth_keys_details
323 {
324   u32 context;
325   u32 conf_key_id;
326   u32 use_count;
327   u8 auth_type;
328 };
329
330 /** \brief BFD UDP - activate/change authentication
331     @param client_index - opaque cookie to identify the sender
332     @param context - sender context, to match reply w/ request
333     @param sw_if_index - sw index of the interface
334     @param local_addr - local address
335     @param peer_addr - peer address
336     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
337     @param is_delayed - change is applied once peer applies the change (on first received packet with this auth)
338     @param bfd_key_id - key id sent out in BFD packets
339     @param conf_key_id - id of already configured key
340 */
341 define bfd_udp_auth_activate
342 {
343   u32 client_index;
344   u32 context;
345   u32 sw_if_index;
346   u8 local_addr[16];
347   u8 peer_addr[16];
348   u8 is_ipv6;
349   u8 is_delayed;
350   u8 bfd_key_id;
351   u32 conf_key_id;
352 };
353
354 /** \brief BFD UDP - activate/change authentication reply
355     @param context - returned sender context, to match reply w/ request
356     @param retval - return code
357 */
358 define bfd_udp_auth_activate_reply
359 {
360   u32 context;
361   i32 retval;
362 };
363
364 /** \brief BFD UDP - deactivate authentication
365     @param client_index - opaque cookie to identify the sender
366     @param context - sender context, to match reply w/ request
367     @param sw_if_index - sw index of the interface
368     @param local_addr - local address
369     @param peer_addr - peer address
370     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
371     @param is_delayed - change is applied once peer applies the change (on first received non-authenticated packet)
372 */
373 define bfd_udp_auth_deactivate
374 {
375   u32 client_index;
376   u32 context;
377   u32 sw_if_index;
378   u8 local_addr[16];
379   u8 peer_addr[16];
380   u8 is_ipv6;
381   u8 is_delayed;
382 };
383
384 /** \brief BFD UDP - deactivate authentication reply
385     @param context - returned sender context, to match reply w/ request
386     @param retval - return code
387 */
388 define bfd_udp_auth_deactivate_reply
389 {
390   u32 context;
391   i32 retval;
392 };
393
394 /*
395  * Local Variables:
396  * eval: (c-set-style "gnu")
397  * End:
398  */