854076ece6dd6e5f6a3e61a7f075babfe644c1f2
[vpp.git] / src / vnet / ipsec / ipsec_spd.h
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 struct ipsec_policy_t_;
21
22 /**
23  * @brief A Secruity Policy Database
24  */
25 typedef struct ipsec_spd_t_
26 {
27   u32 id;
28   /* pool of policies */
29   struct ipsec_policy_t_ *policies;
30   /* vectors of policy indices */
31   u32 *ipv4_outbound_policies;
32   u32 *ipv6_outbound_policies;
33   u32 *ipv4_inbound_protect_policy_indices;
34   u32 *ipv4_inbound_policy_discard_and_bypass_indices;
35   u32 *ipv6_inbound_protect_policy_indices;
36   u32 *ipv6_inbound_policy_discard_and_bypass_indices;
37 } ipsec_spd_t;
38
39 /**
40  * @brief Add/Delete a SPD
41  */
42 extern int ipsec_add_del_spd (vlib_main_t * vm, u32 spd_id, int is_add);
43
44 /**
45  * @brief Bind/attach a SPD to an interface
46  */
47 extern int ipsec_set_interface_spd (vlib_main_t * vm,
48                                     u32 sw_if_index, u32 spd_id, int is_add);
49
50 #endif /* __IPSEC_SPD_H__ */
51
52 /*
53  * fd.io coding-style-patch-verification: ON
54  *
55  * Local Variables:
56  * eval: (c-set-style "gnu")
57  * End:
58  */