Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 | |
Klement Sekera | 239790f | 2017-02-16 10:53:53 +0100 | [diff] [blame^] | 16 | /** \brief Set BFD echo source |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 17 | @param client_index - opaque cookie to identify the sender |
| 18 | @param context - sender context, to match reply w/ request |
Klement Sekera | 239790f | 2017-02-16 10:53:53 +0100 | [diff] [blame^] | 19 | @param sw_if_index - interface to use as echo source |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 20 | */ |
Klement Sekera | 239790f | 2017-02-16 10:53:53 +0100 | [diff] [blame^] | 21 | define bfd_udp_set_echo_source |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 22 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 23 | u32 client_index; |
| 24 | u32 context; |
Klement Sekera | 239790f | 2017-02-16 10:53:53 +0100 | [diff] [blame^] | 25 | u32 sw_if_index; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 26 | }; |
| 27 | |
Klement Sekera | 239790f | 2017-02-16 10:53:53 +0100 | [diff] [blame^] | 28 | /** \brief Set BFD feature response |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 29 | @param context - sender context, to match reply w/ request |
| 30 | @param retval - return code for the request |
| 31 | */ |
Klement Sekera | 239790f | 2017-02-16 10:53:53 +0100 | [diff] [blame^] | 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 |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 53 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 54 | u32 context; |
| 55 | i32 retval; |
| 56 | }; |
| 57 | |
| 58 | /** \brief Get BFD configuration |
| 59 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 60 | define bfd_get_config |
| 61 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 74 | define bfd_get_config_reply |
| 75 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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) |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 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) |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 97 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 98 | define bfd_udp_add |
| 99 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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; |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 109 | u8 is_authenticated; |
| 110 | u8 bfd_key_id; |
| 111 | u32 conf_key_id; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 117 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 118 | define bfd_udp_add_reply |
| 119 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 120 | u32 context; |
| 121 | i32 retval; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 122 | }; |
| 123 | |
Klement Sekera | a57a970 | 2017-02-02 06:58:07 +0100 | [diff] [blame] | 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 | |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 166 | define bfd_udp_del |
| 167 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 180 | define bfd_udp_del_reply |
| 181 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 190 | define bfd_udp_session_dump |
| 191 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 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 |
Klement Sekera | a57a970 | 2017-02-02 06:58:07 +0100 | [diff] [blame] | 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) |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 209 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 210 | define bfd_udp_session_details |
| 211 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 212 | u32 context; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 213 | u32 sw_if_index; |
| 214 | u8 local_addr[16]; |
| 215 | u8 peer_addr[16]; |
| 216 | u8 is_ipv6; |
| 217 | u8 state; |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 218 | u8 is_authenticated; |
| 219 | u8 bfd_key_id; |
| 220 | u32 conf_key_id; |
Klement Sekera | a57a970 | 2017-02-02 06:58:07 +0100 | [diff] [blame] | 221 | u32 required_min_rx; |
| 222 | u32 desired_min_tx; |
| 223 | u8 detect_mult; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 224 | }; |
| 225 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 226 | /** \brief Set flags of BFD UDP session |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 227 | @param client_index - opaque cookie to identify the sender |
| 228 | @param context - sender context, to match reply w/ request |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 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 |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 233 | @param admin_up_down - set the admin state, 1 = up, 0 = down |
| 234 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 235 | define bfd_udp_session_set_flags |
| 236 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 237 | u32 client_index; |
| 238 | u32 context; |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 239 | u32 sw_if_index; |
| 240 | u8 local_addr[16]; |
| 241 | u8 peer_addr[16]; |
| 242 | u8 is_ipv6; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 243 | u8 admin_up_down; |
| 244 | }; |
| 245 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 246 | /** \brief Reply to bfd_udp_session_set_flags |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 247 | @param context - sender context which was passed in the request |
| 248 | @param retval - return code of the set flags request |
| 249 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 250 | define bfd_udp_session_set_flags_reply |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 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 | |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 420 | /* |
| 421 | * Local Variables: |
| 422 | * eval: (c-set-style "gnu") |
| 423 | * End: |
| 424 | */ |