2 * Copyright (c) 2015 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.
15 #ifndef __IPSEC_SPD_SA_H__
16 #define __IPSEC_SPD_SA_H__
18 #include <vlib/vlib.h>
19 #include <vnet/ip/ip.h>
21 #define foreach_ipsec_crypto_alg \
23 _ (1, AES_CBC_128, "aes-cbc-128") \
24 _ (2, AES_CBC_192, "aes-cbc-192") \
25 _ (3, AES_CBC_256, "aes-cbc-256") \
26 _ (4, AES_CTR_128, "aes-ctr-128") \
27 _ (5, AES_CTR_192, "aes-ctr-192") \
28 _ (6, AES_CTR_256, "aes-ctr-256") \
29 _ (7, AES_GCM_128, "aes-gcm-128") \
30 _ (8, AES_GCM_192, "aes-gcm-192") \
31 _ (9, AES_GCM_256, "aes-gcm-256") \
32 _ (10, DES_CBC, "des-cbc") \
33 _ (11, 3DES_CBC, "3des-cbc")
37 #define _(v, f, s) IPSEC_CRYPTO_ALG_##f = v,
38 foreach_ipsec_crypto_alg
43 #define foreach_ipsec_integ_alg \
45 _ (1, MD5_96, "md5-96") /* RFC2403 */ \
46 _ (2, SHA1_96, "sha1-96") /* RFC2404 */ \
47 _ (3, SHA_256_96, "sha-256-96") /* draft-ietf-ipsec-ciph-sha-256-00 */ \
48 _ (4, SHA_256_128, "sha-256-128") /* RFC4868 */ \
49 _ (5, SHA_384_192, "sha-384-192") /* RFC4868 */ \
50 _ (6, SHA_512_256, "sha-512-256") /* RFC4868 */
54 #define _(v, f, s) IPSEC_INTEG_ALG_##f = v,
55 foreach_ipsec_integ_alg
62 IPSEC_PROTOCOL_AH = 0,
63 IPSEC_PROTOCOL_ESP = 1
70 ipsec_protocol_t protocol;
72 ipsec_crypto_alg_t crypto_alg;
76 ipsec_integ_alg_t integ_alg;
86 ip46_address_t tunnel_src_addr;
87 ip46_address_t tunnel_dst_addr;
103 extern int ipsec_add_del_sa (vlib_main_t * vm, ipsec_sa_t * new_sa,
105 extern u8 ipsec_is_sa_used (u32 sa_index);
106 extern int ipsec_set_sa_key (vlib_main_t * vm, ipsec_sa_t * sa_update);
107 extern u32 ipsec_get_sa_index_by_sa_id (u32 sa_id);
109 extern u8 *format_ipsec_crypto_alg (u8 * s, va_list * args);
110 extern u8 *format_ipsec_integ_alg (u8 * s, va_list * args);
111 extern uword unformat_ipsec_crypto_alg (unformat_input_t * input,
113 extern uword unformat_ipsec_integ_alg (unformat_input_t * input,
116 #endif /* __IPSEC_SPD_SA_H__ */
119 * fd.io coding-style-patch-verification: ON
122 * eval: (c-set-style "gnu")