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 | |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 17 | option version = "3.0.0"; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 18 | |
Prashant Maheshwari | dbf68c9 | 2019-11-14 12:42:59 +0530 | [diff] [blame] | 19 | import "vnet/ipsec/ipsec_types.api"; |
Neale Ranns | c87b66c | 2019-02-07 07:26:12 -0800 | [diff] [blame] | 20 | import "vnet/interface_types.api"; |
Dave Barach | 0d056e5 | 2017-09-28 15:11:16 -0400 | [diff] [blame] | 21 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 22 | /** \brief IPsec: Add/delete Security Policy Database |
| 23 | @param client_index - opaque cookie to identify the sender |
| 24 | @param context - sender context, to match reply w/ request |
| 25 | @param is_add - add SPD if non-zero, else delete |
| 26 | @param spd_id - SPD instance id (control plane allocated) |
| 27 | */ |
| 28 | |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 29 | autoreply define ipsec_spd_add_del |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 30 | { |
| 31 | u32 client_index; |
| 32 | u32 context; |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 33 | u8 is_add; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 34 | u32 spd_id; |
| 35 | }; |
| 36 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 37 | /** \brief IPsec: Add/delete SPD from interface |
| 38 | |
| 39 | @param client_index - opaque cookie to identify the sender |
| 40 | @param context - sender context, to match reply w/ request |
| 41 | @param is_add - add security mode if non-zero, else delete |
| 42 | @param sw_if_index - index of the interface |
| 43 | @param spd_id - SPD instance id to use for lookups |
| 44 | */ |
| 45 | |
| 46 | |
Dave Barach | 11b8dbf | 2017-04-24 10:46:54 -0400 | [diff] [blame] | 47 | autoreply define ipsec_interface_add_del_spd |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 48 | { |
| 49 | u32 client_index; |
| 50 | u32 context; |
| 51 | |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 52 | u8 is_add; |
| 53 | u32 sw_if_index; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 54 | u32 spd_id; |
| 55 | }; |
| 56 | |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 57 | |
| 58 | enum ipsec_spd_action |
| 59 | { |
| 60 | /* bypass - no IPsec processing */ |
| 61 | IPSEC_API_SPD_ACTION_BYPASS = 0, |
| 62 | /* discard - discard packet with ICMP processing */ |
| 63 | IPSEC_API_SPD_ACTION_DISCARD, |
| 64 | /* resolve - send request to control plane for SA resolving */ |
| 65 | IPSEC_API_SPD_ACTION_RESOLVE, |
| 66 | /* protect - apply IPsec policy using following parameters */ |
| 67 | IPSEC_API_SPD_ACTION_PROTECT, |
| 68 | }; |
| 69 | |
| 70 | /** \brief IPsec: Security Policy Database entry |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 71 | |
| 72 | See RFC 4301, 4.4.1.1 on how to match packet to selectors |
| 73 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 74 | @param spd_id - SPD instance id (control plane allocated) |
| 75 | @param priority - priority of SPD entry (non-unique value). Used to order SPD matching - higher priorities match before lower |
| 76 | @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] | 77 | @param remote_address_start - start of remote address range to match |
| 78 | @param remote_address_stop - end of remote address range to match |
| 79 | @param local_address_start - start of local address range to match |
| 80 | @param local_address_stop - end of local address range to match |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 81 | @param protocol - protocol type to match [0 means any] otherwise IANA value |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 82 | @param remote_port_start - start of remote port range to match ... |
| 83 | @param remote_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE] |
| 84 | @param local_port_start - start of local port range to match ... |
| 85 | @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] | 86 | @param policy - action to perform on match |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 87 | @param sa_id - SAD instance id (control plane allocated) |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 88 | */ |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 89 | typedef ipsec_spd_entry |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 90 | { |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 91 | u32 spd_id; |
| 92 | i32 priority; |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 93 | u8 is_outbound; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 94 | |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 95 | u32 sa_id; |
| 96 | vl_api_ipsec_spd_action_t policy; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 97 | u8 protocol; |
| 98 | |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 99 | // Selector |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 100 | vl_api_address_t remote_address_start; |
| 101 | vl_api_address_t remote_address_stop; |
| 102 | vl_api_address_t local_address_start; |
| 103 | vl_api_address_t local_address_stop; |
| 104 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 105 | u16 remote_port_start; |
| 106 | u16 remote_port_stop; |
| 107 | u16 local_port_start; |
| 108 | u16 local_port_stop; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 109 | }; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 110 | |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 111 | /** \brief IPsec: Add/delete Security Policy Database entry |
| 112 | |
| 113 | @param client_index - opaque cookie to identify the sender |
| 114 | @param context - sender context, to match reply w/ request |
| 115 | @param is_add - add SPD if non-zero, else delete |
| 116 | @param entry - Description of the entry to add/dell |
| 117 | */ |
Neale Ranns | a09c1ff | 2019-02-04 01:10:30 -0800 | [diff] [blame] | 118 | define ipsec_spd_entry_add_del |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 119 | { |
| 120 | u32 client_index; |
| 121 | u32 context; |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 122 | u8 is_add; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 123 | vl_api_ipsec_spd_entry_t entry; |
| 124 | }; |
| 125 | |
Neale Ranns | a09c1ff | 2019-02-04 01:10:30 -0800 | [diff] [blame] | 126 | /** \brief IPsec: Reply Add/delete Security Policy Database entry |
| 127 | |
| 128 | @param context - sender context, to match reply w/ request |
| 129 | @param retval - success/fail rutrun code |
| 130 | @param stat_index - An index for the policy in the stats segment @ /net/ipec/policy |
| 131 | */ |
| 132 | define ipsec_spd_entry_add_del_reply |
| 133 | { |
| 134 | u32 context; |
| 135 | i32 retval; |
| 136 | u32 stat_index; |
| 137 | }; |
| 138 | |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 139 | /** \brief Dump IPsec all SPD IDs |
| 140 | @param client_index - opaque cookie to identify the sender |
| 141 | @param context - sender context, to match reply w/ request |
| 142 | */ |
| 143 | define ipsec_spds_dump { |
| 144 | u32 client_index; |
| 145 | u32 context; |
| 146 | }; |
| 147 | |
| 148 | /** \brief Dump IPsec all SPD IDs response |
| 149 | @param client_index - opaque cookie to identify the sender |
| 150 | @param spd_id - SPD instance id (control plane allocated) |
| 151 | @param npolicies - number of policies in SPD |
| 152 | */ |
| 153 | define ipsec_spds_details { |
| 154 | u32 context; |
| 155 | u32 spd_id; |
| 156 | u32 npolicies; |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 157 | }; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 158 | |
| 159 | /** \brief Dump ipsec policy database data |
| 160 | @param client_index - opaque cookie to identify the sender |
| 161 | @param context - sender context, to match reply w/ request |
| 162 | @param spd_id - SPD instance id |
| 163 | @param sa_id - SA id, optional, set to ~0 to see all policies in SPD |
| 164 | */ |
| 165 | define ipsec_spd_dump { |
| 166 | u32 client_index; |
| 167 | u32 context; |
| 168 | u32 spd_id; |
| 169 | u32 sa_id; |
| 170 | }; |
| 171 | |
| 172 | /** \brief IPsec policy database response |
| 173 | @param context - sender context which was passed in the request |
| 174 | €param entry - The SPD entry. |
| 175 | @param bytes - byte count of packets matching this policy |
| 176 | @param packets - count of packets matching this policy |
| 177 | */ |
| 178 | define ipsec_spd_details { |
| 179 | u32 context; |
| 180 | vl_api_ipsec_spd_entry_t entry; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 181 | }; |
| 182 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 183 | /** \brief IPsec: Add/delete Security Association Database entry |
| 184 | @param client_index - opaque cookie to identify the sender |
| 185 | @param context - sender context, to match reply w/ request |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 186 | @param entry - Entry to add or delete |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 187 | */ |
Neale Ranns | eba31ec | 2019-02-17 18:04:27 +0000 | [diff] [blame] | 188 | define ipsec_sad_entry_add_del |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 189 | { |
| 190 | u32 client_index; |
| 191 | u32 context; |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 192 | u8 is_add; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 193 | vl_api_ipsec_sad_entry_t entry; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 194 | }; |
Neale Ranns | eba31ec | 2019-02-17 18:04:27 +0000 | [diff] [blame] | 195 | define ipsec_sad_entry_add_del_reply |
| 196 | { |
| 197 | u32 context; |
| 198 | i32 retval; |
| 199 | u32 stat_index; |
| 200 | }; |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 201 | |
Neale Ranns | c87b66c | 2019-02-07 07:26:12 -0800 | [diff] [blame] | 202 | /** \brief Add or Update Protection for a tunnel with IPSEC |
| 203 | |
| 204 | Tunnel protection directly associates an SA with all packets |
| 205 | ingress and egress on the tunnel. This could also be achieved by |
| 206 | assigning an SPD to the tunnel, but that would incur an unnessccary |
| 207 | SPD entry lookup. |
| 208 | |
| 209 | For tunnels the ESP acts on the post-encapsulated packet. So if this |
| 210 | packet: |
| 211 | +---------+------+ |
| 212 | | Payload | O-IP | |
| 213 | +---------+------+ |
| 214 | where O-IP is the overlay IP addrees that was routed into the tunnel, |
| 215 | the resulting encapsulated packet will be: |
| 216 | +---------+------+------+ |
| 217 | | Payload | O-IP | T-IP | |
| 218 | +---------+------+------+ |
| 219 | where T-IP is the tunnel's src.dst IP addresses. |
| 220 | If the SAs used for protection are in transport mode then the ESP is |
| 221 | inserted before T-IP, i.e.: |
| 222 | +---------+------+-----+------+ |
| 223 | | Payload | O-IP | ESP | T-IP | |
| 224 | +---------+------+-----+------+ |
| 225 | If the SAs used for protection are in tunnel mode then another |
| 226 | encapsulation occurs, i.e.: |
| 227 | +---------+------+------+-----+------+ |
| 228 | | Payload | O-IP | T-IP | ESP | C-IP | |
| 229 | +---------+------+------+-----+------+ |
| 230 | where C-IP are the crypto endpoint IP addresses defined as the tunnel |
| 231 | endpoints in the SA. |
| 232 | The mode for the inbound and outbound SA must be the same. |
| 233 | |
| 234 | @param client_index - opaque cookie to identify the sender |
| 235 | @param context - sender context, to match reply w/ request |
| 236 | @param sw_id_index - Tunnel interface to protect |
Neale Ranns | 2828721 | 2019-12-16 00:53:11 +0000 | [diff] [blame] | 237 | @param nh - The peer/next-hop on the tunnel to which the traffic |
| 238 | should be protected. For a P2P interface set this to the |
| 239 | all 0s address. |
Neale Ranns | c87b66c | 2019-02-07 07:26:12 -0800 | [diff] [blame] | 240 | @param sa_in - The ID [set] of inbound SAs |
| 241 | @param sa_out - The ID of outbound SA |
| 242 | */ |
| 243 | typedef ipsec_tunnel_protect |
| 244 | { |
| 245 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | 2828721 | 2019-12-16 00:53:11 +0000 | [diff] [blame] | 246 | vl_api_address_t nh; |
Neale Ranns | c87b66c | 2019-02-07 07:26:12 -0800 | [diff] [blame] | 247 | u32 sa_out; |
| 248 | u8 n_sa_in; |
| 249 | u32 sa_in[n_sa_in]; |
| 250 | }; |
| 251 | |
| 252 | autoreply define ipsec_tunnel_protect_update |
| 253 | { |
| 254 | u32 client_index; |
| 255 | u32 context; |
| 256 | |
| 257 | vl_api_ipsec_tunnel_protect_t tunnel; |
| 258 | }; |
| 259 | |
| 260 | autoreply define ipsec_tunnel_protect_del |
| 261 | { |
| 262 | u32 client_index; |
| 263 | u32 context; |
| 264 | |
| 265 | vl_api_interface_index_t sw_if_index; |
Neale Ranns | 2828721 | 2019-12-16 00:53:11 +0000 | [diff] [blame] | 266 | vl_api_address_t nh; |
Neale Ranns | c87b66c | 2019-02-07 07:26:12 -0800 | [diff] [blame] | 267 | }; |
| 268 | |
Neale Ranns | 12989b5 | 2019-09-26 16:20:19 +0000 | [diff] [blame] | 269 | /** |
| 270 | * @brief Dump all tunnel protections |
| 271 | */ |
Neale Ranns | c87b66c | 2019-02-07 07:26:12 -0800 | [diff] [blame] | 272 | define ipsec_tunnel_protect_dump |
| 273 | { |
| 274 | u32 client_index; |
| 275 | u32 context; |
| 276 | vl_api_interface_index_t sw_if_index; |
| 277 | }; |
| 278 | |
| 279 | define ipsec_tunnel_protect_details |
| 280 | { |
| 281 | u32 context; |
| 282 | vl_api_ipsec_tunnel_protect_t tun; |
| 283 | }; |
| 284 | |
Filip Varga | 871bca9 | 2018-11-02 13:51:44 +0100 | [diff] [blame] | 285 | /** \brief IPsec: Get SPD interfaces |
| 286 | @param client_index - opaque cookie to identify the sender |
| 287 | @param context - sender context, to match reply w/ request |
| 288 | @param spd_index - SPD index |
| 289 | @param spd_index_valid - if 1 spd_index is used to filter |
| 290 | spd_index's, if 0 no filtering is done |
| 291 | */ |
| 292 | define ipsec_spd_interface_dump { |
| 293 | u32 client_index; |
| 294 | u32 context; |
| 295 | u32 spd_index; |
| 296 | u8 spd_index_valid; |
| 297 | }; |
| 298 | |
| 299 | /** \brief IPsec: SPD interface response |
| 300 | @param context - sender context which was passed in the request |
| 301 | @param spd_index - SPD index |
| 302 | @param sw_if_index - index of the interface |
| 303 | */ |
| 304 | define ipsec_spd_interface_details { |
| 305 | u32 context; |
| 306 | u32 spd_index; |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 307 | u32 sw_if_index; |
Filip Varga | 871bca9 | 2018-11-02 13:51:44 +0100 | [diff] [blame] | 308 | }; |
| 309 | |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 310 | /** \brief Add or delete IPsec tunnel interface |
Neale Ranns | 12989b5 | 2019-09-26 16:20:19 +0000 | [diff] [blame] | 311 | |
| 312 | !!DEPRECATED!! |
| 313 | use the tunnel protect APIs instead |
| 314 | |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 315 | @param client_index - opaque cookie to identify the sender |
| 316 | @param context - sender context, to match reply w/ request |
| 317 | @param is_add - add IPsec tunnel interface if nonzero, else delete |
Kingwel Xie | 1ba5bc8 | 2019-03-20 07:21:58 -0400 | [diff] [blame] | 318 | @param is_ip6 - tunnel v6 or v4 |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 319 | @param esn - enable extended sequence numbers if nonzero, else disable |
| 320 | @param anti_replay - enable anti replay check if nonzero, else disable |
| 321 | @param local_ip - local IP address |
| 322 | @param remote_ip - IP address of remote IPsec peer |
| 323 | @param local_spi - SPI of outbound IPsec SA |
| 324 | @param remote_spi - SPI of inbound IPsec SA |
| 325 | @param crypto_alg - encryption algorithm ID |
| 326 | @param local_crypto_key_len - length of local crypto key in bytes |
| 327 | @param local_crypto_key - crypto key for outbound IPsec SA |
| 328 | @param remote_crypto_key_len - length of remote crypto key in bytes |
| 329 | @param remote_crypto_key - crypto key for inbound IPsec SA |
| 330 | @param integ_alg - integrity algorithm ID |
| 331 | @param local_integ_key_len - length of local integrity key in bytes |
| 332 | @param local_integ_key - integrity key for outbound IPsec SA |
| 333 | @param remote_integ_key_len - length of remote integrity key in bytes |
| 334 | @param remote_integ_key - integrity key for inbound IPsec SA |
Matthew Smith | 8e1039a | 2018-04-12 07:32:56 -0500 | [diff] [blame] | 335 | @param renumber - intf display name uses a specified instance if != 0 |
| 336 | @param show_instance - instance to display for intf if renumber is set |
Filip Tehlar | b4a7a7d | 2018-11-30 07:27:27 -0800 | [diff] [blame] | 337 | @param udp_encap - enable UDP encapsulation for NAT traversal |
Pierre Pfister | 4c422f9 | 2018-12-10 11:19:08 +0100 | [diff] [blame] | 338 | @param tx_table_id - the FIB id used after packet encap |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 339 | @param salt - for use with counter mode ciphers |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 340 | */ |
Matthew Smith | e04d09d | 2017-05-14 21:47:18 -0500 | [diff] [blame] | 341 | define ipsec_tunnel_if_add_del { |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 342 | u32 client_index; |
| 343 | u32 context; |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 344 | u8 is_add; |
| 345 | u8 esn; |
| 346 | u8 anti_replay; |
Kingwel Xie | 1ba5bc8 | 2019-03-20 07:21:58 -0400 | [diff] [blame] | 347 | vl_api_address_t local_ip; |
| 348 | vl_api_address_t remote_ip; |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 349 | u32 local_spi; |
| 350 | u32 remote_spi; |
| 351 | u8 crypto_alg; |
| 352 | u8 local_crypto_key_len; |
| 353 | u8 local_crypto_key[128]; |
| 354 | u8 remote_crypto_key_len; |
| 355 | u8 remote_crypto_key[128]; |
| 356 | u8 integ_alg; |
| 357 | u8 local_integ_key_len; |
| 358 | u8 local_integ_key[128]; |
| 359 | u8 remote_integ_key_len; |
| 360 | u8 remote_integ_key[128]; |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 361 | u8 renumber; |
Matthew Smith | 8e1039a | 2018-04-12 07:32:56 -0500 | [diff] [blame] | 362 | u32 show_instance; |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 363 | u8 udp_encap; |
Pierre Pfister | 4c422f9 | 2018-12-10 11:19:08 +0100 | [diff] [blame] | 364 | u32 tx_table_id; |
Neale Ranns | 80f6fd5 | 2019-04-16 02:41:34 +0000 | [diff] [blame] | 365 | u32 salt; |
Matthew Smith | b0972cb | 2017-05-02 16:20:41 -0500 | [diff] [blame] | 366 | }; |
| 367 | |
Matthew Smith | e04d09d | 2017-05-14 21:47:18 -0500 | [diff] [blame] | 368 | /** \brief Add/delete IPsec tunnel interface response |
| 369 | @param context - sender context, to match reply w/ request |
| 370 | @param retval - return status |
| 371 | @param sw_if_index - sw_if_index of new interface (for successful add) |
| 372 | */ |
| 373 | define ipsec_tunnel_if_add_del_reply { |
| 374 | u32 context; |
| 375 | i32 retval; |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 376 | u32 sw_if_index; |
Matthew Smith | e04d09d | 2017-05-14 21:47:18 -0500 | [diff] [blame] | 377 | }; |
| 378 | |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 379 | /** \brief Dump IPsec security association |
| 380 | @param client_index - opaque cookie to identify the sender |
| 381 | @param context - sender context, to match reply w/ request |
| 382 | @param sa_id - optional ID of an SA to dump, if ~0 dump all SAs in SAD |
| 383 | */ |
| 384 | define ipsec_sa_dump { |
| 385 | u32 client_index; |
| 386 | u32 context; |
| 387 | u32 sa_id; |
| 388 | }; |
| 389 | |
| 390 | /** \brief IPsec security association database response |
| 391 | @param context - sender context which was passed in the request |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 392 | @param sa_id - SA ID, policy-based SAs >=0, tunnel interface SAs = 0 |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 393 | @param sw_if_index - sw_if_index of tunnel interface, policy-based SAs = ~0 |
| 394 | @param spi - security parameter index |
| 395 | @param protocol - IPsec protocol (value from ipsec_protocol_t) |
| 396 | @param crypto_alg - crypto algorithm (value from ipsec_crypto_alg_t) |
| 397 | @param crypto_key_len - length of crypto_key in bytes |
| 398 | @param crypto_key - crypto keying material |
| 399 | @param integ_alg - integrity algorithm (value from ipsec_integ_alg_t) |
| 400 | @param integ_key_len - length of integ_key in bytes |
| 401 | @param integ_key - integrity keying material |
| 402 | @param use_esn - using extended sequence numbers when non-zero |
| 403 | @param use_anti_replay - using anti-replay window when non-zero |
| 404 | @param is_tunnel - IPsec tunnel mode when non-zero, else transport mode |
| 405 | @param is_tunnel_ipv6 - If using tunnel mode, endpoints are IPv6 |
| 406 | @param tunnel_src_addr - Tunnel source address if using tunnel mode |
| 407 | @param tunnel_dst_addr - Tunnel destination address is using tunnel mode |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 408 | @param salt - 4 byte salt |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 409 | @param seq - current sequence number for outbound |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 410 | @param seq_hi - high 32 bits of ESN for outbound |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 411 | @param last_seq - highest sequence number received inbound |
| 412 | @param last_seq_hi - high 32 bits of highest ESN received inbound |
| 413 | @param replay_window - bit map of seq nums received relative to last_seq if using anti-replay |
| 414 | @param total_data_size - total bytes sent or received |
Klement Sekera | 4b089f2 | 2018-04-17 18:04:57 +0200 | [diff] [blame] | 415 | @param udp_encap - 1 if UDP encap enabled, 0 otherwise |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 416 | */ |
| 417 | define ipsec_sa_details { |
| 418 | u32 context; |
Neale Ranns | 8d7c502 | 2019-02-06 01:41:05 -0800 | [diff] [blame] | 419 | vl_api_ipsec_sad_entry_t entry; |
| 420 | |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 421 | u32 sw_if_index; |
Matthew Smith | 2802953 | 2017-09-26 13:33:44 -0500 | [diff] [blame] | 422 | u32 salt; |
| 423 | u64 seq_outbound; |
| 424 | u64 last_seq_inbound; |
| 425 | u64 replay_window; |
| 426 | |
| 427 | u64 total_data_size; |
| 428 | }; |
| 429 | |
Matthew Smith | ca514fd | 2017-10-12 12:06:59 -0500 | [diff] [blame] | 430 | /** \brief Set new SA on IPsec interface |
Neale Ranns | 12989b5 | 2019-09-26 16:20:19 +0000 | [diff] [blame] | 431 | |
| 432 | !! DEPRECATED !! |
| 433 | |
Matthew Smith | ca514fd | 2017-10-12 12:06:59 -0500 | [diff] [blame] | 434 | @param client_index - opaque cookie to identify the sender |
| 435 | @param context - sender context, to match reply w/ request |
| 436 | @param sw_if_index - index of tunnel interface |
| 437 | @param sa_id - ID of SA to use |
| 438 | @param is_outbound - 1 if outbound (local) SA, 0 if inbound (remote) |
| 439 | */ |
| 440 | autoreply define ipsec_tunnel_if_set_sa { |
| 441 | u32 client_index; |
| 442 | u32 context; |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 443 | u32 sw_if_index; |
Matthew Smith | ca514fd | 2017-10-12 12:06:59 -0500 | [diff] [blame] | 444 | u32 sa_id; |
| 445 | u8 is_outbound; |
| 446 | }; |
| 447 | |
Klement Sekera | b4d3053 | 2018-11-08 13:00:02 +0100 | [diff] [blame] | 448 | /** \brief Dump IPsec backends |
| 449 | @param client_index - opaque cookie to identify the sender |
| 450 | @param context - sender context, to match reply w/ request |
| 451 | */ |
| 452 | define ipsec_backend_dump { |
| 453 | u32 client_index; |
| 454 | u32 context; |
| 455 | }; |
| 456 | |
| 457 | /** \brief IPsec backend details |
| 458 | @param name - name of the backend |
| 459 | @param protocol - IPsec protocol (value from ipsec_protocol_t) |
| 460 | @param index - backend index |
| 461 | @param active - set to 1 if the backend is active, otherwise 0 |
| 462 | */ |
| 463 | define ipsec_backend_details { |
| 464 | u32 context; |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 465 | u8 name[128]; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 466 | vl_api_ipsec_proto_t protocol; |
Klement Sekera | b4d3053 | 2018-11-08 13:00:02 +0100 | [diff] [blame] | 467 | u8 index; |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 468 | u8 active; |
Klement Sekera | b4d3053 | 2018-11-08 13:00:02 +0100 | [diff] [blame] | 469 | }; |
| 470 | |
| 471 | /** \brief Select IPsec backend |
| 472 | @param client_index - opaque cookie to identify the sender |
| 473 | @param context - sender context, to match reply w/ request |
| 474 | @param protocol - IPsec protocol (value from ipsec_protocol_t) |
| 475 | @param index - backend index |
| 476 | */ |
| 477 | autoreply define ipsec_select_backend { |
| 478 | u32 client_index; |
| 479 | u32 context; |
Neale Ranns | 17dcec0 | 2019-01-09 21:22:20 -0800 | [diff] [blame] | 480 | vl_api_ipsec_proto_t protocol; |
Klement Sekera | b4d3053 | 2018-11-08 13:00:02 +0100 | [diff] [blame] | 481 | u8 index; |
| 482 | }; |
| 483 | |
Pavel Kotucek | 9c7ef03 | 2016-12-21 07:46:45 +0100 | [diff] [blame] | 484 | /* |
| 485 | * Local Variables: |
| 486 | * eval: (c-set-style "gnu") |
| 487 | * End: |
| 488 | */ |
Ole Trøan | 2fcd265 | 2020-02-26 17:20:42 +0000 | [diff] [blame] | 489 | |