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 | |
| 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 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 24 | define bfd_set_config |
| 25 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 38 | define bfd_set_config_reply |
| 39 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 40 | u32 context; |
| 41 | i32 retval; |
| 42 | }; |
| 43 | |
| 44 | /** \brief Get BFD configuration |
| 45 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 46 | define bfd_get_config |
| 47 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 60 | define bfd_get_config_reply |
| 61 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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) |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 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) |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 83 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 84 | define bfd_udp_add |
| 85 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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; |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 95 | u8 is_authenticated; |
| 96 | u8 bfd_key_id; |
| 97 | u32 conf_key_id; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 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 |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 103 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 104 | define bfd_udp_add_reply |
| 105 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 106 | u32 context; |
| 107 | i32 retval; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 108 | }; |
| 109 | |
| 110 | /** \brief Delete 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 local_addr - local address |
| 115 | @param peer_addr - peer address |
| 116 | @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4 |
| 117 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 118 | define bfd_udp_del |
| 119 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 120 | u32 client_index; |
| 121 | u32 context; |
| 122 | u32 sw_if_index; |
| 123 | u8 local_addr[16]; |
| 124 | u8 peer_addr[16]; |
| 125 | u8 is_ipv6; |
| 126 | }; |
| 127 | |
| 128 | /** \brief Delete UDP BFD session response |
| 129 | @param context - sender context, to match reply w/ request |
| 130 | @param retval - return code for the request |
| 131 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 132 | define bfd_udp_del_reply |
| 133 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 134 | u32 context; |
| 135 | i32 retval; |
| 136 | }; |
| 137 | |
| 138 | /** \brief Get all BFD sessions |
| 139 | @param client_index - opaque cookie to identify the sender |
| 140 | @param context - sender context, to match reply w/ request |
| 141 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 142 | define bfd_udp_session_dump |
| 143 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 144 | u32 client_index; |
| 145 | u32 context; |
| 146 | }; |
| 147 | |
| 148 | /** \brief BFD session details structure |
| 149 | @param context - sender context, to match reply w/ request |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 150 | @param sw_if_index - sw index of the interface |
| 151 | @param local_addr - local address |
| 152 | @param peer_addr - peer address |
| 153 | @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4 |
| 154 | @param state - session state |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 155 | @param is_authenticated - non-zero if authentication in-use, zero otherwise |
| 156 | @param bfd_key_id - ID of key currently in-use if auth is on |
| 157 | @param conf_key_id - configured key ID for this session |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 158 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 159 | define bfd_udp_session_details |
| 160 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 161 | u32 context; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 162 | u32 sw_if_index; |
| 163 | u8 local_addr[16]; |
| 164 | u8 peer_addr[16]; |
| 165 | u8 is_ipv6; |
| 166 | u8 state; |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 167 | u8 is_authenticated; |
| 168 | u8 bfd_key_id; |
| 169 | u32 conf_key_id; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 170 | }; |
| 171 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 172 | /** \brief Set flags of BFD UDP session |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 173 | @param client_index - opaque cookie to identify the sender |
| 174 | @param context - sender context, to match reply w/ request |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 175 | @param sw_if_index - sw index of the interface |
| 176 | @param local_addr - local address |
| 177 | @param peer_addr - peer address |
| 178 | @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] | 179 | @param admin_up_down - set the admin state, 1 = up, 0 = down |
| 180 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 181 | define bfd_udp_session_set_flags |
| 182 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 183 | u32 client_index; |
| 184 | u32 context; |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 185 | u32 sw_if_index; |
| 186 | u8 local_addr[16]; |
| 187 | u8 peer_addr[16]; |
| 188 | u8 is_ipv6; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 189 | u8 admin_up_down; |
| 190 | }; |
| 191 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 192 | /** \brief Reply to bfd_udp_session_set_flags |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 193 | @param context - sender context which was passed in the request |
| 194 | @param retval - return code of the set flags request |
| 195 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 196 | define bfd_udp_session_set_flags_reply |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 197 | { |
| 198 | u32 context; |
| 199 | i32 retval; |
| 200 | }; |
| 201 | |
| 202 | /** \brief Register for BFD events |
| 203 | @param client_index - opaque cookie to identify the sender |
| 204 | @param context - sender context, to match reply w/ request |
| 205 | @param enable_disable - 1 => register for events, 0 => cancel registration |
| 206 | @param pid - sender's pid |
| 207 | */ |
| 208 | define want_bfd_events |
| 209 | { |
| 210 | u32 client_index; |
| 211 | u32 context; |
| 212 | u32 enable_disable; |
| 213 | u32 pid; |
| 214 | }; |
| 215 | |
| 216 | /** \brief Reply for BFD events registration |
| 217 | @param context - returned sender context, to match reply w/ request |
| 218 | @param retval - return code |
| 219 | */ |
| 220 | define want_bfd_events_reply |
| 221 | { |
| 222 | u32 context; |
| 223 | i32 retval; |
| 224 | }; |
| 225 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame^] | 226 | /** \brief BFD UDP - add/replace key to configuration |
| 227 | @param client_index - opaque cookie to identify the sender |
| 228 | @param context - sender context, to match reply w/ request |
| 229 | @param conf_key_id - key ID to add/replace/delete |
| 230 | @param key_len - length of key (must be non-zero) |
| 231 | @param auth_type - authentication type (RFC 5880/4.1/Auth Type) |
| 232 | @param key - key data |
| 233 | */ |
| 234 | define bfd_auth_set_key |
| 235 | { |
| 236 | u32 client_index; |
| 237 | u32 context; |
| 238 | u32 conf_key_id; |
| 239 | u8 key_len; |
| 240 | u8 auth_type; |
| 241 | u8 key[20]; |
| 242 | }; |
| 243 | |
| 244 | /** \brief BFD UDP - add/replace key reply |
| 245 | @param context - returned sender context, to match reply w/ request |
| 246 | @param retval - return code |
| 247 | */ |
| 248 | define bfd_auth_set_key_reply |
| 249 | { |
| 250 | u32 context; |
| 251 | i32 retval; |
| 252 | }; |
| 253 | |
| 254 | /** \brief BFD UDP - delete key from 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 key - key data |
| 260 | */ |
| 261 | define bfd_auth_del_key |
| 262 | { |
| 263 | u32 client_index; |
| 264 | u32 context; |
| 265 | u32 conf_key_id; |
| 266 | }; |
| 267 | |
| 268 | /** \brief BFD UDP - delete key reply |
| 269 | @param context - returned sender context, to match reply w/ request |
| 270 | @param retval - return code |
| 271 | */ |
| 272 | define bfd_auth_del_key_reply |
| 273 | { |
| 274 | u32 context; |
| 275 | i32 retval; |
| 276 | }; |
| 277 | |
| 278 | /** \brief Get a list of configured authentication keys |
| 279 | @param client_index - opaque cookie to identify the sender |
| 280 | @param context - sender context, to match reply w/ request |
| 281 | */ |
| 282 | define bfd_auth_keys_dump |
| 283 | { |
| 284 | u32 client_index; |
| 285 | u32 context; |
| 286 | }; |
| 287 | |
| 288 | /** \brief BFD authentication key details |
| 289 | @param context - sender context, to match reply w/ request |
| 290 | @param conf_key_id - configured key ID |
| 291 | @param use_count - how many BFD sessions currently use this key |
| 292 | @param auth_type - authentication type (RFC 5880/4.1/Auth Type) |
| 293 | */ |
| 294 | define bfd_auth_keys_details |
| 295 | { |
| 296 | u32 context; |
| 297 | u32 conf_key_id; |
| 298 | u32 use_count; |
| 299 | u8 auth_type; |
| 300 | }; |
| 301 | |
| 302 | /** \brief BFD UDP - activate/change authentication |
| 303 | @param client_index - opaque cookie to identify the sender |
| 304 | @param context - sender context, to match reply w/ request |
| 305 | @param sw_if_index - sw index of the interface |
| 306 | @param local_addr - local address |
| 307 | @param peer_addr - peer address |
| 308 | @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4 |
| 309 | @param is_delayed - change is applied once peer applies the change (on first received packet with this auth) |
| 310 | @param bfd_key_id - key id sent out in BFD packets |
| 311 | @param conf_key_id - id of already configured key |
| 312 | */ |
| 313 | define bfd_udp_auth_activate |
| 314 | { |
| 315 | u32 client_index; |
| 316 | u32 context; |
| 317 | u32 sw_if_index; |
| 318 | u8 local_addr[16]; |
| 319 | u8 peer_addr[16]; |
| 320 | u8 is_ipv6; |
| 321 | u8 is_delayed; |
| 322 | u8 bfd_key_id; |
| 323 | u32 conf_key_id; |
| 324 | }; |
| 325 | |
| 326 | /** \brief BFD UDP - activate/change authentication reply |
| 327 | @param context - returned sender context, to match reply w/ request |
| 328 | @param retval - return code |
| 329 | */ |
| 330 | define bfd_udp_auth_activate_reply |
| 331 | { |
| 332 | u32 context; |
| 333 | i32 retval; |
| 334 | }; |
| 335 | |
| 336 | /** \brief BFD UDP - deactivate authentication |
| 337 | @param client_index - opaque cookie to identify the sender |
| 338 | @param context - sender context, to match reply w/ request |
| 339 | @param sw_if_index - sw index of the interface |
| 340 | @param local_addr - local address |
| 341 | @param peer_addr - peer address |
| 342 | @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4 |
| 343 | @param is_delayed - change is applied once peer applies the change (on first received non-authenticated packet) |
| 344 | */ |
| 345 | define bfd_udp_auth_deactivate |
| 346 | { |
| 347 | u32 client_index; |
| 348 | u32 context; |
| 349 | u32 sw_if_index; |
| 350 | u8 local_addr[16]; |
| 351 | u8 peer_addr[16]; |
| 352 | u8 is_ipv6; |
| 353 | u8 is_delayed; |
| 354 | }; |
| 355 | |
| 356 | /** \brief BFD UDP - deactivate authentication reply |
| 357 | @param context - returned sender context, to match reply w/ request |
| 358 | @param retval - return code |
| 359 | */ |
| 360 | define bfd_udp_auth_deactivate_reply |
| 361 | { |
| 362 | u32 context; |
| 363 | i32 retval; |
| 364 | }; |
| 365 | |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 366 | /* |
| 367 | * Local Variables: |
| 368 | * eval: (c-set-style "gnu") |
| 369 | * End: |
| 370 | */ |