Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 1 | /* Hey Emacs use -*- mode: C -*- */ |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2015-2016 Cisco and/or its affiliates. |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at: |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 17 | option version = "3.0.0"; |
| 18 | |
| 19 | import "vnet/ip/ip_types.api"; |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 20 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 21 | /** \brief IPsec: Add/delete Security Policy Database |
| 22 | @param client_index - opaque cookie to identify the sender |
| 23 | @param context - sender context, to match reply w/ request |
| 24 | @param is_add - add SPD if non-zero, else delete |
| 25 | @param spd_id - SPD instance id (control plane allocated) |
| 26 | */ |
| 27 | |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 28 | autoreply define ipsec_spd_add_del |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 29 | { |
| 30 | u32 client_index; |
| 31 | u32 context; |
| 32 | u8 is_add; |
| 33 | u32 spd_id; |
| 34 | }; |
| 35 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 36 | /** \brief IPsec: Add/delete SPD from interface |
| 37 | |
| 38 | @param client_index - opaque cookie to identify the sender |
| 39 | @param context - sender context, to match reply w/ request |
| 40 | @param is_add - add security mode if non-zero, else delete |
| 41 | @param sw_if_index - index of the interface |
| 42 | @param spd_id - SPD instance id to use for lookups |
| 43 | */ |
| 44 | |
| 45 | |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 46 | autoreply define ipsec_interface_add_del_spd |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 47 | { |
| 48 | u32 client_index; |
| 49 | u32 context; |
| 50 | |
| 51 | u8 is_add; |
| 52 | u32 sw_if_index; |
| 53 | u32 spd_id; |
| 54 | }; |
| 55 | |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 56 | |
| 57 | enum ipsec_spd_action |
| 58 | { |
| 59 | /* bypass - no IPsec processing */ |
| 60 | IPSEC_API_SPD_ACTION_BYPASS = 0, |
| 61 | /* discard - discard packet with ICMP processing */ |
| 62 | IPSEC_API_SPD_ACTION_DISCARD, |
| 63 | /* resolve - send request to control plane for SA resolving */ |
| 64 | IPSEC_API_SPD_ACTION_RESOLVE, |
| 65 | /* protect - apply IPsec policy using following parameters */ |
| 66 | IPSEC_API_SPD_ACTION_PROTECT, |
| 67 | }; |
| 68 | |
| 69 | /** \brief IPsec: Security Policy Database entry |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 70 | |
| 71 | See RFC 4301, 4.4.1.1 on how to match packet to selectors |
| 72 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 73 | @param spd_id - SPD instance id (control plane allocated) |
| 74 | @param priority - priority of SPD entry (non-unique value). Used to order SPD matching - higher priorities match before lower |
| 75 | @param is_outbound - entry applies to outbound traffic if non-zero, otherwise applies to inbound traffic |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 76 | @param remote_address_start - start of remote address range to match |
| 77 | @param remote_address_stop - end of remote address range to match |
| 78 | @param local_address_start - start of local address range to match |
| 79 | @param local_address_stop - end of local address range to match |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 80 | @param protocol - protocol type to match [0 means any] otherwise IANA value |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 81 | @param remote_port_start - start of remote port range to match ... |
| 82 | @param remote_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE] |
| 83 | @param local_port_start - start of local port range to match ... |
| 84 | @param local_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE] |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 85 | @param policy - action to perform on match |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 86 | @param sa_id - SAD instance id (control plane allocated) |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 87 | */ |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 88 | typedef ipsec_spd_entry |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 89 | { |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 90 | u32 spd_id; |
| 91 | i32 priority; |
| 92 | u8 is_outbound; |
| 93 | |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 94 | u32 sa_id; |
| 95 | vl_api_ipsec_spd_action_t policy; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 96 | u8 protocol; |
| 97 | |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 98 | // Selector |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 99 | vl_api_address_t remote_address_start; |
| 100 | vl_api_address_t remote_address_stop; |
| 101 | vl_api_address_t local_address_start; |
| 102 | vl_api_address_t local_address_stop; |
| 103 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 104 | u16 remote_port_start; |
| 105 | u16 remote_port_stop; |
| 106 | u16 local_port_start; |
| 107 | u16 local_port_stop; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 108 | }; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 109 | |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 110 | /** \brief IPsec: Add/delete Security Policy Database entry |
| 111 | |
| 112 | @param client_index - opaque cookie to identify the sender |
| 113 | @param context - sender context, to match reply w/ request |
| 114 | @param is_add - add SPD if non-zero, else delete |
| 115 | @param entry - Description of the entry to add/dell |
| 116 | */ |
Neale Ranns | a09c1ff | 2019-02-04 01:10:30 -0800 | [diff] [blame] | 117 | define ipsec_spd_entry_add_del |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 118 | { |
| 119 | u32 client_index; |
| 120 | u32 context; |
| 121 | u8 is_add; |
| 122 | vl_api_ipsec_spd_entry_t entry; |
| 123 | }; |
| 124 | |
Neale Ranns | a09c1ff | 2019-02-04 01:10:30 -0800 | [diff] [blame] | 125 | /** \brief IPsec: Reply Add/delete Security Policy Database entry |
| 126 | |
| 127 | @param context - sender context, to match reply w/ request |
| 128 | @param retval - success/fail rutrun code |
| 129 | @param stat_index - An index for the policy in the stats segment @ /net/ipec/policy |
| 130 | */ |
| 131 | define ipsec_spd_entry_add_del_reply |
| 132 | { |
| 133 | u32 context; |
| 134 | i32 retval; |
| 135 | u32 stat_index; |
| 136 | }; |
| 137 | |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 138 | /** \brief Dump IPsec all SPD IDs |
| 139 | @param client_index - opaque cookie to identify the sender |
| 140 | @param context - sender context, to match reply w/ request |
| 141 | */ |
| 142 | define ipsec_spds_dump { |
| 143 | u32 client_index; |
| 144 | u32 context; |
| 145 | }; |
| 146 | |
| 147 | /** \brief Dump IPsec all SPD IDs response |
| 148 | @param client_index - opaque cookie to identify the sender |
| 149 | @param spd_id - SPD instance id (control plane allocated) |
| 150 | @param npolicies - number of policies in SPD |
| 151 | */ |
| 152 | define ipsec_spds_details { |
| 153 | u32 context; |
| 154 | u32 spd_id; |
| 155 | u32 npolicies; |
| 156 | }; |
| 157 | |
| 158 | /** \brief Dump ipsec policy database data |
| 159 | @param client_index - opaque cookie to identify the sender |
| 160 | @param context - sender context, to match reply w/ request |
| 161 | @param spd_id - SPD instance id |
| 162 | @param sa_id - SA id, optional, set to ~0 to see all policies in SPD |
| 163 | */ |
| 164 | define ipsec_spd_dump { |
| 165 | u32 client_index; |
| 166 | u32 context; |
| 167 | u32 spd_id; |
| 168 | u32 sa_id; |
| 169 | }; |
| 170 | |
| 171 | /** \brief IPsec policy database response |
| 172 | @param context - sender context which was passed in the request |
| 173 | €param entry - The SPD entry. |
| 174 | @param bytes - byte count of packets matching this policy |
| 175 | @param packets - count of packets matching this policy |
| 176 | */ |
| 177 | define ipsec_spd_details { |
| 178 | u32 context; |
| 179 | vl_api_ipsec_spd_entry_t entry; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 180 | }; |
| 181 | |
| 182 | /* |
| 183 | * @brief Support cryptographic algorithms |
| 184 | */ |
| 185 | enum ipsec_crypto_alg |
| 186 | { |
| 187 | IPSEC_API_CRYPTO_ALG_NONE = 0, |
| 188 | IPSEC_API_CRYPTO_ALG_AES_CBC_128, |
| 189 | IPSEC_API_CRYPTO_ALG_AES_CBC_192, |
| 190 | IPSEC_API_CRYPTO_ALG_AES_CBC_256, |
| 191 | IPSEC_API_CRYPTO_ALG_AES_CTR_128, |
| 192 | IPSEC_API_CRYPTO_ALG_AES_CTR_192, |
| 193 | IPSEC_API_CRYPTO_ALG_AES_CTR_256, |
| 194 | IPSEC_API_CRYPTO_ALG_AES_GCM_128, |
| 195 | IPSEC_API_CRYPTO_ALG_AES_GCM_192, |
| 196 | IPSEC_API_CRYPTO_ALG_AES_GCM_256, |
| 197 | IPSEC_API_CRYPTO_ALG_DES_CBC, |
| 198 | IPSEC_API_CRYPTO_ALG_3DES_CBC, |
| 199 | }; |
| 200 | |
| 201 | /* |
| 202 | * @brief Supported Integrity Algorithms |
| 203 | */ |
| 204 | enum ipsec_integ_alg |
| 205 | { |
| 206 | IPSEC_API_INTEG_ALG_NONE = 0, |
| 207 | /* RFC2403 */ |
| 208 | IPSEC_API_INTEG_ALG_MD5_96, |
| 209 | /* RFC2404 */ |
| 210 | IPSEC_API_INTEG_ALG_SHA1_96, |
| 211 | /* draft-ietf-ipsec-ciph-sha-256-00 */ |
| 212 | IPSEC_API_INTEG_ALG_SHA_256_96, |
| 213 | /* RFC4868 */ |
| 214 | IPSEC_API_INTEG_ALG_SHA_256_128, |
| 215 | /* RFC4868 */ |
| 216 | IPSEC_API_INTEG_ALG_SHA_384_192, |
| 217 | /* RFC4868 */ |
| 218 | IPSEC_API_INTEG_ALG_SHA_512_256, |
| 219 | }; |
| 220 | |
| 221 | enum ipsec_sad_flags |
| 222 | { |
| 223 | IPSEC_API_SAD_FLAG_NONE = 0, |
| 224 | /* Enable extended sequence numbers */ |
Damjan Marion | 1e3aa5e | 2019-03-28 10:58:59 +0100 | [diff] [blame] | 225 | IPSEC_API_SAD_FLAG_USE_ESN = 0x01, |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 226 | /* Enable Anti-replay */ |
| 227 | IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY = 0x02, |
| 228 | /* IPsec tunnel mode if non-zero, else transport mode */ |
| 229 | IPSEC_API_SAD_FLAG_IS_TUNNEL = 0x04, |
| 230 | /* IPsec tunnel mode is IPv6 if non-zero, |
| 231 | * else IPv4 tunnel only valid if is_tunnel is non-zero */ |
| 232 | IPSEC_API_SAD_FLAG_IS_TUNNEL_V6 = 0x08, |
| 233 | /* enable UDP encapsulation for NAT traversal */ |
| 234 | IPSEC_API_SAD_FLAG_UDP_ENCAP = 0x10, |
| 235 | }; |
| 236 | |
| 237 | enum ipsec_proto |
| 238 | { |
| 239 | IPSEC_API_PROTO_ESP, |
| 240 | IPSEC_API_PROTO_AH, |
| 241 | }; |
| 242 | |
| 243 | typedef key |
| 244 | { |
| 245 | /* the length of the key */ |
| 246 | u8 length; |
| 247 | /* The data for the key */ |
| 248 | u8 data[128]; |
| 249 | }; |
| 250 | |
| 251 | /** \brief IPsec: Security Association Database entry |
| 252 | @param client_index - opaque cookie to identify the sender |
| 253 | @param context - sender context, to match reply w/ request |
| 254 | @param is_add - add SAD entry if non-zero, else delete |
| 255 | @param sad_id - sad id |
| 256 | @param spi - security parameter index |
| 257 | @param protocol - 0 = AH, 1 = ESP |
| 258 | @param crypto_algorithm - a supported crypto algorithm |
| 259 | @param crypto_key - crypto keying material |
| 260 | @param integrity_algorithm - one of the supported algorithms |
| 261 | @param integrity_key - integrity keying material |
| 262 | @param tunnel_src_address - IPsec tunnel source address IPv6 if is_tunnel_ipv6 is non-zero, else IPv4. Only valid if is_tunnel is non-zero |
| 263 | @param tunnel_dst_address - IPsec tunnel destination address IPv6 if is_tunnel_ipv6 is non-zero, else IPv4. Only valid if is_tunnel is non-zero |
Neale Ranns | 8d7c502 | 2019-02-06 01:41:05 -0800 | [diff] [blame] | 264 | @param tx_table_id - the FIB id used for encapsulated packets |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 265 | @param salt - for use with counter mode ciphers |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 266 | */ |
| 267 | typedef ipsec_sad_entry |
| 268 | { |
| 269 | u32 sad_id; |
| 270 | |
| 271 | u32 spi; |
| 272 | |
| 273 | vl_api_ipsec_proto_t protocol; |
| 274 | |
| 275 | vl_api_ipsec_crypto_alg_t crypto_algorithm; |
| 276 | vl_api_key_t crypto_key; |
| 277 | |
| 278 | vl_api_ipsec_integ_alg_t integrity_algorithm; |
| 279 | vl_api_key_t integrity_key; |
| 280 | |
| 281 | vl_api_ipsec_sad_flags_t flags; |
| 282 | |
| 283 | vl_api_address_t tunnel_src; |
| 284 | vl_api_address_t tunnel_dst; |
Neale Ranns | 8d7c502 | 2019-02-06 01:41:05 -0800 | [diff] [blame] | 285 | u32 tx_table_id; |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 286 | u32 salt; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 287 | }; |
| 288 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 289 | /** \brief IPsec: Add/delete Security Association Database entry |
| 290 | @param client_index - opaque cookie to identify the sender |
| 291 | @param context - sender context, to match reply w/ request |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 292 | @param entry - Entry to add or delete |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 293 | */ |
Neale Ranns | eba31ec | 2019-02-17 18:04:27 +0000 | [diff] [blame] | 294 | define ipsec_sad_entry_add_del |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 295 | { |
| 296 | u32 client_index; |
| 297 | u32 context; |
| 298 | u8 is_add; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 299 | vl_api_ipsec_sad_entry_t entry; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 300 | }; |
Neale Ranns | eba31ec | 2019-02-17 18:04:27 +0000 | [diff] [blame] | 301 | define ipsec_sad_entry_add_del_reply |
| 302 | { |
| 303 | u32 context; |
| 304 | i32 retval; |
| 305 | u32 stat_index; |
| 306 | }; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 307 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 308 | /** \brief IPsec: Update Security Association keys |
| 309 | @param client_index - opaque cookie to identify the sender |
| 310 | @param context - sender context, to match reply w/ request |
| 311 | |
| 312 | @param sa_id - sa id |
| 313 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 314 | @param crypto_key - crypto keying material |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 315 | @param integrity_key - integrity keying material |
| 316 | */ |
| 317 | |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 318 | autoreply define ipsec_sa_set_key |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 319 | { |
| 320 | u32 client_index; |
| 321 | u32 context; |
| 322 | |
| 323 | u32 sa_id; |
| 324 | |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 325 | vl_api_key_t crypto_key; |
| 326 | vl_api_key_t integrity_key; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 327 | }; |
| 328 | |
Filip Varga | 871bca9 | 2018-11-02 13:51:44 +0100 | [diff] [blame] | 329 | /** \brief IPsec: Get SPD interfaces |
| 330 | @param client_index - opaque cookie to identify the sender |
| 331 | @param context - sender context, to match reply w/ request |
| 332 | @param spd_index - SPD index |
| 333 | @param spd_index_valid - if 1 spd_index is used to filter |
| 334 | spd_index's, if 0 no filtering is done |
| 335 | */ |
| 336 | define ipsec_spd_interface_dump { |
| 337 | u32 client_index; |
| 338 | u32 context; |
| 339 | u32 spd_index; |
| 340 | u8 spd_index_valid; |
| 341 | }; |
| 342 | |
| 343 | /** \brief IPsec: SPD interface response |
| 344 | @param context - sender context which was passed in the request |
| 345 | @param spd_index - SPD index |
| 346 | @param sw_if_index - index of the interface |
| 347 | */ |
| 348 | define ipsec_spd_interface_details { |
| 349 | u32 context; |
| 350 | u32 spd_index; |
| 351 | u32 sw_if_index; |
| 352 | }; |
| 353 | |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 354 | /** \brief Add or delete IPsec tunnel interface |
| 355 | @param client_index - opaque cookie to identify the sender |
| 356 | @param context - sender context, to match reply w/ request |
| 357 | @param is_add - add IPsec tunnel interface if nonzero, else delete |
Kingwel Xie | 1ba5bc8 | 2019-03-20 07:21:58 -0400 | [diff] [blame] | 358 | @param is_ip6 - tunnel v6 or v4 |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 359 | @param esn - enable extended sequence numbers if nonzero, else disable |
| 360 | @param anti_replay - enable anti replay check if nonzero, else disable |
| 361 | @param local_ip - local IP address |
| 362 | @param remote_ip - IP address of remote IPsec peer |
| 363 | @param local_spi - SPI of outbound IPsec SA |
| 364 | @param remote_spi - SPI of inbound IPsec SA |
| 365 | @param crypto_alg - encryption algorithm ID |
| 366 | @param local_crypto_key_len - length of local crypto key in bytes |
| 367 | @param local_crypto_key - crypto key for outbound IPsec SA |
| 368 | @param remote_crypto_key_len - length of remote crypto key in bytes |
| 369 | @param remote_crypto_key - crypto key for inbound IPsec SA |
| 370 | @param integ_alg - integrity algorithm ID |
| 371 | @param local_integ_key_len - length of local integrity key in bytes |
| 372 | @param local_integ_key - integrity key for outbound IPsec SA |
| 373 | @param remote_integ_key_len - length of remote integrity key in bytes |
| 374 | @param remote_integ_key - integrity key for inbound IPsec SA |
Matthew Smith | 8e1039a | 2018-04-12 07:32:56 -0500 | [diff] [blame] | 375 | @param renumber - intf display name uses a specified instance if != 0 |
| 376 | @param show_instance - instance to display for intf if renumber is set |
Filip Tehlar | b4a7a7d | 2018-11-30 07:27:27 -0800 | [diff] [blame] | 377 | @param udp_encap - enable UDP encapsulation for NAT traversal |
Pierre Pfister | 4c422f9 | 2018-12-10 11:19:08 +0100 | [diff] [blame] | 378 | @param tx_table_id - the FIB id used after packet encap |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 379 | @param salt - for use with counter mode ciphers |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 380 | */ |
Matthew Smith | e04d09d | 2017-05-14 21:47:18 -0500 | [diff] [blame] | 381 | define ipsec_tunnel_if_add_del { |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 382 | u32 client_index; |
| 383 | u32 context; |
| 384 | u8 is_add; |
| 385 | u8 esn; |
| 386 | u8 anti_replay; |
Kingwel Xie | 1ba5bc8 | 2019-03-20 07:21:58 -0400 | [diff] [blame] | 387 | vl_api_address_t local_ip; |
| 388 | vl_api_address_t remote_ip; |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 389 | u32 local_spi; |
| 390 | u32 remote_spi; |
| 391 | u8 crypto_alg; |
| 392 | u8 local_crypto_key_len; |
| 393 | u8 local_crypto_key[128]; |
| 394 | u8 remote_crypto_key_len; |
| 395 | u8 remote_crypto_key[128]; |
| 396 | u8 integ_alg; |
| 397 | u8 local_integ_key_len; |
| 398 | u8 local_integ_key[128]; |
| 399 | u8 remote_integ_key_len; |
| 400 | u8 remote_integ_key[128]; |
Matthew Smith | 8e1039a | 2018-04-12 07:32:56 -0500 | [diff] [blame] | 401 | u8 renumber; |
| 402 | u32 show_instance; |
Filip Tehlar | b4a7a7d | 2018-11-30 07:27:27 -0800 | [diff] [blame] | 403 | u8 udp_encap; |
Pierre Pfister | 4c422f9 | 2018-12-10 11:19:08 +0100 | [diff] [blame] | 404 | u32 tx_table_id; |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 405 | u32 salt; |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 406 | }; |
| 407 | |
Matthew Smith | e04d09d | 2017-05-14 21:47:18 -0500 | [diff] [blame] | 408 | /** \brief Add/delete IPsec tunnel interface response |
| 409 | @param context - sender context, to match reply w/ request |
| 410 | @param retval - return status |
| 411 | @param sw_if_index - sw_if_index of new interface (for successful add) |
| 412 | */ |
| 413 | define ipsec_tunnel_if_add_del_reply { |
| 414 | u32 context; |
| 415 | i32 retval; |
| 416 | u32 sw_if_index; |
| 417 | }; |
| 418 | |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 419 | /** \brief Dump IPsec security association |
| 420 | @param client_index - opaque cookie to identify the sender |
| 421 | @param context - sender context, to match reply w/ request |
| 422 | @param sa_id - optional ID of an SA to dump, if ~0 dump all SAs in SAD |
| 423 | */ |
| 424 | define ipsec_sa_dump { |
| 425 | u32 client_index; |
| 426 | u32 context; |
| 427 | u32 sa_id; |
| 428 | }; |
| 429 | |
| 430 | /** \brief IPsec security association database response |
| 431 | @param context - sender context which was passed in the request |
| 432 | @param sa_id - SA ID, policy-based SAs >=0, tunnel interface SAs = 0 |
| 433 | @param sw_if_index - sw_if_index of tunnel interface, policy-based SAs = ~0 |
| 434 | @param spi - security parameter index |
| 435 | @param protocol - IPsec protocol (value from ipsec_protocol_t) |
| 436 | @param crypto_alg - crypto algorithm (value from ipsec_crypto_alg_t) |
| 437 | @param crypto_key_len - length of crypto_key in bytes |
| 438 | @param crypto_key - crypto keying material |
| 439 | @param integ_alg - integrity algorithm (value from ipsec_integ_alg_t) |
| 440 | @param integ_key_len - length of integ_key in bytes |
| 441 | @param integ_key - integrity keying material |
| 442 | @param use_esn - using extended sequence numbers when non-zero |
| 443 | @param use_anti_replay - using anti-replay window when non-zero |
| 444 | @param is_tunnel - IPsec tunnel mode when non-zero, else transport mode |
| 445 | @param is_tunnel_ipv6 - If using tunnel mode, endpoints are IPv6 |
| 446 | @param tunnel_src_addr - Tunnel source address if using tunnel mode |
| 447 | @param tunnel_dst_addr - Tunnel destination address is using tunnel mode |
| 448 | @param salt - 4 byte salt |
| 449 | @param seq - current sequence number for outbound |
| 450 | @param seq_hi - high 32 bits of ESN for outbound |
| 451 | @param last_seq - highest sequence number received inbound |
| 452 | @param last_seq_hi - high 32 bits of highest ESN received inbound |
| 453 | @param replay_window - bit map of seq nums received relative to last_seq if using anti-replay |
| 454 | @param total_data_size - total bytes sent or received |
Klement Sekera | 4b089f2 | 2018-04-17 18:04:57 +0200 | [diff] [blame] | 455 | @param udp_encap - 1 if UDP encap enabled, 0 otherwise |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 456 | */ |
| 457 | define ipsec_sa_details { |
| 458 | u32 context; |
Neale Ranns | 8d7c502 | 2019-02-06 01:41:05 -0800 | [diff] [blame] | 459 | vl_api_ipsec_sad_entry_t entry; |
| 460 | |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 461 | u32 sw_if_index; |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 462 | u32 salt; |
| 463 | u64 seq_outbound; |
| 464 | u64 last_seq_inbound; |
| 465 | u64 replay_window; |
| 466 | |
| 467 | u64 total_data_size; |
| 468 | }; |
| 469 | |
Matthew Smith | 75d8560 | 2017-10-05 19:03:05 -0500 | [diff] [blame] | 470 | /** \brief Set key on IPsec interface |
| 471 | @param client_index - opaque cookie to identify the sender |
| 472 | @param context - sender context, to match reply w/ request |
| 473 | @param sw_if_index - index of tunnel interface |
| 474 | @param key_type - type of key being set |
| 475 | @param alg - algorithm used with key |
| 476 | @param key_len - length key in bytes |
| 477 | @param key - key |
| 478 | */ |
| 479 | autoreply define ipsec_tunnel_if_set_key { |
| 480 | u32 client_index; |
| 481 | u32 context; |
| 482 | u32 sw_if_index; |
| 483 | u8 key_type; |
| 484 | u8 alg; |
| 485 | u8 key_len; |
| 486 | u8 key[128]; |
| 487 | }; |
| 488 | |
Matthew Smith | ca514fd | 2017-10-12 12:06:59 -0500 | [diff] [blame] | 489 | /** \brief Set new SA on IPsec interface |
| 490 | @param client_index - opaque cookie to identify the sender |
| 491 | @param context - sender context, to match reply w/ request |
| 492 | @param sw_if_index - index of tunnel interface |
| 493 | @param sa_id - ID of SA to use |
| 494 | @param is_outbound - 1 if outbound (local) SA, 0 if inbound (remote) |
| 495 | */ |
| 496 | autoreply define ipsec_tunnel_if_set_sa { |
| 497 | u32 client_index; |
| 498 | u32 context; |
| 499 | u32 sw_if_index; |
| 500 | u32 sa_id; |
| 501 | u8 is_outbound; |
| 502 | }; |
| 503 | |
Klement Sekera | b4d3053 | 2018-11-08 13:00:02 +0100 | [diff] [blame] | 504 | /** \brief Dump IPsec backends |
| 505 | @param client_index - opaque cookie to identify the sender |
| 506 | @param context - sender context, to match reply w/ request |
| 507 | */ |
| 508 | define ipsec_backend_dump { |
| 509 | u32 client_index; |
| 510 | u32 context; |
| 511 | }; |
| 512 | |
| 513 | /** \brief IPsec backend details |
| 514 | @param name - name of the backend |
| 515 | @param protocol - IPsec protocol (value from ipsec_protocol_t) |
| 516 | @param index - backend index |
| 517 | @param active - set to 1 if the backend is active, otherwise 0 |
| 518 | */ |
| 519 | define ipsec_backend_details { |
| 520 | u32 context; |
| 521 | u8 name[128]; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 522 | vl_api_ipsec_proto_t protocol; |
Klement Sekera | b4d3053 | 2018-11-08 13:00:02 +0100 | [diff] [blame] | 523 | u8 index; |
| 524 | u8 active; |
| 525 | }; |
| 526 | |
| 527 | /** \brief Select IPsec backend |
| 528 | @param client_index - opaque cookie to identify the sender |
| 529 | @param context - sender context, to match reply w/ request |
| 530 | @param protocol - IPsec protocol (value from ipsec_protocol_t) |
| 531 | @param index - backend index |
| 532 | */ |
| 533 | autoreply define ipsec_select_backend { |
| 534 | u32 client_index; |
| 535 | u32 context; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 536 | vl_api_ipsec_proto_t protocol; |
Klement Sekera | b4d3053 | 2018-11-08 13:00:02 +0100 | [diff] [blame] | 537 | u8 index; |
| 538 | }; |
| 539 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 540 | /* |
| 541 | * Local Variables: |
| 542 | * eval: (c-set-style "gnu") |
| 543 | * End: |
| 544 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 545 | |