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 | |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 16 | option version = "2.0.0"; |
| 17 | |
| 18 | import "vnet/interface_types.api"; |
| 19 | import "vnet/ip/ip_types.api"; |
| 20 | |
| 21 | enum 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 Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 27 | |
Klement Sekera | 239790f | 2017-02-16 10:53:53 +0100 | [diff] [blame] | 28 | /** \brief Set BFD echo source |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 29 | @param client_index - opaque cookie to identify the sender |
| 30 | @param context - sender context, to match reply w/ request |
Klement Sekera | 239790f | 2017-02-16 10:53:53 +0100 | [diff] [blame] | 31 | @param sw_if_index - interface to use as echo source |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 32 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 33 | autoreply define bfd_udp_set_echo_source |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 34 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 35 | u32 client_index; |
| 36 | u32 context; |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 37 | vl_api_interface_index_t sw_if_index; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 38 | }; |
| 39 | |
Klement Sekera | 239790f | 2017-02-16 10:53:53 +0100 | [diff] [blame] | 40 | /** \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 Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 44 | autoreply define bfd_udp_del_echo_source |
Klement Sekera | 239790f | 2017-02-16 10:53:53 +0100 | [diff] [blame] | 45 | { |
| 46 | u32 client_index; |
| 47 | u32 context; |
| 48 | }; |
| 49 | |
Matus Fabian | 2d3c7b9 | 2018-10-02 03:22:18 -0700 | [diff] [blame] | 50 | /** \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 | */ |
| 54 | define 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 | */ |
| 70 | define bfd_udp_get_echo_source_reply |
| 71 | { |
| 72 | u32 context; |
| 73 | i32 retval; |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 74 | 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 Fabian | 2d3c7b9 | 2018-10-02 03:22:18 -0700 | [diff] [blame] | 80 | }; |
| 81 | |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 82 | /** \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 Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 88 | @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 Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 91 | @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 Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 95 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 96 | autoreply define bfd_udp_add |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 97 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 98 | u32 client_index; |
| 99 | u32 context; |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 100 | vl_api_interface_index_t sw_if_index; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 101 | u32 desired_min_tx; |
| 102 | u32 required_min_rx; |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 103 | vl_api_address_t local_addr; |
| 104 | vl_api_address_t peer_addr; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 105 | u8 detect_mult; |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 106 | bool is_authenticated; |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 107 | u8 bfd_key_id; |
| 108 | u32 conf_key_id; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 109 | }; |
| 110 | |
Klement Sekera | a57a970 | 2017-02-02 06:58:07 +0100 | [diff] [blame] | 111 | /** \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 Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 122 | autoreply define bfd_udp_mod |
Klement Sekera | a57a970 | 2017-02-02 06:58:07 +0100 | [diff] [blame] | 123 | { |
| 124 | u32 client_index; |
| 125 | u32 context; |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 126 | vl_api_interface_index_t sw_if_index; |
Klement Sekera | a57a970 | 2017-02-02 06:58:07 +0100 | [diff] [blame] | 127 | u32 desired_min_tx; |
| 128 | u32 required_min_rx; |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 129 | vl_api_address_t local_addr; |
| 130 | vl_api_address_t peer_addr; |
Klement Sekera | a57a970 | 2017-02-02 06:58:07 +0100 | [diff] [blame] | 131 | u8 detect_mult; |
| 132 | }; |
| 133 | |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 134 | /** \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 Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 142 | autoreply define bfd_udp_del |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 143 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 144 | u32 client_index; |
| 145 | u32 context; |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 146 | vl_api_interface_index_t sw_if_index; |
| 147 | vl_api_address_t local_addr; |
| 148 | vl_api_address_t peer_addr; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 149 | }; |
| 150 | |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 151 | /** \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 Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 155 | define bfd_udp_session_dump |
| 156 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 157 | 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 Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 163 | @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 Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 168 | @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 Sekera | a57a970 | 2017-02-02 06:58:07 +0100 | [diff] [blame] | 171 | @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 Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 174 | */ |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 175 | define bfd_udp_session_details |
| 176 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 177 | u32 context; |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 178 | 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 Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 183 | u8 bfd_key_id; |
| 184 | u32 conf_key_id; |
Klement Sekera | a57a970 | 2017-02-02 06:58:07 +0100 | [diff] [blame] | 185 | u32 required_min_rx; |
| 186 | u32 desired_min_tx; |
| 187 | u8 detect_mult; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 188 | }; |
| 189 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 190 | /** \brief Set flags of BFD UDP session |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 191 | @param client_index - opaque cookie to identify the sender |
| 192 | @param context - sender context, to match reply w/ request |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 193 | @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 Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 197 | @param flags - set the admin state, 1 = up, 0 = down |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 198 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 199 | autoreply define bfd_udp_session_set_flags |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 200 | { |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 201 | u32 client_index; |
| 202 | u32 context; |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 203 | 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 Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 207 | }; |
| 208 | |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 209 | /** \brief Register for BFD events |
| 210 | @param client_index - opaque cookie to identify the sender |
| 211 | @param context - sender context, to match reply w/ request |
| 212 | @param enable_disable - 1 => register for events, 0 => cancel registration |
| 213 | @param pid - sender's pid |
| 214 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 215 | autoreply define want_bfd_events |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 216 | { |
| 217 | u32 client_index; |
| 218 | u32 context; |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 219 | bool enable_disable; |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 220 | u32 pid; |
| 221 | }; |
| 222 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 223 | /** \brief BFD UDP - add/replace key to configuration |
| 224 | @param client_index - opaque cookie to identify the sender |
| 225 | @param context - sender context, to match reply w/ request |
| 226 | @param conf_key_id - key ID to add/replace/delete |
| 227 | @param key_len - length of key (must be non-zero) |
| 228 | @param auth_type - authentication type (RFC 5880/4.1/Auth Type) |
| 229 | @param key - key data |
| 230 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 231 | autoreply define bfd_auth_set_key |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 232 | { |
| 233 | u32 client_index; |
| 234 | u32 context; |
| 235 | u32 conf_key_id; |
| 236 | u8 key_len; |
| 237 | u8 auth_type; |
| 238 | u8 key[20]; |
| 239 | }; |
| 240 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 241 | /** \brief BFD UDP - delete key from configuration |
| 242 | @param client_index - opaque cookie to identify the sender |
| 243 | @param context - sender context, to match reply w/ request |
| 244 | @param conf_key_id - key ID to add/replace/delete |
| 245 | @param key_len - length of key (must be non-zero) |
| 246 | @param key - key data |
| 247 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 248 | autoreply define bfd_auth_del_key |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 249 | { |
| 250 | u32 client_index; |
| 251 | u32 context; |
| 252 | u32 conf_key_id; |
| 253 | }; |
| 254 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 255 | /** \brief Get a list of configured authentication keys |
| 256 | @param client_index - opaque cookie to identify the sender |
| 257 | @param context - sender context, to match reply w/ request |
| 258 | */ |
| 259 | define bfd_auth_keys_dump |
| 260 | { |
| 261 | u32 client_index; |
| 262 | u32 context; |
| 263 | }; |
| 264 | |
| 265 | /** \brief BFD authentication key details |
| 266 | @param context - sender context, to match reply w/ request |
| 267 | @param conf_key_id - configured key ID |
| 268 | @param use_count - how many BFD sessions currently use this key |
| 269 | @param auth_type - authentication type (RFC 5880/4.1/Auth Type) |
| 270 | */ |
| 271 | define bfd_auth_keys_details |
| 272 | { |
| 273 | u32 context; |
| 274 | u32 conf_key_id; |
| 275 | u32 use_count; |
| 276 | u8 auth_type; |
| 277 | }; |
| 278 | |
| 279 | /** \brief BFD UDP - activate/change authentication |
| 280 | @param client_index - opaque cookie to identify the sender |
| 281 | @param context - sender context, to match reply w/ request |
| 282 | @param sw_if_index - sw index of the interface |
| 283 | @param local_addr - local address |
| 284 | @param peer_addr - peer address |
| 285 | @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4 |
| 286 | @param is_delayed - change is applied once peer applies the change (on first received packet with this auth) |
| 287 | @param bfd_key_id - key id sent out in BFD packets |
| 288 | @param conf_key_id - id of already configured key |
| 289 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 290 | autoreply define bfd_udp_auth_activate |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 291 | { |
| 292 | u32 client_index; |
| 293 | u32 context; |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 294 | vl_api_interface_index_t sw_if_index; |
| 295 | vl_api_address_t local_addr; |
| 296 | vl_api_address_t peer_addr; |
| 297 | bool is_delayed; |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 298 | u8 bfd_key_id; |
| 299 | u32 conf_key_id; |
| 300 | }; |
| 301 | |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 302 | /** \brief BFD UDP - deactivate 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 non-authenticated packet) |
| 310 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 311 | autoreply define bfd_udp_auth_deactivate |
Klement Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 312 | { |
| 313 | u32 client_index; |
| 314 | u32 context; |
Jakub Grajciar | 4682feb | 2019-09-02 13:28:52 +0200 | [diff] [blame] | 315 | 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 Sekera | b17dd96 | 2017-01-09 07:43:48 +0100 | [diff] [blame] | 319 | }; |
| 320 | |
Pavel Kotucek | 20d1232 | 2016-12-21 09:13:17 +0100 | [diff] [blame] | 321 | /* |
| 322 | * Local Variables: |
| 323 | * eval: (c-set-style "gnu") |
| 324 | * End: |
| 325 | */ |