FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
ipsec_spd.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_SPD_H__
16 #define __IPSEC_SPD_H__
17 
18 #include <vlib/vlib.h>
19 
20 #define foreach_ipsec_spd_policy_type \
21  _(IP4_OUTBOUND, "ip4-outbound") \
22  _(IP6_OUTBOUND, "ip6-outbound") \
23  _(IP4_INBOUND_PROTECT, "ip4-inbound-protect") \
24  _(IP6_INBOUND_PROTECT, "ip6-inbound-protect") \
25  _(IP4_INBOUND_BYPASS, "ip4-inbound-bypass") \
26  _(IP6_INBOUND_BYPASS, "ip6-inbound-bypass") \
27  _(IP4_INBOUND_DISCARD, "ip4-inbound-discard") \
28  _(IP6_INBOUND_DISCARD, "ip6-inbound-discard")
29 
30 typedef enum ipsec_spd_policy_t_
31 {
32 #define _(s,v) IPSEC_SPD_POLICY_##s,
34 #undef _
37 
38 #define FOR_EACH_IPSEC_SPD_POLICY_TYPE(_t) \
39  for (_t = 0; _t < IPSEC_SPD_POLICY_N_TYPES; _t++)
40 
41 extern u8 *format_ipsec_policy_type (u8 * s, va_list * args);
42 
43 /**
44  * @brief A Secruity Policy Database
45  */
46 typedef struct
47 {
48  /** the User's ID for this policy */
50  /** vectors for each of the policy types */
52 } ipsec_spd_t;
53 
54 /**
55  * @brief Add/Delete a SPD
56  */
57 extern int ipsec_add_del_spd (vlib_main_t * vm, u32 spd_id, int is_add);
58 
59 /**
60  * @brief Bind/attach a SPD to an interface
61  */
63  u32 sw_if_index, u32 spd_id, int is_add);
64 
65 extern u8 *format_ipsec_spd (u8 * s, va_list * args);
66 
67 #endif /* __IPSEC_SPD_H__ */
68 
69 /*
70  * fd.io coding-style-patch-verification: ON
71  *
72  * Local Variables:
73  * eval: (c-set-style "gnu")
74  * End:
75  */
vlib.h
foreach_ipsec_spd_policy_type
#define foreach_ipsec_spd_policy_type
Definition: ipsec_spd.h:20
format_ipsec_spd
u8 * format_ipsec_spd(u8 *s, va_list *args)
Definition: ipsec_format.c:204
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
ipsec_spd_t::id
u32 id
the User's ID for this policy
Definition: ipsec_spd.h:49
IPSEC_SPD_POLICY_N_TYPES
@ IPSEC_SPD_POLICY_N_TYPES
Definition: ipsec_spd.h:35
ipsec_spd_policy_t_
ipsec_spd_policy_t_
Definition: ipsec_spd.h:30
format_ipsec_policy_type
u8 * format_ipsec_policy_type(u8 *s, va_list *args)
Definition: ipsec_format.c:47
u32
unsigned int u32
Definition: types.h:88
ipsec_spd_t
A Secruity Policy Database.
Definition: ipsec_spd.h:46
vlib_main_t
Definition: main.h:102
u8
unsigned char u8
Definition: types.h:56
ipsec_add_del_spd
int ipsec_add_del_spd(vlib_main_t *vm, u32 spd_id, int is_add)
Add/Delete a SPD.
Definition: ipsec_spd.c:20
ipsec_spd_policy_type_t
enum ipsec_spd_policy_t_ ipsec_spd_policy_type_t
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
ipsec_set_interface_spd
int ipsec_set_interface_spd(vlib_main_t *vm, u32 sw_if_index, u32 spd_id, int is_add)
Bind/attach a SPD to an interface.
Definition: ipsec_spd.c:63