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