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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 /** \brief IPsec: Add/delete Security Policy Database
19 @param client_index - opaque cookie to identify the sender
20 @param context - sender context, to match reply w/ request
21 @param is_add - add SPD if non-zero, else delete
22 @param spd_id - SPD instance id (control plane allocated)
25 autoreply define ipsec_spd_add_del
33 /** \brief IPsec: Add/delete SPD from interface
35 @param client_index - opaque cookie to identify the sender
36 @param context - sender context, to match reply w/ request
37 @param is_add - add security mode if non-zero, else delete
38 @param sw_if_index - index of the interface
39 @param spd_id - SPD instance id to use for lookups
43 autoreply define ipsec_interface_add_del_spd
53 /** \brief IPsec: Add/delete Security Policy Database entry
55 See RFC 4301, 4.4.1.1 on how to match packet to selectors
57 @param client_index - opaque cookie to identify the sender
58 @param context - sender context, to match reply w/ request
59 @param is_add - add SPD if non-zero, else delete
60 @param spd_id - SPD instance id (control plane allocated)
61 @param priority - priority of SPD entry (non-unique value). Used to order SPD matching - higher priorities match before lower
62 @param is_outbound - entry applies to outbound traffic if non-zero, otherwise applies to inbound traffic
63 @param is_ipv6 - remote/local address are IPv6 if non-zero, else IPv4
64 @param remote_address_start - start of remote address range to match
65 @param remote_address_stop - end of remote address range to match
66 @param local_address_start - start of local address range to match
67 @param local_address_stop - end of local address range to match
68 @param protocol - protocol type to match [0 means any]
69 @param remote_port_start - start of remote port range to match ...
70 @param remote_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
71 @param local_port_start - start of local port range to match ...
72 @param local_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
73 @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)
74 @param sa_id - SAD instance id (control plane allocated)
78 autoreply define ipsec_spd_add_del_entry
91 u8 remote_address_start[16];
92 u8 remote_address_stop[16];
93 u8 local_address_start[16];
94 u8 local_address_stop[16];
98 u16 remote_port_start;
100 u16 local_port_start;
108 /** \brief IPsec: Add/delete Security Association Database entry
109 @param client_index - opaque cookie to identify the sender
110 @param context - sender context, to match reply w/ request
111 @param is_add - add SAD entry if non-zero, else delete
113 @param sad_id - sad id
115 @param spi - security parameter index
117 @param protocol - 0 = AH, 1 = ESP
119 @param crypto_algorithm - 0 = Null, 1 = AES-CBC-128, 2 = AES-CBC-192, 3 = AES-CBC-256, 4 = 3DES-CBC
120 @param crypto_key_length - length of crypto_key in bytes
121 @param crypto_key - crypto keying material
123 @param integrity_algorithm - 0 = None, 1 = MD5-96, 2 = SHA1-96, 3 = SHA-256, 4 = SHA-384, 5=SHA-512
124 @param integrity_key_length - length of integrity_key in bytes
125 @param integrity_key - integrity keying material
127 @param use_extended_sequence_number - use ESN when non-zero
129 @param is_tunnel - IPsec tunnel mode if non-zero, else transport mode
130 @param is_tunnel_ipv6 - IPsec tunnel mode is IPv6 if non-zero, else IPv4 tunnel only valid if is_tunnel is non-zero
131 @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
132 @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
136 IPsec tunnel address copy mode (to support GDOI)
139 autoreply define ipsec_sad_add_del_entry
152 u8 crypto_key_length;
155 u8 integrity_algorithm;
156 u8 integrity_key_length;
157 u8 integrity_key[128];
159 u8 use_extended_sequence_number;
163 u8 tunnel_src_address[16];
164 u8 tunnel_dst_address[16];
167 /** \brief IPsec: Update Security Association keys
168 @param client_index - opaque cookie to identify the sender
169 @param context - sender context, to match reply w/ request
173 @param crypto_key_length - length of crypto_key in bytes
174 @param crypto_key - crypto keying material
176 @param integrity_key_length - length of integrity_key in bytes
177 @param integrity_key - integrity keying material
180 autoreply define ipsec_sa_set_key
187 u8 crypto_key_length;
190 u8 integrity_key_length;
191 u8 integrity_key[128];
194 /** \brief IKEv2: Add/delete profile
195 @param client_index - opaque cookie to identify the sender
196 @param context - sender context, to match reply w/ request
198 @param name - IKEv2 profile name
199 @param is_add - Add IKEv2 profile if non-zero, else delete
201 autoreply define ikev2_profile_add_del
210 /** \brief IKEv2: Set IKEv2 profile authentication method
211 @param client_index - opaque cookie to identify the sender
212 @param context - sender context, to match reply w/ request
214 @param name - IKEv2 profile name
215 @param auth_method - IKEv2 authentication method (shared-key-mic/rsa-sig)
216 @param is_hex - Authentication data in hex format if non-zero, else string
217 @param data_len - Authentication data length
218 @param data - Authentication data (for rsa-sig cert file path)
220 autoreply define ikev2_profile_set_auth
232 /** \brief IKEv2: Set IKEv2 profile local/remote identification
233 @param client_index - opaque cookie to identify the sender
234 @param context - sender context, to match reply w/ request
236 @param name - IKEv2 profile name
237 @param is_local - Identification is local if non-zero, else remote
238 @param id_type - Identification type
239 @param data_len - Identification data length
240 @param data - Identification data
242 autoreply define ikev2_profile_set_id
254 /** \brief IKEv2: Set IKEv2 profile traffic selector parameters
255 @param client_index - opaque cookie to identify the sender
256 @param context - sender context, to match reply w/ request
258 @param name - IKEv2 profile name
259 @param is_local - Traffic selector is local if non-zero, else remote
260 @param proto - Traffic selector IP protocol (if zero not relevant)
261 @param start_port - The smallest port number allowed by traffic selector
262 @param end_port - The largest port number allowed by traffic selector
263 @param start_addr - The smallest address included in traffic selector
264 @param end_addr - The largest address included in traffic selector
266 autoreply define ikev2_profile_set_ts
280 /** \brief IKEv2: Set IKEv2 local RSA private key
281 @param client_index - opaque cookie to identify the sender
282 @param context - sender context, to match reply w/ request
284 @param key_file - Key file absolute path
286 autoreply define ikev2_set_local_key
294 /** \brief IKEv2: Set IKEv2 responder interface and IP address
295 @param client_index - opaque cookie to identify the sender
296 @param context - sender context, to match reply w/ request
298 @param name - IKEv2 profile name
299 @param sw_if_index - interface index
300 @param address - interface address
302 autoreply define ikev2_set_responder
312 /** \brief IKEv2: Set IKEv2 IKE transforms in SA_INIT proposal (RFC 7296)
313 @param client_index - opaque cookie to identify the sender
314 @param context - sender context, to match reply w/ request
316 @param name - IKEv2 profile name
317 @param crypto_alg - encryption algorithm
318 @param crypto_key_size - encryption key size
319 @param integ_alg - integrity algorithm
320 @param dh_group - Diffie-Hellman group
323 autoreply define ikev2_set_ike_transforms
335 /** \brief IKEv2: Set IKEv2 ESP transforms in SA_INIT proposal (RFC 7296)
336 @param client_index - opaque cookie to identify the sender
337 @param context - sender context, to match reply w/ request
339 @param name - IKEv2 profile name
340 @param crypto_alg - encryption algorithm
341 @param crypto_key_size - encryption key size
342 @param integ_alg - integrity algorithm
343 @param dh_group - Diffie-Hellman group
346 autoreply define ikev2_set_esp_transforms
358 /** \brief IKEv2: Set Child SA lifetime, limited by time and/or data
359 @param client_index - opaque cookie to identify the sender
360 @param context - sender context, to match reply w/ request
362 @param name - IKEv2 profile name
363 @param lifetime - SA maximum life time in seconds (0 to disable)
364 @param lifetime_jitter - Jitter added to prevent simultaneounus rekeying
365 @param handover - Hand over time
366 @param lifetime_maxdata - SA maximum life time in bytes (0 to disable)
369 autoreply define ikev2_set_sa_lifetime
378 u64 lifetime_maxdata;
381 /** \brief IKEv2: Initiate the SA_INIT exchange
382 @param client_index - opaque cookie to identify the sender
383 @param context - sender context, to match reply w/ request
385 @param name - IKEv2 profile name
388 autoreply define ikev2_initiate_sa_init
396 /** \brief IKEv2: Initiate the delete IKE SA exchange
397 @param client_index - opaque cookie to identify the sender
398 @param context - sender context, to match reply w/ request
400 @param ispi - IKE SA initiator SPI
403 autoreply define ikev2_initiate_del_ike_sa
411 /** \brief IKEv2: Initiate the delete Child SA exchange
412 @param client_index - opaque cookie to identify the sender
413 @param context - sender context, to match reply w/ request
415 @param ispi - Child SA initiator SPI
418 autoreply define ikev2_initiate_del_child_sa
426 /** \brief IKEv2: Initiate the rekey Child SA exchange
427 @param client_index - opaque cookie to identify the sender
428 @param context - sender context, to match reply w/ request
430 @param ispi - Child SA initiator SPI
433 autoreply define ikev2_initiate_rekey_child_sa
441 /** \brief Dump ipsec policy database data
442 @param client_index - opaque cookie to identify the sender
443 @param context - sender context, to match reply w/ request
444 @param spd_id - SPD instance id
445 @param sa_id - SA id, optional, set to ~0 to see all policies in SPD
447 define ipsec_spd_dump {
454 /** \brief IPsec policy database response
455 @param context - sender context which was passed in the request
456 @param spd_id - SPD instance id
457 @param priority - numeric value to control policy evaluation order
458 @param is_outbound - [1|0] to indicate if direction is [out|in]bound
459 @param is_ipv6 - [1|0] to indicate if address family is ipv[6|4]
460 @param local_start_addr - first address in local traffic selector range
461 @param local_stop_addr - last address in local traffic selector range
462 @param local_start_port - first port in local traffic selector range
463 @param local_stop_port - last port in local traffic selector range
464 @param remote_start_addr - first address in remote traffic selector range
465 @param remote_stop_addr - last address in remote traffic selector range
466 @param remote_start_port - first port in remote traffic selector range
467 @param remote_stop_port - last port in remote traffic selector range
468 @param protocol - traffic selector protocol
469 @param policy - policy action
471 @param bytes - byte count of packets matching this policy
472 @param packets - count of packets matching this policy
474 define ipsec_spd_details {
480 u8 local_start_addr[16];
481 u8 local_stop_addr[16];
482 u16 local_start_port;
484 u8 remote_start_addr[16];
485 u8 remote_stop_addr[16];
486 u16 remote_start_port;
487 u16 remote_stop_port;
495 /** \brief Add or delete IPsec tunnel interface
496 @param client_index - opaque cookie to identify the sender
497 @param context - sender context, to match reply w/ request
498 @param is_add - add IPsec tunnel interface if nonzero, else delete
499 @param esn - enable extended sequence numbers if nonzero, else disable
500 @param anti_replay - enable anti replay check if nonzero, else disable
501 @param local_ip - local IP address
502 @param remote_ip - IP address of remote IPsec peer
503 @param local_spi - SPI of outbound IPsec SA
504 @param remote_spi - SPI of inbound IPsec SA
505 @param crypto_alg - encryption algorithm ID
506 @param local_crypto_key_len - length of local crypto key in bytes
507 @param local_crypto_key - crypto key for outbound IPsec SA
508 @param remote_crypto_key_len - length of remote crypto key in bytes
509 @param remote_crypto_key - crypto key for inbound IPsec SA
510 @param integ_alg - integrity algorithm ID
511 @param local_integ_key_len - length of local integrity key in bytes
512 @param local_integ_key - integrity key for outbound IPsec SA
513 @param remote_integ_key_len - length of remote integrity key in bytes
514 @param remote_integ_key - integrity key for inbound IPsec SA
516 define ipsec_tunnel_if_add_del {
527 u8 local_crypto_key_len;
528 u8 local_crypto_key[128];
529 u8 remote_crypto_key_len;
530 u8 remote_crypto_key[128];
532 u8 local_integ_key_len;
533 u8 local_integ_key[128];
534 u8 remote_integ_key_len;
535 u8 remote_integ_key[128];
538 /** \brief Add/delete IPsec tunnel interface response
539 @param context - sender context, to match reply w/ request
540 @param retval - return status
541 @param sw_if_index - sw_if_index of new interface (for successful add)
543 define ipsec_tunnel_if_add_del_reply {
549 /** \brief Dump IPsec security association
550 @param client_index - opaque cookie to identify the sender
551 @param context - sender context, to match reply w/ request
552 @param sa_id - optional ID of an SA to dump, if ~0 dump all SAs in SAD
554 define ipsec_sa_dump {
560 /** \brief IPsec security association database response
561 @param context - sender context which was passed in the request
562 @param sa_id - SA ID, policy-based SAs >=0, tunnel interface SAs = 0
563 @param sw_if_index - sw_if_index of tunnel interface, policy-based SAs = ~0
564 @param spi - security parameter index
565 @param protocol - IPsec protocol (value from ipsec_protocol_t)
566 @param crypto_alg - crypto algorithm (value from ipsec_crypto_alg_t)
567 @param crypto_key_len - length of crypto_key in bytes
568 @param crypto_key - crypto keying material
569 @param integ_alg - integrity algorithm (value from ipsec_integ_alg_t)
570 @param integ_key_len - length of integ_key in bytes
571 @param integ_key - integrity keying material
572 @param use_esn - using extended sequence numbers when non-zero
573 @param use_anti_replay - using anti-replay window when non-zero
574 @param is_tunnel - IPsec tunnel mode when non-zero, else transport mode
575 @param is_tunnel_ipv6 - If using tunnel mode, endpoints are IPv6
576 @param tunnel_src_addr - Tunnel source address if using tunnel mode
577 @param tunnel_dst_addr - Tunnel destination address is using tunnel mode
578 @param salt - 4 byte salt
579 @param seq - current sequence number for outbound
580 @param seq_hi - high 32 bits of ESN for outbound
581 @param last_seq - highest sequence number received inbound
582 @param last_seq_hi - high 32 bits of highest ESN received inbound
583 @param replay_window - bit map of seq nums received relative to last_seq if using anti-replay
584 @param total_data_size - total bytes sent or received
586 define ipsec_sa_details {
607 u8 tunnel_src_addr[16];
608 u8 tunnel_dst_addr[16];
612 u64 last_seq_inbound;
618 /** \brief Set key on IPsec interface
619 @param client_index - opaque cookie to identify the sender
620 @param context - sender context, to match reply w/ request
621 @param sw_if_index - index of tunnel interface
622 @param key_type - type of key being set
623 @param alg - algorithm used with key
624 @param key_len - length key in bytes
627 autoreply define ipsec_tunnel_if_set_key {
639 * eval: (c-set-style "gnu")