FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
ipsec_if.h
Go to the documentation of this file.
1 /*
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:
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 #ifndef __IPSEC_IF_H__
16 #define __IPSEC_IF_H__
17 
18 #include <vnet/ipsec/ipsec_sa.h>
19 
20 typedef enum
21 {
28 
29 typedef struct
30 {
31  /* Required for pool_get_aligned */
32  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
40 
41 typedef struct
42 {
47  ip46_address_t local_ip, remote_ip;
52  u8 local_crypto_key[128];
54  u8 remote_crypto_key[128];
57  u8 local_integ_key[128];
59  u8 remote_integ_key[128];
66 
67 /* *INDENT-OFF* */
68 typedef CLIB_PACKED
69 (struct {
70  /*
71  * Key fields: remote ip and spi on incoming packet
72  * all fields in NET byte order
73  */
74  union {
75  struct {
76  u32 remote_ip;
77  u32 spi;
78  };
79  u64 as_u64;
80  };
81 }) ipsec4_tunnel_key_t;
82 /* *INDENT-ON* */
83 
84 /* *INDENT-OFF* */
85 typedef CLIB_PACKED
86 (struct {
87  /*
88  * Key fields: remote ip and spi on incoming packet
89  * all fields in NET byte order
90  */
91  ip6_address_t remote_ip;
92  u32 spi;
93 }) ipsec6_tunnel_key_t;
94 /* *INDENT-ON* */
95 
96 typedef struct
97 {
104 
107  args, u32 * sw_if_index);
110  const
112  args);
113 
114 extern int ipsec_set_interface_key (vnet_main_t * vnm, u32 hw_if_index,
115  ipsec_if_set_key_type_t type,
116  u8 alg, u8 * key);
117 extern int ipsec_set_interface_sa (vnet_main_t * vnm, u32 hw_if_index,
119 
120 extern u8 *format_ipsec_tunnel (u8 * s, va_list * args);
121 
122 #endif /* __IPSEC_IF_H__ */
123 
124 /*
125  * fd.io coding-style-patch-verification: ON
126  *
127  * Local Variables:
128  * eval: (c-set-style "gnu")
129  * End:
130  */
int ipsec_set_interface_sa(vnet_main_t *vnm, u32 hw_if_index, u32 sa_id, u8 is_outbound)
Definition: ipsec_if.c:563
u32 sw_if_index
Definition: ipsec_gre.api:37
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
Definition: cache.h:60
u64 as_u64
Definition: bihash_doc.h:63
ipsec_integ_alg_t
Definition: ipsec_sa.h:60
unsigned long u64
Definition: types.h:89
int ipsec_add_del_tunnel_if(ipsec_add_del_tunnel_args_t *args)
Definition: ipsec_if.c:214
unsigned char u8
Definition: types.h:56
enum vnet_hw_interface_flags_t_ vnet_hw_interface_flags_t
unsigned int u32
Definition: types.h:88
u32 sa_id
Definition: ipsec.api:94
ip46_address_t remote_ip
Definition: ipsec_if.h:47
u8 * format_ipsec_tunnel(u8 *s, va_list *args)
Definition: ipsec_format.c:336
int ipsec_add_del_tunnel_if_internal(vnet_main_t *vnm, ipsec_add_del_tunnel_args_t *args, u32 *sw_if_index)
Definition: ipsec_if.c:256
int ipsec_add_del_ipsec_gre_tunnel(vnet_main_t *vnm, const ipsec_gre_tunnel_add_del_args_t *args)
Definition: ipsec_if.c:437
ipsec_crypto_alg_t crypto_alg
Definition: ipsec_if.h:50
u8 is_outbound
Definition: ipsec.api:92
u32 spi
Definition: ipsec.api:270
vnet_hw_interface_flags_t flags
Definition: ipsec_if.h:37
ipsec_integ_alg_t integ_alg
Definition: ipsec_if.h:55
int ipsec_set_interface_key(vnet_main_t *vnm, u32 hw_if_index, ipsec_if_set_key_type_t type, u8 alg, u8 *key)
Definition: ipsec_if.c:517
typedef CLIB_PACKED(struct { union { struct { u32 remote_ip;u32 spi;};u64 as_u64;};}) ipsec4_tunnel_key_t
ipsec_crypto_alg_t
Definition: ipsec_sa.h:38
typedef key
Definition: ipsec.api:244
ipsec_if_set_key_type_t
Definition: ipsec_if.h:20