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 | |
Klement Sekera | 7388448 | 2017-02-23 09:26:30 +0100 | [diff] [blame] | 48 | /** \brief Delete BFD echo source response |
Klement Sekera | 239790f | 2017-02-16 10:53:53 +0100 | [diff] [blame] | 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 | |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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) |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 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) |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 71 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 72 | define bfd_udp_add |
| 73 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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; |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 83 | u8 is_authenticated; |
| 84 | u8 bfd_key_id; |
| 85 | u32 conf_key_id; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 91 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 92 | define bfd_udp_add_reply |
| 93 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 94 | u32 context; |
| 95 | i32 retval; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 96 | }; |
| 97 | |
Klement Sekera | a57a970 | 2017-02-02 06:58:07 +0100 | [diff] [blame] | 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 | |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 140 | define bfd_udp_del |
| 141 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 154 | define bfd_udp_del_reply |
| 155 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 164 | define bfd_udp_session_dump |
| 165 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 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 |
Klement Sekera | a57a970 | 2017-02-02 06:58:07 +0100 | [diff] [blame] | 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) |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 183 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 184 | define bfd_udp_session_details |
| 185 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 186 | u32 context; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 187 | u32 sw_if_index; |
| 188 | u8 local_addr[16]; |
| 189 | u8 peer_addr[16]; |
| 190 | u8 is_ipv6; |
| 191 | u8 state; |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 192 | u8 is_authenticated; |
| 193 | u8 bfd_key_id; |
| 194 | u32 conf_key_id; |
Klement Sekera | a57a970 | 2017-02-02 06:58:07 +0100 | [diff] [blame] | 195 | u32 required_min_rx; |
| 196 | u32 desired_min_tx; |
| 197 | u8 detect_mult; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 198 | }; |
| 199 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 200 | /** \brief Set flags of BFD UDP session |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 201 | @param client_index - opaque cookie to identify the sender |
| 202 | @param context - sender context, to match reply w/ request |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 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 |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 207 | @param admin_up_down - set the admin state, 1 = up, 0 = down |
| 208 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 209 | define bfd_udp_session_set_flags |
| 210 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 211 | u32 client_index; |
| 212 | u32 context; |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 213 | u32 sw_if_index; |
| 214 | u8 local_addr[16]; |
| 215 | u8 peer_addr[16]; |
| 216 | u8 is_ipv6; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 217 | u8 admin_up_down; |
| 218 | }; |
| 219 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 220 | /** \brief Reply to bfd_udp_session_set_flags |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 221 | @param context - sender context which was passed in the request |
| 222 | @param retval - return code of the set flags request |
| 223 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 224 | define bfd_udp_session_set_flags_reply |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 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 | |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 394 | /* |
| 395 | * Local Variables: |
| 396 | * eval: (c-set-style "gnu") |
| 397 | * End: |
| 398 | */ |