blob: 011b0d4b1ffab91176ffb8534951bd6748faef9c [file] [log] [blame]
Pavel Kotucek9c7ef032016-12-21 07:46:45 +01001/*
2 * Copyright (c) 2015-2016 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/** \brief IPsec: Add/delete Security Policy Database
17 @param client_index - opaque cookie to identify the sender
18 @param context - sender context, to match reply w/ request
19 @param is_add - add SPD if non-zero, else delete
20 @param spd_id - SPD instance id (control plane allocated)
21*/
22
Dave Barach11b8dbf2017-04-24 10:46:54 -040023autoreply define ipsec_spd_add_del
Pavel Kotucek9c7ef032016-12-21 07:46:45 +010024{
25 u32 client_index;
26 u32 context;
27 u8 is_add;
28 u32 spd_id;
29};
30
Pavel Kotucek9c7ef032016-12-21 07:46:45 +010031/** \brief IPsec: Add/delete SPD from interface
32
33 @param client_index - opaque cookie to identify the sender
34 @param context - sender context, to match reply w/ request
35 @param is_add - add security mode if non-zero, else delete
36 @param sw_if_index - index of the interface
37 @param spd_id - SPD instance id to use for lookups
38*/
39
40
Dave Barach11b8dbf2017-04-24 10:46:54 -040041autoreply define ipsec_interface_add_del_spd
Pavel Kotucek9c7ef032016-12-21 07:46:45 +010042{
43 u32 client_index;
44 u32 context;
45
46 u8 is_add;
47 u32 sw_if_index;
48 u32 spd_id;
49};
50
Pavel Kotucek9c7ef032016-12-21 07:46:45 +010051/** \brief IPsec: Add/delete Security Policy Database entry
52
53 See RFC 4301, 4.4.1.1 on how to match packet to selectors
54
55 @param client_index - opaque cookie to identify the sender
56 @param context - sender context, to match reply w/ request
57 @param is_add - add SPD if non-zero, else delete
58 @param spd_id - SPD instance id (control plane allocated)
59 @param priority - priority of SPD entry (non-unique value). Used to order SPD matching - higher priorities match before lower
60 @param is_outbound - entry applies to outbound traffic if non-zero, otherwise applies to inbound traffic
61 @param is_ipv6 - remote/local address are IPv6 if non-zero, else IPv4
62 @param remote_address_start - start of remote address range to match
63 @param remote_address_stop - end of remote address range to match
64 @param local_address_start - start of local address range to match
65 @param local_address_stop - end of local address range to match
66 @param protocol - protocol type to match [0 means any]
67 @param remote_port_start - start of remote port range to match ...
68 @param remote_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
69 @param local_port_start - start of local port range to match ...
70 @param local_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
71 @param policy - 0 = bypass (no IPsec processing), 1 = discard (discard packet with ICMP processing), 2 = resolve (send request to control plane for SA resolving, and discard without ICMP processing), 3 = protect (apply IPsec policy using following parameters)
72 @param sa_id - SAD instance id (control plane allocated)
73
74*/
75
Dave Barach11b8dbf2017-04-24 10:46:54 -040076autoreply define ipsec_spd_add_del_entry
Pavel Kotucek9c7ef032016-12-21 07:46:45 +010077{
78 u32 client_index;
79 u32 context;
80 u8 is_add;
81
82 u32 spd_id;
83 i32 priority;
84 u8 is_outbound;
85
86 // Selector
87 u8 is_ipv6;
88 u8 is_ip_any;
89 u8 remote_address_start[16];
90 u8 remote_address_stop[16];
91 u8 local_address_start[16];
92 u8 local_address_stop[16];
93
94 u8 protocol;
95
96 u16 remote_port_start;
97 u16 remote_port_stop;
98 u16 local_port_start;
99 u16 local_port_stop;
100
101 // Policy
102 u8 policy;
103 u32 sa_id;
104};
105
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100106/** \brief IPsec: Add/delete Security Association Database entry
107 @param client_index - opaque cookie to identify the sender
108 @param context - sender context, to match reply w/ request
109 @param is_add - add SAD entry if non-zero, else delete
110
111 @param sad_id - sad id
112
113 @param spi - security parameter index
114
115 @param protocol - 0 = AH, 1 = ESP
116
117 @param crypto_algorithm - 0 = Null, 1 = AES-CBC-128, 2 = AES-CBC-192, 3 = AES-CBC-256, 4 = 3DES-CBC
118 @param crypto_key_length - length of crypto_key in bytes
119 @param crypto_key - crypto keying material
120
121 @param integrity_algorithm - 0 = None, 1 = MD5-96, 2 = SHA1-96, 3 = SHA-256, 4 = SHA-384, 5=SHA-512
122 @param integrity_key_length - length of integrity_key in bytes
123 @param integrity_key - integrity keying material
124
125 @param use_extended_sequence_number - use ESN when non-zero
126
127 @param is_tunnel - IPsec tunnel mode if non-zero, else transport mode
128 @param is_tunnel_ipv6 - IPsec tunnel mode is IPv6 if non-zero, else IPv4 tunnel only valid if is_tunnel is non-zero
129 @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
130 @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
131
132 To be added:
133 Anti-replay
134 IPsec tunnel address copy mode (to support GDOI)
135 */
136
Dave Barach11b8dbf2017-04-24 10:46:54 -0400137autoreply define ipsec_sad_add_del_entry
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100138{
139 u32 client_index;
140 u32 context;
141 u8 is_add;
142
143 u32 sad_id;
144
145 u32 spi;
146
147 u8 protocol;
148
149 u8 crypto_algorithm;
150 u8 crypto_key_length;
151 u8 crypto_key[128];
152
153 u8 integrity_algorithm;
154 u8 integrity_key_length;
155 u8 integrity_key[128];
156
157 u8 use_extended_sequence_number;
158
159 u8 is_tunnel;
160 u8 is_tunnel_ipv6;
161 u8 tunnel_src_address[16];
162 u8 tunnel_dst_address[16];
163};
164
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100165/** \brief IPsec: Update Security Association keys
166 @param client_index - opaque cookie to identify the sender
167 @param context - sender context, to match reply w/ request
168
169 @param sa_id - sa id
170
171 @param crypto_key_length - length of crypto_key in bytes
172 @param crypto_key - crypto keying material
173
174 @param integrity_key_length - length of integrity_key in bytes
175 @param integrity_key - integrity keying material
176*/
177
Dave Barach11b8dbf2017-04-24 10:46:54 -0400178autoreply define ipsec_sa_set_key
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100179{
180 u32 client_index;
181 u32 context;
182
183 u32 sa_id;
184
185 u8 crypto_key_length;
186 u8 crypto_key[128];
187
188 u8 integrity_key_length;
189 u8 integrity_key[128];
190};
191
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100192/** \brief IKEv2: Add/delete profile
193 @param client_index - opaque cookie to identify the sender
194 @param context - sender context, to match reply w/ request
195
196 @param name - IKEv2 profile name
197 @param is_add - Add IKEv2 profile if non-zero, else delete
198*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400199autoreply define ikev2_profile_add_del
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100200{
201 u32 client_index;
202 u32 context;
203
204 u8 name[64];
205 u8 is_add;
206};
207
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100208/** \brief IKEv2: Set IKEv2 profile authentication method
209 @param client_index - opaque cookie to identify the sender
210 @param context - sender context, to match reply w/ request
211
212 @param name - IKEv2 profile name
213 @param auth_method - IKEv2 authentication method (shared-key-mic/rsa-sig)
214 @param is_hex - Authentication data in hex format if non-zero, else string
215 @param data_len - Authentication data length
216 @param data - Authentication data (for rsa-sig cert file path)
217*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400218autoreply define ikev2_profile_set_auth
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100219{
220 u32 client_index;
221 u32 context;
222
223 u8 name[64];
224 u8 auth_method;
225 u8 is_hex;
226 u32 data_len;
227 u8 data[0];
228};
229
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100230/** \brief IKEv2: Set IKEv2 profile local/remote identification
231 @param client_index - opaque cookie to identify the sender
232 @param context - sender context, to match reply w/ request
233
234 @param name - IKEv2 profile name
235 @param is_local - Identification is local if non-zero, else remote
236 @param id_type - Identification type
237 @param data_len - Identification data length
238 @param data - Identification data
239*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400240autoreply define ikev2_profile_set_id
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100241{
242 u32 client_index;
243 u32 context;
244
245 u8 name[64];
246 u8 is_local;
247 u8 id_type;
248 u32 data_len;
249 u8 data[0];
250};
251
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100252/** \brief IKEv2: Set IKEv2 profile traffic selector parameters
253 @param client_index - opaque cookie to identify the sender
254 @param context - sender context, to match reply w/ request
255
256 @param name - IKEv2 profile name
257 @param is_local - Traffic selector is local if non-zero, else remote
258 @param proto - Traffic selector IP protocol (if zero not relevant)
259 @param start_port - The smallest port number allowed by traffic selector
260 @param end_port - The largest port number allowed by traffic selector
261 @param start_addr - The smallest address included in traffic selector
262 @param end_addr - The largest address included in traffic selector
263*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400264autoreply define ikev2_profile_set_ts
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100265{
266 u32 client_index;
267 u32 context;
268
269 u8 name[64];
270 u8 is_local;
271 u8 proto;
272 u16 start_port;
273 u16 end_port;
274 u32 start_addr;
275 u32 end_addr;
276};
277
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100278/** \brief IKEv2: Set IKEv2 local RSA private key
279 @param client_index - opaque cookie to identify the sender
280 @param context - sender context, to match reply w/ request
281
282 @param key_file - Key file absolute path
283*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400284autoreply define ikev2_set_local_key
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100285{
286 u32 client_index;
287 u32 context;
288
289 u8 key_file[256];
290};
291
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000292/** \brief IKEv2: Set IKEv2 responder interface and IP address
293 @param client_index - opaque cookie to identify the sender
294 @param context - sender context, to match reply w/ request
295
296 @param name - IKEv2 profile name
297 @param sw_if_index - interface index
298 @param address - interface address
299*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400300autoreply define ikev2_set_responder
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000301{
302 u32 client_index;
303 u32 context;
304
305 u8 name[64];
306 u32 sw_if_index;
307 u8 address[4];
308};
309
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000310/** \brief IKEv2: Set IKEv2 IKE transforms in SA_INIT proposal (RFC 7296)
311 @param client_index - opaque cookie to identify the sender
312 @param context - sender context, to match reply w/ request
313
314 @param name - IKEv2 profile name
315 @param crypto_alg - encryption algorithm
316 @param crypto_key_size - encryption key size
317 @param integ_alg - integrity algorithm
318 @param dh_group - Diffie-Hellman group
319
320*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400321autoreply define ikev2_set_ike_transforms
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000322{
323 u32 client_index;
324 u32 context;
325
326 u8 name[64];
327 u32 crypto_alg;
328 u32 crypto_key_size;
329 u32 integ_alg;
330 u32 dh_group;
331};
332
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000333/** \brief IKEv2: Set IKEv2 ESP transforms in SA_INIT proposal (RFC 7296)
334 @param client_index - opaque cookie to identify the sender
335 @param context - sender context, to match reply w/ request
336
337 @param name - IKEv2 profile name
338 @param crypto_alg - encryption algorithm
339 @param crypto_key_size - encryption key size
340 @param integ_alg - integrity algorithm
341 @param dh_group - Diffie-Hellman group
342
343*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400344autoreply define ikev2_set_esp_transforms
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000345{
346 u32 client_index;
347 u32 context;
348
349 u8 name[64];
350 u32 crypto_alg;
351 u32 crypto_key_size;
352 u32 integ_alg;
353 u32 dh_group;
354};
355
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000356/** \brief IKEv2: Set Child SA lifetime, limited by time and/or data
357 @param client_index - opaque cookie to identify the sender
358 @param context - sender context, to match reply w/ request
359
360 @param name - IKEv2 profile name
361 @param lifetime - SA maximum life time in seconds (0 to disable)
362 @param lifetime_jitter - Jitter added to prevent simultaneounus rekeying
363 @param handover - Hand over time
364 @param lifetime_maxdata - SA maximum life time in bytes (0 to disable)
365
366*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400367autoreply define ikev2_set_sa_lifetime
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000368{
369 u32 client_index;
370 u32 context;
371
372 u8 name[64];
373 u64 lifetime;
374 u32 lifetime_jitter;
375 u32 handover;
376 u64 lifetime_maxdata;
377};
378
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000379/** \brief IKEv2: Initiate the SA_INIT exchange
380 @param client_index - opaque cookie to identify the sender
381 @param context - sender context, to match reply w/ request
382
383 @param name - IKEv2 profile name
384
385*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400386autoreply define ikev2_initiate_sa_init
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000387{
388 u32 client_index;
389 u32 context;
390
391 u8 name[64];
392};
393
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000394/** \brief IKEv2: Initiate the delete IKE SA exchange
395 @param client_index - opaque cookie to identify the sender
396 @param context - sender context, to match reply w/ request
397
398 @param ispi - IKE SA initiator SPI
399
400*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400401autoreply define ikev2_initiate_del_ike_sa
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000402{
403 u32 client_index;
404 u32 context;
405
406 u64 ispi;
407};
408
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000409/** \brief IKEv2: Initiate the delete Child SA exchange
410 @param client_index - opaque cookie to identify the sender
411 @param context - sender context, to match reply w/ request
412
413 @param ispi - Child SA initiator SPI
414
415*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400416autoreply define ikev2_initiate_del_child_sa
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000417{
418 u32 client_index;
419 u32 context;
420
421 u32 ispi;
422};
423
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000424/** \brief IKEv2: Initiate the rekey Child SA exchange
425 @param client_index - opaque cookie to identify the sender
426 @param context - sender context, to match reply w/ request
427
428 @param ispi - Child SA initiator SPI
429
430*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400431autoreply define ikev2_initiate_rekey_child_sa
Radu Nicolaucb33dc22017-02-16 16:49:46 +0000432{
433 u32 client_index;
434 u32 context;
435
436 u32 ispi;
437};
438
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100439/** \brief Dump ipsec policy database data
440 @param client_index - opaque cookie to identify the sender
441 @param context - sender context, to match reply w/ request
442 @param spd_id - SPD instance id
443 @param sa_id - SA id, optional, set to ~0 to see all policies in SPD
444*/
445define ipsec_spd_dump {
446 u32 client_index;
447 u32 context;
448 u32 spd_id;
449 u32 sa_id;
450};
451
452/** \brief IPsec policy database response
453 @param context - sender context which was passed in the request
454 @param spd_id - SPD instance id
455 @param priority - numeric value to control policy evaluation order
456 @param is_outbound - [1|0] to indicate if direction is [out|in]bound
457 @param is_ipv6 - [1|0] to indicate if address family is ipv[6|4]
458 @param local_start_addr - first address in local traffic selector range
459 @param local_stop_addr - last address in local traffic selector range
460 @param local_start_port - first port in local traffic selector range
461 @param local_stop_port - last port in local traffic selector range
462 @param remote_start_addr - first address in remote traffic selector range
463 @param remote_stop_addr - last address in remote traffic selector range
464 @param remote_start_port - first port in remote traffic selector range
465 @param remote_stop_port - last port in remote traffic selector range
466 @param protocol - traffic selector protocol
467 @param policy - policy action
468 @param sa_id - SA id
469 @param bytes - byte count of packets matching this policy
470 @param packets - count of packets matching this policy
471*/
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100472define ipsec_spd_details {
473 u32 context;
474 u32 spd_id;
475 i32 priority;
476 u8 is_outbound;
477 u8 is_ipv6;
478 u8 local_start_addr[16];
479 u8 local_stop_addr[16];
480 u16 local_start_port;
481 u16 local_stop_port;
482 u8 remote_start_addr[16];
483 u8 remote_stop_addr[16];
484 u16 remote_start_port;
485 u16 remote_stop_port;
486 u8 protocol;
487 u8 policy;
488 u32 sa_id;
489 u64 bytes;
490 u64 packets;
491};
492
Matthew Smithb0972cb2017-05-02 16:20:41 -0500493/** \brief Add or delete IPsec tunnel interface
494 @param client_index - opaque cookie to identify the sender
495 @param context - sender context, to match reply w/ request
496 @param is_add - add IPsec tunnel interface if nonzero, else delete
497 @param esn - enable extended sequence numbers if nonzero, else disable
498 @param anti_replay - enable anti replay check if nonzero, else disable
499 @param local_ip - local IP address
500 @param remote_ip - IP address of remote IPsec peer
501 @param local_spi - SPI of outbound IPsec SA
502 @param remote_spi - SPI of inbound IPsec SA
503 @param crypto_alg - encryption algorithm ID
504 @param local_crypto_key_len - length of local crypto key in bytes
505 @param local_crypto_key - crypto key for outbound IPsec SA
506 @param remote_crypto_key_len - length of remote crypto key in bytes
507 @param remote_crypto_key - crypto key for inbound IPsec SA
508 @param integ_alg - integrity algorithm ID
509 @param local_integ_key_len - length of local integrity key in bytes
510 @param local_integ_key - integrity key for outbound IPsec SA
511 @param remote_integ_key_len - length of remote integrity key in bytes
512 @param remote_integ_key - integrity key for inbound IPsec SA
513*/
Matthew Smithe04d09d2017-05-14 21:47:18 -0500514define ipsec_tunnel_if_add_del {
Matthew Smithb0972cb2017-05-02 16:20:41 -0500515 u32 client_index;
516 u32 context;
517 u8 is_add;
518 u8 esn;
519 u8 anti_replay;
520 u8 local_ip[4];
521 u8 remote_ip[4];
522 u32 local_spi;
523 u32 remote_spi;
524 u8 crypto_alg;
525 u8 local_crypto_key_len;
526 u8 local_crypto_key[128];
527 u8 remote_crypto_key_len;
528 u8 remote_crypto_key[128];
529 u8 integ_alg;
530 u8 local_integ_key_len;
531 u8 local_integ_key[128];
532 u8 remote_integ_key_len;
533 u8 remote_integ_key[128];
534};
535
Matthew Smithe04d09d2017-05-14 21:47:18 -0500536/** \brief Add/delete IPsec tunnel interface response
537 @param context - sender context, to match reply w/ request
538 @param retval - return status
539 @param sw_if_index - sw_if_index of new interface (for successful add)
540*/
541define ipsec_tunnel_if_add_del_reply {
542 u32 context;
543 i32 retval;
544 u32 sw_if_index;
545};
546
Pavel Kotucek9c7ef032016-12-21 07:46:45 +0100547/*
548 * Local Variables:
549 * eval: (c-set-style "gnu")
550 * End:
551 */
Dave Barach11b8dbf2017-04-24 10:46:54 -0400552