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