BFD: echo function
[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 feature 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 Get BFD configuration
59 */
60 define bfd_get_config
61 {
62   u32 client_index;
63   u32 context;
64 };
65
66 /** \brief Get BFD configuration response
67     @param context - sender context, to match reply w/ request
68     @param retval - return code for the request
69     @param slow_timer - slow timer (seconds)
70     @param min_tx - desired min tx interval
71     @param min_rx - desired min rx interval
72     @param detect_mult - desired detection multiplier
73 */
74 define bfd_get_config_reply
75 {
76   u32 client_index;
77   u32 context;
78   u32 slow_timer;
79   u32 min_tx;
80   u32 min_rx;
81   u8 detect_mult;
82 };
83
84 /** \brief Add UDP BFD session on interface
85     @param client_index - opaque cookie to identify the sender
86     @param context - sender context, to match reply w/ request
87     @param sw_if_index - sw index of the interface
88     @param desired_min_tx - desired min transmit interval (microseconds)
89     @param required_min_rx - required min receive interval (microseconds)
90     @param local_addr - local address
91     @param peer_addr - peer address
92     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
93     @param detect_mult - detect multiplier (# of packets missed before connection goes down)
94     @param is_authenticated - non-zero if authentication is required
95     @param bfd_key_id - key id sent out in BFD packets (if is_authenticated)
96     @param conf_key_id - id of already configured key (if is_authenticated)
97 */
98 define bfd_udp_add
99 {
100   u32 client_index;
101   u32 context;
102   u32 sw_if_index;
103   u32 desired_min_tx;
104   u32 required_min_rx;
105   u8 local_addr[16];
106   u8 peer_addr[16];
107   u8 is_ipv6;
108   u8 detect_mult;
109   u8 is_authenticated;
110   u8 bfd_key_id;
111   u32 conf_key_id;
112 };
113
114 /** \brief Add UDP BFD session response
115     @param context - sender context, to match reply w/ request
116     @param retval - return code for the request
117 */
118 define bfd_udp_add_reply
119 {
120   u32 context;
121   i32 retval;
122 };
123
124 /** \brief Modify UDP BFD session on interface
125     @param client_index - opaque cookie to identify the sender
126     @param context - sender context, to match reply w/ request
127     @param sw_if_index - sw index of the interface
128     @param desired_min_tx - desired min transmit interval (microseconds)
129     @param required_min_rx - required min receive interval (microseconds)
130     @param local_addr - local address
131     @param peer_addr - peer address
132     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
133     @param detect_mult - detect multiplier (# of packets missed before connection goes down)
134 */
135 define bfd_udp_mod
136 {
137   u32 client_index;
138   u32 context;
139   u32 sw_if_index;
140   u32 desired_min_tx;
141   u32 required_min_rx;
142   u8 local_addr[16];
143   u8 peer_addr[16];
144   u8 is_ipv6;
145   u8 detect_mult;
146 };
147
148 /** \brief Modify UDP BFD session response
149     @param context - sender context, to match reply w/ request
150     @param retval - return code for the request
151 */
152 define bfd_udp_mod_reply
153 {
154   u32 context;
155   i32 retval;
156 };
157
158 /** \brief Delete UDP BFD session on interface
159     @param client_index - opaque cookie to identify the sender
160     @param context - sender context, to match reply w/ request
161     @param sw_if_index - sw index of the interface
162     @param local_addr - local address
163     @param peer_addr - peer address
164     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
165 */
166 define bfd_udp_del
167 {
168   u32 client_index;
169   u32 context;
170   u32 sw_if_index;
171   u8 local_addr[16];
172   u8 peer_addr[16];
173   u8 is_ipv6;
174 };
175
176 /** \brief Delete UDP BFD session response
177     @param context - sender context, to match reply w/ request
178     @param retval - return code for the request
179 */
180 define bfd_udp_del_reply
181 {
182   u32 context;
183   i32 retval;
184 };
185
186 /** \brief Get all BFD sessions
187     @param client_index - opaque cookie to identify the sender
188     @param context - sender context, to match reply w/ request
189 */
190 define bfd_udp_session_dump
191 {
192   u32 client_index;
193   u32 context;
194 };
195
196 /** \brief BFD session details structure
197     @param context - sender context, to match reply w/ request
198     @param sw_if_index - sw index of the interface
199     @param local_addr - local address
200     @param peer_addr - peer address
201     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
202     @param state - session state
203     @param is_authenticated - non-zero if authentication in-use, zero otherwise
204     @param bfd_key_id - ID of key currently in-use if auth is on
205     @param conf_key_id - configured key ID for this session
206     @param required_min_rx - required min receive interval (microseconds)
207     @param desired_min_tx - desired min transmit interval (microseconds)
208     @param detect_mult - detect multiplier (# of packets missed before connection goes down)
209 */
210 define bfd_udp_session_details
211 {
212   u32 context;
213   u32 sw_if_index;
214   u8 local_addr[16];
215   u8 peer_addr[16];
216   u8 is_ipv6;
217   u8 state;
218   u8 is_authenticated;
219   u8 bfd_key_id;
220   u32 conf_key_id;
221   u32 required_min_rx;
222   u32 desired_min_tx;
223   u8 detect_mult;
224 };
225
226 /** \brief Set flags of BFD UDP session
227     @param client_index - opaque cookie to identify the sender
228     @param context - sender context, to match reply w/ request
229     @param sw_if_index - sw index of the interface
230     @param local_addr - local address
231     @param peer_addr - peer address
232     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
233     @param admin_up_down - set the admin state, 1 = up, 0 = down
234 */
235 define bfd_udp_session_set_flags
236 {
237   u32 client_index;
238   u32 context;
239   u32 sw_if_index;
240   u8 local_addr[16];
241   u8 peer_addr[16];
242   u8 is_ipv6;
243   u8 admin_up_down;
244 };
245
246 /** \brief Reply to bfd_udp_session_set_flags
247     @param context - sender context which was passed in the request
248     @param retval - return code of the set flags request
249 */
250 define bfd_udp_session_set_flags_reply
251 {
252   u32 context;
253   i32 retval;
254 };
255
256 /** \brief Register for BFD events
257     @param client_index - opaque cookie to identify the sender
258     @param context - sender context, to match reply w/ request
259     @param enable_disable - 1 => register for events, 0 => cancel registration
260     @param pid - sender's pid
261 */
262 define want_bfd_events
263 {
264   u32 client_index;
265   u32 context;
266   u32 enable_disable;
267   u32 pid;
268 };
269
270 /** \brief Reply for BFD events registration
271     @param context - returned sender context, to match reply w/ request
272     @param retval - return code
273 */
274 define want_bfd_events_reply
275 {
276   u32 context;
277   i32 retval;
278 };
279
280 /** \brief BFD UDP - add/replace key to configuration
281     @param client_index - opaque cookie to identify the sender
282     @param context - sender context, to match reply w/ request
283     @param conf_key_id - key ID to add/replace/delete
284     @param key_len - length of key (must be non-zero)
285     @param auth_type - authentication type (RFC 5880/4.1/Auth Type)
286     @param key - key data
287 */
288 define bfd_auth_set_key
289 {
290   u32 client_index;
291   u32 context;
292   u32 conf_key_id;
293   u8 key_len;
294   u8 auth_type;
295   u8 key[20];
296 };
297
298 /** \brief BFD UDP - add/replace key reply
299     @param context - returned sender context, to match reply w/ request
300     @param retval - return code
301 */
302 define bfd_auth_set_key_reply
303 {
304   u32 context;
305   i32 retval;
306 };
307
308 /** \brief BFD UDP - delete key from configuration
309     @param client_index - opaque cookie to identify the sender
310     @param context - sender context, to match reply w/ request
311     @param conf_key_id - key ID to add/replace/delete
312     @param key_len - length of key (must be non-zero)
313     @param key - key data
314 */
315 define bfd_auth_del_key
316 {
317   u32 client_index;
318   u32 context;
319   u32 conf_key_id;
320 };
321
322 /** \brief BFD UDP - delete key reply
323     @param context - returned sender context, to match reply w/ request
324     @param retval - return code
325 */
326 define bfd_auth_del_key_reply
327 {
328   u32 context;
329   i32 retval;
330 };
331
332 /** \brief Get a list of configured authentication keys
333     @param client_index - opaque cookie to identify the sender
334     @param context - sender context, to match reply w/ request
335 */
336 define bfd_auth_keys_dump
337 {
338   u32 client_index;
339   u32 context;
340 };
341
342 /** \brief BFD authentication key details
343     @param context - sender context, to match reply w/ request
344     @param conf_key_id - configured key ID
345     @param use_count - how many BFD sessions currently use this key
346     @param auth_type - authentication type (RFC 5880/4.1/Auth Type)
347 */
348 define bfd_auth_keys_details
349 {
350   u32 context;
351   u32 conf_key_id;
352   u32 use_count;
353   u8 auth_type;
354 };
355
356 /** \brief BFD UDP - activate/change authentication
357     @param client_index - opaque cookie to identify the sender
358     @param context - sender context, to match reply w/ request
359     @param sw_if_index - sw index of the interface
360     @param local_addr - local address
361     @param peer_addr - peer address
362     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
363     @param is_delayed - change is applied once peer applies the change (on first received packet with this auth)
364     @param bfd_key_id - key id sent out in BFD packets
365     @param conf_key_id - id of already configured key
366 */
367 define bfd_udp_auth_activate
368 {
369   u32 client_index;
370   u32 context;
371   u32 sw_if_index;
372   u8 local_addr[16];
373   u8 peer_addr[16];
374   u8 is_ipv6;
375   u8 is_delayed;
376   u8 bfd_key_id;
377   u32 conf_key_id;
378 };
379
380 /** \brief BFD UDP - activate/change authentication reply
381     @param context - returned sender context, to match reply w/ request
382     @param retval - return code
383 */
384 define bfd_udp_auth_activate_reply
385 {
386   u32 context;
387   i32 retval;
388 };
389
390 /** \brief BFD UDP - deactivate authentication
391     @param client_index - opaque cookie to identify the sender
392     @param context - sender context, to match reply w/ request
393     @param sw_if_index - sw index of the interface
394     @param local_addr - local address
395     @param peer_addr - peer address
396     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
397     @param is_delayed - change is applied once peer applies the change (on first received non-authenticated packet)
398 */
399 define bfd_udp_auth_deactivate
400 {
401   u32 client_index;
402   u32 context;
403   u32 sw_if_index;
404   u8 local_addr[16];
405   u8 peer_addr[16];
406   u8 is_ipv6;
407   u8 is_delayed;
408 };
409
410 /** \brief BFD UDP - deactivate authentication reply
411     @param context - returned sender context, to match reply w/ request
412     @param retval - return code
413 */
414 define bfd_udp_auth_deactivate_reply
415 {
416   u32 context;
417   i32 retval;
418 };
419
420 /*
421  * Local Variables:
422  * eval: (c-set-style "gnu")
423  * End:
424  */