blob: f53cc7630fd80ece8f5ff8e5450b0e7fd0962d1b [file] [log] [blame]
Pavel Kotucek20d12322016-12-21 09:13:17 +01001/*
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
Jakub Grajciar4682feb2019-09-02 13:28:52 +020016option version = "2.0.0";
17
18import "vnet/interface_types.api";
19import "vnet/ip/ip_types.api";
20
21enum bfd_state {
22 BFD_STATE_API_ADMIN_DOWN = 0,
23 BFD_STATE_API_DOWN = 1,
24 BFD_STATE_API_INIT = 2,
25 BFD_STATE_API_UP = 3,
26};
Dave Barach0d056e52017-09-28 15:11:16 -040027
Klement Sekera239790f2017-02-16 10:53:53 +010028/** \brief Set BFD echo source
Pavel Kotucek20d12322016-12-21 09:13:17 +010029 @param client_index - opaque cookie to identify the sender
30 @param context - sender context, to match reply w/ request
Klement Sekera239790f2017-02-16 10:53:53 +010031 @param sw_if_index - interface to use as echo source
Pavel Kotucek20d12322016-12-21 09:13:17 +010032*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040033autoreply define bfd_udp_set_echo_source
Klement Sekerab17dd962017-01-09 07:43:48 +010034{
Pavel Kotucek20d12322016-12-21 09:13:17 +010035 u32 client_index;
36 u32 context;
Jakub Grajciar4682feb2019-09-02 13:28:52 +020037 vl_api_interface_index_t sw_if_index;
Pavel Kotucek20d12322016-12-21 09:13:17 +010038};
39
Klement Sekera239790f2017-02-16 10:53:53 +010040/** \brief Delete BFD echo source
41 @param client_index - opaque cookie to identify the sender
42 @param context - sender context, to match reply w/ request
43*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040044autoreply define bfd_udp_del_echo_source
Klement Sekera239790f2017-02-16 10:53:53 +010045{
46 u32 client_index;
47 u32 context;
48};
49
Matus Fabian2d3c7b92018-10-02 03:22:18 -070050/** \brief Get BFD echo source
51 @param client_index - opaque cookie to identify the sender
52 @param context - sender context, to match reply w/ request
53*/
54define bfd_udp_get_echo_source
55{
56 u32 client_index;
57 u32 context;
58};
59
60/** \brief Get BFD echo source reply
61 @param context - sender context, to match reply w/ request
62 @param retval - return code
63 @param sw_if_index - interface to use as echo source
64 @param is_set - non-zero if set
65 @param have_usable_ip4 - non-zero if have usable IPv4 address
66 @param ip4_addr - IPv4 address
67 @param have_usable_ip6 - non-zero if have usable IPv6 address
68 @param ip6_addr - IPv6 address
69*/
70define bfd_udp_get_echo_source_reply
71{
72 u32 context;
73 i32 retval;
Jakub Grajciar4682feb2019-09-02 13:28:52 +020074 vl_api_interface_index_t sw_if_index;
75 bool is_set;
76 bool have_usable_ip4;
77 vl_api_ip4_address_t ip4_addr;
78 bool have_usable_ip6;
79 vl_api_ip6_address_t ip6_addr;
Matus Fabian2d3c7b92018-10-02 03:22:18 -070080};
81
Pavel Kotucek20d12322016-12-21 09:13:17 +010082/** \brief Add UDP BFD session on interface
83 @param client_index - opaque cookie to identify the sender
84 @param context - sender context, to match reply w/ request
85 @param sw_if_index - sw index of the interface
86 @param desired_min_tx - desired min transmit interval (microseconds)
87 @param required_min_rx - required min receive interval (microseconds)
Pavel Kotucek20d12322016-12-21 09:13:17 +010088 @param local_addr - local address
89 @param peer_addr - peer address
90 @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
Klement Sekerab17dd962017-01-09 07:43:48 +010091 @param detect_mult - detect multiplier (# of packets missed before connection goes down)
92 @param is_authenticated - non-zero if authentication is required
93 @param bfd_key_id - key id sent out in BFD packets (if is_authenticated)
94 @param conf_key_id - id of already configured key (if is_authenticated)
Pavel Kotucek20d12322016-12-21 09:13:17 +010095*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040096autoreply define bfd_udp_add
Klement Sekerab17dd962017-01-09 07:43:48 +010097{
Pavel Kotucek20d12322016-12-21 09:13:17 +010098 u32 client_index;
99 u32 context;
Jakub Grajciar4682feb2019-09-02 13:28:52 +0200100 vl_api_interface_index_t sw_if_index;
Pavel Kotucek20d12322016-12-21 09:13:17 +0100101 u32 desired_min_tx;
102 u32 required_min_rx;
Jakub Grajciar4682feb2019-09-02 13:28:52 +0200103 vl_api_address_t local_addr;
104 vl_api_address_t peer_addr;
Pavel Kotucek20d12322016-12-21 09:13:17 +0100105 u8 detect_mult;
Jakub Grajciar4682feb2019-09-02 13:28:52 +0200106 bool is_authenticated;
Klement Sekerab17dd962017-01-09 07:43:48 +0100107 u8 bfd_key_id;
108 u32 conf_key_id;
Pavel Kotucek20d12322016-12-21 09:13:17 +0100109};
110
Klement Sekeraa57a9702017-02-02 06:58:07 +0100111/** \brief Modify UDP BFD session on interface
112 @param client_index - opaque cookie to identify the sender
113 @param context - sender context, to match reply w/ request
114 @param sw_if_index - sw index of the interface
115 @param desired_min_tx - desired min transmit interval (microseconds)
116 @param required_min_rx - required min receive interval (microseconds)
117 @param local_addr - local address
118 @param peer_addr - peer address
119 @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
120 @param detect_mult - detect multiplier (# of packets missed before connection goes down)
121*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400122autoreply define bfd_udp_mod
Klement Sekeraa57a9702017-02-02 06:58:07 +0100123{
124 u32 client_index;
125 u32 context;
Jakub Grajciar4682feb2019-09-02 13:28:52 +0200126 vl_api_interface_index_t sw_if_index;
Klement Sekeraa57a9702017-02-02 06:58:07 +0100127 u32 desired_min_tx;
128 u32 required_min_rx;
Jakub Grajciar4682feb2019-09-02 13:28:52 +0200129 vl_api_address_t local_addr;
130 vl_api_address_t peer_addr;
Klement Sekeraa57a9702017-02-02 06:58:07 +0100131 u8 detect_mult;
132};
133
Pavel Kotucek20d12322016-12-21 09:13:17 +0100134/** \brief Delete UDP BFD session on interface
135 @param client_index - opaque cookie to identify the sender
136 @param context - sender context, to match reply w/ request
137 @param sw_if_index - sw index of the interface
138 @param local_addr - local address
139 @param peer_addr - peer address
140 @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
141*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400142autoreply define bfd_udp_del
Klement Sekerab17dd962017-01-09 07:43:48 +0100143{
Pavel Kotucek20d12322016-12-21 09:13:17 +0100144 u32 client_index;
145 u32 context;
Jakub Grajciar4682feb2019-09-02 13:28:52 +0200146 vl_api_interface_index_t sw_if_index;
147 vl_api_address_t local_addr;
148 vl_api_address_t peer_addr;
Pavel Kotucek20d12322016-12-21 09:13:17 +0100149};
150
Pavel Kotucek20d12322016-12-21 09:13:17 +0100151/** \brief Get all BFD sessions
152 @param client_index - opaque cookie to identify the sender
153 @param context - sender context, to match reply w/ request
154*/
Klement Sekerab17dd962017-01-09 07:43:48 +0100155define bfd_udp_session_dump
156{
Pavel Kotucek20d12322016-12-21 09:13:17 +0100157 u32 client_index;
158 u32 context;
159};
160
161/** \brief BFD session details structure
162 @param context - sender context, to match reply w/ request
Pavel Kotucek20d12322016-12-21 09:13:17 +0100163 @param sw_if_index - sw index of the interface
164 @param local_addr - local address
165 @param peer_addr - peer address
166 @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
167 @param state - session state
Klement Sekerab17dd962017-01-09 07:43:48 +0100168 @param is_authenticated - non-zero if authentication in-use, zero otherwise
169 @param bfd_key_id - ID of key currently in-use if auth is on
170 @param conf_key_id - configured key ID for this session
Klement Sekeraa57a9702017-02-02 06:58:07 +0100171 @param required_min_rx - required min receive interval (microseconds)
172 @param desired_min_tx - desired min transmit interval (microseconds)
173 @param detect_mult - detect multiplier (# of packets missed before connection goes down)
Pavel Kotucek20d12322016-12-21 09:13:17 +0100174*/
Klement Sekerab17dd962017-01-09 07:43:48 +0100175define bfd_udp_session_details
176{
Pavel Kotucek20d12322016-12-21 09:13:17 +0100177 u32 context;
Jakub Grajciar4682feb2019-09-02 13:28:52 +0200178 vl_api_interface_index_t sw_if_index;
179 vl_api_address_t local_addr;
180 vl_api_address_t peer_addr;
181 vl_api_bfd_state_t state;
182 bool is_authenticated;
Klement Sekerab17dd962017-01-09 07:43:48 +0100183 u8 bfd_key_id;
184 u32 conf_key_id;
Klement Sekeraa57a9702017-02-02 06:58:07 +0100185 u32 required_min_rx;
186 u32 desired_min_tx;
187 u8 detect_mult;
Pavel Kotucek20d12322016-12-21 09:13:17 +0100188};
189
Klement Sekerab17dd962017-01-09 07:43:48 +0100190/** \brief Set flags of BFD UDP session
Pavel Kotucek20d12322016-12-21 09:13:17 +0100191 @param client_index - opaque cookie to identify the sender
192 @param context - sender context, to match reply w/ request
Klement Sekerab17dd962017-01-09 07:43:48 +0100193 @param sw_if_index - sw index of the interface
194 @param local_addr - local address
195 @param peer_addr - peer address
196 @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
Jakub Grajciar4682feb2019-09-02 13:28:52 +0200197 @param flags - set the admin state, 1 = up, 0 = down
Pavel Kotucek20d12322016-12-21 09:13:17 +0100198*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400199autoreply define bfd_udp_session_set_flags
Klement Sekerab17dd962017-01-09 07:43:48 +0100200{
Pavel Kotucek20d12322016-12-21 09:13:17 +0100201 u32 client_index;
202 u32 context;
Jakub Grajciar4682feb2019-09-02 13:28:52 +0200203 vl_api_interface_index_t sw_if_index;
204 vl_api_address_t local_addr;
205 vl_api_address_t peer_addr;
206 vl_api_if_status_flags_t flags;
Pavel Kotucek20d12322016-12-21 09:13:17 +0100207};
208
Ole Troan4376ab22021-03-03 10:40:05 +0100209service {
210 rpc want_bfd_events returns want_bfd_events_reply
211 events bfd_udp_session_event;
212};
213
Pavel Kotucek20d12322016-12-21 09:13:17 +0100214/** \brief Register for BFD events
215 @param client_index - opaque cookie to identify the sender
216 @param context - sender context, to match reply w/ request
217 @param enable_disable - 1 => register for events, 0 => cancel registration
218 @param pid - sender's pid
219*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400220autoreply define want_bfd_events
Pavel Kotucek20d12322016-12-21 09:13:17 +0100221{
222 u32 client_index;
223 u32 context;
Jakub Grajciar4682feb2019-09-02 13:28:52 +0200224 bool enable_disable;
Pavel Kotucek20d12322016-12-21 09:13:17 +0100225 u32 pid;
226};
227
Ole Troan4376ab22021-03-03 10:40:05 +0100228define bfd_udp_session_event
229{
230 u32 client_index;
231 u32 pid;
232 vl_api_interface_index_t sw_if_index;
233 vl_api_address_t local_addr;
234 vl_api_address_t peer_addr;
235 vl_api_bfd_state_t state;
236 bool is_authenticated;
237 u8 bfd_key_id;
238 u32 conf_key_id;
239 u32 required_min_rx;
240 u32 desired_min_tx;
241 u8 detect_mult;
242};
243
Klement Sekerab17dd962017-01-09 07:43:48 +0100244/** \brief BFD UDP - add/replace key to configuration
245 @param client_index - opaque cookie to identify the sender
246 @param context - sender context, to match reply w/ request
247 @param conf_key_id - key ID to add/replace/delete
248 @param key_len - length of key (must be non-zero)
249 @param auth_type - authentication type (RFC 5880/4.1/Auth Type)
250 @param key - key data
251*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400252autoreply define bfd_auth_set_key
Klement Sekerab17dd962017-01-09 07:43:48 +0100253{
254 u32 client_index;
255 u32 context;
256 u32 conf_key_id;
257 u8 key_len;
258 u8 auth_type;
259 u8 key[20];
260};
261
Klement Sekerab17dd962017-01-09 07:43:48 +0100262/** \brief BFD UDP - delete key from configuration
263 @param client_index - opaque cookie to identify the sender
264 @param context - sender context, to match reply w/ request
265 @param conf_key_id - key ID to add/replace/delete
266 @param key_len - length of key (must be non-zero)
267 @param key - key data
268*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400269autoreply define bfd_auth_del_key
Klement Sekerab17dd962017-01-09 07:43:48 +0100270{
271 u32 client_index;
272 u32 context;
273 u32 conf_key_id;
274};
275
Klement Sekerab17dd962017-01-09 07:43:48 +0100276/** \brief Get a list of configured authentication keys
277 @param client_index - opaque cookie to identify the sender
278 @param context - sender context, to match reply w/ request
279*/
280define bfd_auth_keys_dump
281{
282 u32 client_index;
283 u32 context;
284};
285
286/** \brief BFD authentication key details
287 @param context - sender context, to match reply w/ request
288 @param conf_key_id - configured key ID
289 @param use_count - how many BFD sessions currently use this key
290 @param auth_type - authentication type (RFC 5880/4.1/Auth Type)
291*/
292define bfd_auth_keys_details
293{
294 u32 context;
295 u32 conf_key_id;
296 u32 use_count;
297 u8 auth_type;
298};
299
300/** \brief BFD UDP - activate/change authentication
301 @param client_index - opaque cookie to identify the sender
302 @param context - sender context, to match reply w/ request
303 @param sw_if_index - sw index of the interface
304 @param local_addr - local address
305 @param peer_addr - peer address
306 @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
307 @param is_delayed - change is applied once peer applies the change (on first received packet with this auth)
308 @param bfd_key_id - key id sent out in BFD packets
309 @param conf_key_id - id of already configured key
310*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400311autoreply define bfd_udp_auth_activate
Klement Sekerab17dd962017-01-09 07:43:48 +0100312{
313 u32 client_index;
314 u32 context;
Jakub Grajciar4682feb2019-09-02 13:28:52 +0200315 vl_api_interface_index_t sw_if_index;
316 vl_api_address_t local_addr;
317 vl_api_address_t peer_addr;
318 bool is_delayed;
Klement Sekerab17dd962017-01-09 07:43:48 +0100319 u8 bfd_key_id;
320 u32 conf_key_id;
321};
322
Klement Sekerab17dd962017-01-09 07:43:48 +0100323/** \brief BFD UDP - deactivate authentication
324 @param client_index - opaque cookie to identify the sender
325 @param context - sender context, to match reply w/ request
326 @param sw_if_index - sw index of the interface
327 @param local_addr - local address
328 @param peer_addr - peer address
329 @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
330 @param is_delayed - change is applied once peer applies the change (on first received non-authenticated packet)
331*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400332autoreply define bfd_udp_auth_deactivate
Klement Sekerab17dd962017-01-09 07:43:48 +0100333{
334 u32 client_index;
335 u32 context;
Jakub Grajciar4682feb2019-09-02 13:28:52 +0200336 vl_api_interface_index_t sw_if_index;
337 vl_api_address_t local_addr;
338 vl_api_address_t peer_addr;
339 bool is_delayed;
Klement Sekerab17dd962017-01-09 07:43:48 +0100340};
341
Pavel Kotucek20d12322016-12-21 09:13:17 +0100342/*
343 * Local Variables:
344 * eval: (c-set-style "gnu")
345 * End:
346 */