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 */ |
| 225 | IPSEC_API_SAD_FLAG_USE_EXTENDED_SEQ_NUM = 0x01, |
| 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, |
Neale Ranns | 8d7c502 | 2019-02-06 01:41:05 -0800 | [diff] [blame] | 235 | |
| 236 | /* come-on Ole please fix this */ |
| 237 | IPSEC_API_SAD_COMBO_12 = 12, |
| 238 | IPSEC_API_SAD_COMBO_20 = 20, |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 239 | }; |
| 240 | |
| 241 | enum ipsec_proto |
| 242 | { |
| 243 | IPSEC_API_PROTO_ESP, |
| 244 | IPSEC_API_PROTO_AH, |
| 245 | }; |
| 246 | |
| 247 | typedef key |
| 248 | { |
| 249 | /* the length of the key */ |
| 250 | u8 length; |
| 251 | /* The data for the key */ |
| 252 | u8 data[128]; |
| 253 | }; |
| 254 | |
| 255 | /** \brief IPsec: Security Association Database entry |
| 256 | @param client_index - opaque cookie to identify the sender |
| 257 | @param context - sender context, to match reply w/ request |
| 258 | @param is_add - add SAD entry if non-zero, else delete |
| 259 | @param sad_id - sad id |
| 260 | @param spi - security parameter index |
| 261 | @param protocol - 0 = AH, 1 = ESP |
| 262 | @param crypto_algorithm - a supported crypto algorithm |
| 263 | @param crypto_key - crypto keying material |
| 264 | @param integrity_algorithm - one of the supported algorithms |
| 265 | @param integrity_key - integrity keying material |
| 266 | @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 |
| 267 | @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] | 268 | @param tx_table_id - the FIB id used for encapsulated packets |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 269 | */ |
| 270 | typedef ipsec_sad_entry |
| 271 | { |
| 272 | u32 sad_id; |
| 273 | |
| 274 | u32 spi; |
| 275 | |
| 276 | vl_api_ipsec_proto_t protocol; |
| 277 | |
| 278 | vl_api_ipsec_crypto_alg_t crypto_algorithm; |
| 279 | vl_api_key_t crypto_key; |
| 280 | |
| 281 | vl_api_ipsec_integ_alg_t integrity_algorithm; |
| 282 | vl_api_key_t integrity_key; |
| 283 | |
| 284 | vl_api_ipsec_sad_flags_t flags; |
| 285 | |
| 286 | vl_api_address_t tunnel_src; |
| 287 | vl_api_address_t tunnel_dst; |
Neale Ranns | 8d7c502 | 2019-02-06 01:41:05 -0800 | [diff] [blame] | 288 | u32 tx_table_id; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 289 | }; |
| 290 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 291 | /** \brief IPsec: Add/delete Security Association Database entry |
| 292 | @param client_index - opaque cookie to identify the sender |
| 293 | @param context - sender context, to match reply w/ request |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 294 | @param entry - Entry to add or delete |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 295 | */ |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 296 | autoreply define ipsec_sad_entry_add_del |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 297 | { |
| 298 | u32 client_index; |
| 299 | u32 context; |
| 300 | u8 is_add; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 301 | vl_api_ipsec_sad_entry_t entry; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 302 | }; |
| 303 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 304 | /** \brief IPsec: Update Security Association keys |
| 305 | @param client_index - opaque cookie to identify the sender |
| 306 | @param context - sender context, to match reply w/ request |
| 307 | |
| 308 | @param sa_id - sa id |
| 309 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 310 | @param crypto_key - crypto keying material |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 311 | @param integrity_key - integrity keying material |
| 312 | */ |
| 313 | |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 314 | autoreply define ipsec_sa_set_key |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 315 | { |
| 316 | u32 client_index; |
| 317 | u32 context; |
| 318 | |
| 319 | u32 sa_id; |
| 320 | |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 321 | vl_api_key_t crypto_key; |
| 322 | vl_api_key_t integrity_key; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 323 | }; |
| 324 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 325 | /** \brief IKEv2: Add/delete profile |
| 326 | @param client_index - opaque cookie to identify the sender |
| 327 | @param context - sender context, to match reply w/ request |
| 328 | |
| 329 | @param name - IKEv2 profile name |
| 330 | @param is_add - Add IKEv2 profile if non-zero, else delete |
| 331 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 332 | autoreply define ikev2_profile_add_del |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 333 | { |
| 334 | u32 client_index; |
| 335 | u32 context; |
| 336 | |
| 337 | u8 name[64]; |
| 338 | u8 is_add; |
| 339 | }; |
| 340 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 341 | /** \brief IKEv2: Set IKEv2 profile authentication method |
| 342 | @param client_index - opaque cookie to identify the sender |
| 343 | @param context - sender context, to match reply w/ request |
| 344 | |
| 345 | @param name - IKEv2 profile name |
| 346 | @param auth_method - IKEv2 authentication method (shared-key-mic/rsa-sig) |
| 347 | @param is_hex - Authentication data in hex format if non-zero, else string |
| 348 | @param data_len - Authentication data length |
| 349 | @param data - Authentication data (for rsa-sig cert file path) |
| 350 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 351 | autoreply define ikev2_profile_set_auth |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 352 | { |
| 353 | u32 client_index; |
| 354 | u32 context; |
| 355 | |
| 356 | u8 name[64]; |
| 357 | u8 auth_method; |
| 358 | u8 is_hex; |
| 359 | u32 data_len; |
Juraj Sloboda | e9fcf23 | 2018-04-23 10:14:37 +0200 | [diff] [blame] | 360 | u8 data[data_len]; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 361 | }; |
| 362 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 363 | /** \brief IKEv2: Set IKEv2 profile local/remote identification |
| 364 | @param client_index - opaque cookie to identify the sender |
| 365 | @param context - sender context, to match reply w/ request |
| 366 | |
| 367 | @param name - IKEv2 profile name |
| 368 | @param is_local - Identification is local if non-zero, else remote |
| 369 | @param id_type - Identification type |
| 370 | @param data_len - Identification data length |
| 371 | @param data - Identification data |
| 372 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 373 | autoreply define ikev2_profile_set_id |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 374 | { |
| 375 | u32 client_index; |
| 376 | u32 context; |
| 377 | |
| 378 | u8 name[64]; |
| 379 | u8 is_local; |
| 380 | u8 id_type; |
| 381 | u32 data_len; |
Juraj Sloboda | e9fcf23 | 2018-04-23 10:14:37 +0200 | [diff] [blame] | 382 | u8 data[data_len]; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 383 | }; |
| 384 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 385 | /** \brief IKEv2: Set IKEv2 profile traffic selector parameters |
| 386 | @param client_index - opaque cookie to identify the sender |
| 387 | @param context - sender context, to match reply w/ request |
| 388 | |
| 389 | @param name - IKEv2 profile name |
| 390 | @param is_local - Traffic selector is local if non-zero, else remote |
| 391 | @param proto - Traffic selector IP protocol (if zero not relevant) |
| 392 | @param start_port - The smallest port number allowed by traffic selector |
| 393 | @param end_port - The largest port number allowed by traffic selector |
| 394 | @param start_addr - The smallest address included in traffic selector |
| 395 | @param end_addr - The largest address included in traffic selector |
| 396 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 397 | autoreply define ikev2_profile_set_ts |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 398 | { |
| 399 | u32 client_index; |
| 400 | u32 context; |
| 401 | |
| 402 | u8 name[64]; |
| 403 | u8 is_local; |
| 404 | u8 proto; |
| 405 | u16 start_port; |
| 406 | u16 end_port; |
| 407 | u32 start_addr; |
| 408 | u32 end_addr; |
| 409 | }; |
| 410 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 411 | /** \brief IKEv2: Set IKEv2 local RSA private key |
| 412 | @param client_index - opaque cookie to identify the sender |
| 413 | @param context - sender context, to match reply w/ request |
| 414 | |
| 415 | @param key_file - Key file absolute path |
| 416 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 417 | autoreply define ikev2_set_local_key |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 418 | { |
| 419 | u32 client_index; |
| 420 | u32 context; |
| 421 | |
| 422 | u8 key_file[256]; |
| 423 | }; |
| 424 | |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 425 | /** \brief IKEv2: Set IKEv2 responder interface and IP address |
| 426 | @param client_index - opaque cookie to identify the sender |
| 427 | @param context - sender context, to match reply w/ request |
| 428 | |
| 429 | @param name - IKEv2 profile name |
| 430 | @param sw_if_index - interface index |
| 431 | @param address - interface address |
| 432 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 433 | autoreply define ikev2_set_responder |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 434 | { |
| 435 | u32 client_index; |
| 436 | u32 context; |
| 437 | |
| 438 | u8 name[64]; |
| 439 | u32 sw_if_index; |
| 440 | u8 address[4]; |
| 441 | }; |
| 442 | |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 443 | /** \brief IKEv2: Set IKEv2 IKE transforms in SA_INIT proposal (RFC 7296) |
| 444 | @param client_index - opaque cookie to identify the sender |
| 445 | @param context - sender context, to match reply w/ request |
| 446 | |
| 447 | @param name - IKEv2 profile name |
| 448 | @param crypto_alg - encryption algorithm |
| 449 | @param crypto_key_size - encryption key size |
| 450 | @param integ_alg - integrity algorithm |
| 451 | @param dh_group - Diffie-Hellman group |
| 452 | |
| 453 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 454 | autoreply define ikev2_set_ike_transforms |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 455 | { |
| 456 | u32 client_index; |
| 457 | u32 context; |
| 458 | |
| 459 | u8 name[64]; |
| 460 | u32 crypto_alg; |
| 461 | u32 crypto_key_size; |
| 462 | u32 integ_alg; |
| 463 | u32 dh_group; |
| 464 | }; |
| 465 | |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 466 | /** \brief IKEv2: Set IKEv2 ESP transforms in SA_INIT proposal (RFC 7296) |
| 467 | @param client_index - opaque cookie to identify the sender |
| 468 | @param context - sender context, to match reply w/ request |
| 469 | |
| 470 | @param name - IKEv2 profile name |
| 471 | @param crypto_alg - encryption algorithm |
| 472 | @param crypto_key_size - encryption key size |
| 473 | @param integ_alg - integrity algorithm |
| 474 | @param dh_group - Diffie-Hellman group |
| 475 | |
| 476 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 477 | autoreply define ikev2_set_esp_transforms |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 478 | { |
| 479 | u32 client_index; |
| 480 | u32 context; |
| 481 | |
| 482 | u8 name[64]; |
| 483 | u32 crypto_alg; |
| 484 | u32 crypto_key_size; |
| 485 | u32 integ_alg; |
| 486 | u32 dh_group; |
| 487 | }; |
| 488 | |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 489 | /** \brief IKEv2: Set Child SA lifetime, limited by time and/or data |
| 490 | @param client_index - opaque cookie to identify the sender |
| 491 | @param context - sender context, to match reply w/ request |
| 492 | |
| 493 | @param name - IKEv2 profile name |
| 494 | @param lifetime - SA maximum life time in seconds (0 to disable) |
Paul Vinciguerra | bdc0e6b | 2018-09-22 05:32:50 -0700 | [diff] [blame] | 495 | @param lifetime_jitter - Jitter added to prevent simultaneous rekeying |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 496 | @param handover - Hand over time |
| 497 | @param lifetime_maxdata - SA maximum life time in bytes (0 to disable) |
| 498 | |
| 499 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 500 | autoreply define ikev2_set_sa_lifetime |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 501 | { |
| 502 | u32 client_index; |
| 503 | u32 context; |
| 504 | |
| 505 | u8 name[64]; |
| 506 | u64 lifetime; |
| 507 | u32 lifetime_jitter; |
| 508 | u32 handover; |
| 509 | u64 lifetime_maxdata; |
| 510 | }; |
| 511 | |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 512 | /** \brief IKEv2: Initiate the SA_INIT exchange |
| 513 | @param client_index - opaque cookie to identify the sender |
| 514 | @param context - sender context, to match reply w/ request |
| 515 | |
| 516 | @param name - IKEv2 profile name |
| 517 | |
| 518 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 519 | autoreply define ikev2_initiate_sa_init |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 520 | { |
| 521 | u32 client_index; |
| 522 | u32 context; |
| 523 | |
| 524 | u8 name[64]; |
| 525 | }; |
| 526 | |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 527 | /** \brief IKEv2: Initiate the delete IKE SA exchange |
| 528 | @param client_index - opaque cookie to identify the sender |
| 529 | @param context - sender context, to match reply w/ request |
| 530 | |
| 531 | @param ispi - IKE SA initiator SPI |
| 532 | |
| 533 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 534 | autoreply define ikev2_initiate_del_ike_sa |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 535 | { |
| 536 | u32 client_index; |
| 537 | u32 context; |
| 538 | |
| 539 | u64 ispi; |
| 540 | }; |
| 541 | |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 542 | /** \brief IKEv2: Initiate the delete Child SA exchange |
| 543 | @param client_index - opaque cookie to identify the sender |
| 544 | @param context - sender context, to match reply w/ request |
| 545 | |
| 546 | @param ispi - Child SA initiator SPI |
| 547 | |
| 548 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 549 | autoreply define ikev2_initiate_del_child_sa |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 550 | { |
| 551 | u32 client_index; |
| 552 | u32 context; |
| 553 | |
| 554 | u32 ispi; |
| 555 | }; |
| 556 | |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 557 | /** \brief IKEv2: Initiate the rekey Child SA exchange |
| 558 | @param client_index - opaque cookie to identify the sender |
| 559 | @param context - sender context, to match reply w/ request |
| 560 | |
| 561 | @param ispi - Child SA initiator SPI |
| 562 | |
| 563 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 564 | autoreply define ikev2_initiate_rekey_child_sa |
Radu Nicolau | cb33dc2 | 2017-02-16 16:49:46 +0000 | [diff] [blame] | 565 | { |
| 566 | u32 client_index; |
| 567 | u32 context; |
| 568 | |
| 569 | u32 ispi; |
| 570 | }; |
| 571 | |
Filip Varga | 871bca9 | 2018-11-02 13:51:44 +0100 | [diff] [blame] | 572 | /** \brief IPsec: Get SPD interfaces |
| 573 | @param client_index - opaque cookie to identify the sender |
| 574 | @param context - sender context, to match reply w/ request |
| 575 | @param spd_index - SPD index |
| 576 | @param spd_index_valid - if 1 spd_index is used to filter |
| 577 | spd_index's, if 0 no filtering is done |
| 578 | */ |
| 579 | define ipsec_spd_interface_dump { |
| 580 | u32 client_index; |
| 581 | u32 context; |
| 582 | u32 spd_index; |
| 583 | u8 spd_index_valid; |
| 584 | }; |
| 585 | |
| 586 | /** \brief IPsec: SPD interface response |
| 587 | @param context - sender context which was passed in the request |
| 588 | @param spd_index - SPD index |
| 589 | @param sw_if_index - index of the interface |
| 590 | */ |
| 591 | define ipsec_spd_interface_details { |
| 592 | u32 context; |
| 593 | u32 spd_index; |
| 594 | u32 sw_if_index; |
| 595 | }; |
| 596 | |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 597 | /** \brief Add or delete IPsec tunnel interface |
| 598 | @param client_index - opaque cookie to identify the sender |
| 599 | @param context - sender context, to match reply w/ request |
| 600 | @param is_add - add IPsec tunnel interface if nonzero, else delete |
| 601 | @param esn - enable extended sequence numbers if nonzero, else disable |
| 602 | @param anti_replay - enable anti replay check if nonzero, else disable |
| 603 | @param local_ip - local IP address |
| 604 | @param remote_ip - IP address of remote IPsec peer |
| 605 | @param local_spi - SPI of outbound IPsec SA |
| 606 | @param remote_spi - SPI of inbound IPsec SA |
| 607 | @param crypto_alg - encryption algorithm ID |
| 608 | @param local_crypto_key_len - length of local crypto key in bytes |
| 609 | @param local_crypto_key - crypto key for outbound IPsec SA |
| 610 | @param remote_crypto_key_len - length of remote crypto key in bytes |
| 611 | @param remote_crypto_key - crypto key for inbound IPsec SA |
| 612 | @param integ_alg - integrity algorithm ID |
| 613 | @param local_integ_key_len - length of local integrity key in bytes |
| 614 | @param local_integ_key - integrity key for outbound IPsec SA |
| 615 | @param remote_integ_key_len - length of remote integrity key in bytes |
| 616 | @param remote_integ_key - integrity key for inbound IPsec SA |
Matthew Smith | 8e1039a | 2018-04-12 07:32:56 -0500 | [diff] [blame] | 617 | @param renumber - intf display name uses a specified instance if != 0 |
| 618 | @param show_instance - instance to display for intf if renumber is set |
Filip Tehlar | b4a7a7d | 2018-11-30 07:27:27 -0800 | [diff] [blame] | 619 | @param udp_encap - enable UDP encapsulation for NAT traversal |
Pierre Pfister | 4c422f9 | 2018-12-10 11:19:08 +0100 | [diff] [blame] | 620 | @param tx_table_id - the FIB id used after packet encap |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 621 | */ |
Matthew Smith | e04d09d | 2017-05-14 21:47:18 -0500 | [diff] [blame] | 622 | define ipsec_tunnel_if_add_del { |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 623 | u32 client_index; |
| 624 | u32 context; |
| 625 | u8 is_add; |
| 626 | u8 esn; |
| 627 | u8 anti_replay; |
| 628 | u8 local_ip[4]; |
| 629 | u8 remote_ip[4]; |
| 630 | u32 local_spi; |
| 631 | u32 remote_spi; |
| 632 | u8 crypto_alg; |
| 633 | u8 local_crypto_key_len; |
| 634 | u8 local_crypto_key[128]; |
| 635 | u8 remote_crypto_key_len; |
| 636 | u8 remote_crypto_key[128]; |
| 637 | u8 integ_alg; |
| 638 | u8 local_integ_key_len; |
| 639 | u8 local_integ_key[128]; |
| 640 | u8 remote_integ_key_len; |
| 641 | u8 remote_integ_key[128]; |
Matthew Smith | 8e1039a | 2018-04-12 07:32:56 -0500 | [diff] [blame] | 642 | u8 renumber; |
| 643 | u32 show_instance; |
Filip Tehlar | b4a7a7d | 2018-11-30 07:27:27 -0800 | [diff] [blame] | 644 | u8 udp_encap; |
Pierre Pfister | 4c422f9 | 2018-12-10 11:19:08 +0100 | [diff] [blame] | 645 | u32 tx_table_id; |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 646 | }; |
| 647 | |
Matthew Smith | e04d09d | 2017-05-14 21:47:18 -0500 | [diff] [blame] | 648 | /** \brief Add/delete IPsec tunnel interface response |
| 649 | @param context - sender context, to match reply w/ request |
| 650 | @param retval - return status |
| 651 | @param sw_if_index - sw_if_index of new interface (for successful add) |
| 652 | */ |
| 653 | define ipsec_tunnel_if_add_del_reply { |
| 654 | u32 context; |
| 655 | i32 retval; |
| 656 | u32 sw_if_index; |
| 657 | }; |
| 658 | |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 659 | /** \brief Dump IPsec security association |
| 660 | @param client_index - opaque cookie to identify the sender |
| 661 | @param context - sender context, to match reply w/ request |
| 662 | @param sa_id - optional ID of an SA to dump, if ~0 dump all SAs in SAD |
| 663 | */ |
| 664 | define ipsec_sa_dump { |
| 665 | u32 client_index; |
| 666 | u32 context; |
| 667 | u32 sa_id; |
| 668 | }; |
| 669 | |
| 670 | /** \brief IPsec security association database response |
| 671 | @param context - sender context which was passed in the request |
| 672 | @param sa_id - SA ID, policy-based SAs >=0, tunnel interface SAs = 0 |
| 673 | @param sw_if_index - sw_if_index of tunnel interface, policy-based SAs = ~0 |
| 674 | @param spi - security parameter index |
| 675 | @param protocol - IPsec protocol (value from ipsec_protocol_t) |
| 676 | @param crypto_alg - crypto algorithm (value from ipsec_crypto_alg_t) |
| 677 | @param crypto_key_len - length of crypto_key in bytes |
| 678 | @param crypto_key - crypto keying material |
| 679 | @param integ_alg - integrity algorithm (value from ipsec_integ_alg_t) |
| 680 | @param integ_key_len - length of integ_key in bytes |
| 681 | @param integ_key - integrity keying material |
| 682 | @param use_esn - using extended sequence numbers when non-zero |
| 683 | @param use_anti_replay - using anti-replay window when non-zero |
| 684 | @param is_tunnel - IPsec tunnel mode when non-zero, else transport mode |
| 685 | @param is_tunnel_ipv6 - If using tunnel mode, endpoints are IPv6 |
| 686 | @param tunnel_src_addr - Tunnel source address if using tunnel mode |
| 687 | @param tunnel_dst_addr - Tunnel destination address is using tunnel mode |
| 688 | @param salt - 4 byte salt |
| 689 | @param seq - current sequence number for outbound |
| 690 | @param seq_hi - high 32 bits of ESN for outbound |
| 691 | @param last_seq - highest sequence number received inbound |
| 692 | @param last_seq_hi - high 32 bits of highest ESN received inbound |
| 693 | @param replay_window - bit map of seq nums received relative to last_seq if using anti-replay |
| 694 | @param total_data_size - total bytes sent or received |
Klement Sekera | 4b089f2 | 2018-04-17 18:04:57 +0200 | [diff] [blame] | 695 | @param udp_encap - 1 if UDP encap enabled, 0 otherwise |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 696 | */ |
| 697 | define ipsec_sa_details { |
| 698 | u32 context; |
Neale Ranns | 8d7c502 | 2019-02-06 01:41:05 -0800 | [diff] [blame] | 699 | vl_api_ipsec_sad_entry_t entry; |
| 700 | |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 701 | u32 sw_if_index; |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 702 | u32 salt; |
| 703 | u64 seq_outbound; |
| 704 | u64 last_seq_inbound; |
| 705 | u64 replay_window; |
| 706 | |
| 707 | u64 total_data_size; |
| 708 | }; |
| 709 | |
Matthew Smith | 75d8560 | 2017-10-05 19:03:05 -0500 | [diff] [blame] | 710 | /** \brief Set key on IPsec interface |
| 711 | @param client_index - opaque cookie to identify the sender |
| 712 | @param context - sender context, to match reply w/ request |
| 713 | @param sw_if_index - index of tunnel interface |
| 714 | @param key_type - type of key being set |
| 715 | @param alg - algorithm used with key |
| 716 | @param key_len - length key in bytes |
| 717 | @param key - key |
| 718 | */ |
| 719 | autoreply define ipsec_tunnel_if_set_key { |
| 720 | u32 client_index; |
| 721 | u32 context; |
| 722 | u32 sw_if_index; |
| 723 | u8 key_type; |
| 724 | u8 alg; |
| 725 | u8 key_len; |
| 726 | u8 key[128]; |
| 727 | }; |
| 728 | |
Matthew Smith | ca514fd | 2017-10-12 12:06:59 -0500 | [diff] [blame] | 729 | /** \brief Set new SA on IPsec interface |
| 730 | @param client_index - opaque cookie to identify the sender |
| 731 | @param context - sender context, to match reply w/ request |
| 732 | @param sw_if_index - index of tunnel interface |
| 733 | @param sa_id - ID of SA to use |
| 734 | @param is_outbound - 1 if outbound (local) SA, 0 if inbound (remote) |
| 735 | */ |
| 736 | autoreply define ipsec_tunnel_if_set_sa { |
| 737 | u32 client_index; |
| 738 | u32 context; |
| 739 | u32 sw_if_index; |
| 740 | u32 sa_id; |
| 741 | u8 is_outbound; |
| 742 | }; |
| 743 | |
Klement Sekera | b4d3053 | 2018-11-08 13:00:02 +0100 | [diff] [blame] | 744 | /** \brief Dump IPsec backends |
| 745 | @param client_index - opaque cookie to identify the sender |
| 746 | @param context - sender context, to match reply w/ request |
| 747 | */ |
| 748 | define ipsec_backend_dump { |
| 749 | u32 client_index; |
| 750 | u32 context; |
| 751 | }; |
| 752 | |
| 753 | /** \brief IPsec backend details |
| 754 | @param name - name of the backend |
| 755 | @param protocol - IPsec protocol (value from ipsec_protocol_t) |
| 756 | @param index - backend index |
| 757 | @param active - set to 1 if the backend is active, otherwise 0 |
| 758 | */ |
| 759 | define ipsec_backend_details { |
| 760 | u32 context; |
| 761 | u8 name[128]; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 762 | vl_api_ipsec_proto_t protocol; |
Klement Sekera | b4d3053 | 2018-11-08 13:00:02 +0100 | [diff] [blame] | 763 | u8 index; |
| 764 | u8 active; |
| 765 | }; |
| 766 | |
| 767 | /** \brief Select IPsec backend |
| 768 | @param client_index - opaque cookie to identify the sender |
| 769 | @param context - sender context, to match reply w/ request |
| 770 | @param protocol - IPsec protocol (value from ipsec_protocol_t) |
| 771 | @param index - backend index |
| 772 | */ |
| 773 | autoreply define ipsec_select_backend { |
| 774 | u32 client_index; |
| 775 | u32 context; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 776 | vl_api_ipsec_proto_t protocol; |
Klement Sekera | b4d3053 | 2018-11-08 13:00:02 +0100 | [diff] [blame] | 777 | u8 index; |
| 778 | }; |
| 779 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 780 | /* |
| 781 | * Local Variables: |
| 782 | * eval: (c-set-style "gnu") |
| 783 | * End: |
| 784 | */ |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 785 | |