API Reference Manual 1.51.0
Loading...
Searching...
No Matches
ipsec_api/odp_ipsec_sa_db.h
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2014-2018 Linaro Limited
3 */
4
7#ifndef ODP_IPSEC_SA_DB_H_
8#define ODP_IPSEC_SA_DB_H_
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#include <odp_ipsec_misc.h>
15
16typedef enum sa_mode_s {
17 IPSEC_SA_MODE_TRANSPORT,
18 IPSEC_SA_MODE_TUNNEL
19} sa_mode_t;
20
21typedef enum sa_flags_s {
22 BIT_MODE_CIPHER = 1,
23 BIT_MODE_AUTH = 2,
24} sa_flags_t;
25
29typedef struct sa_db_entry_s {
30 struct sa_db_entry_s *next;
31 uint32_t src_ip;
32 uint32_t dst_ip;
33 uint32_t spi;
34 ipsec_alg_t alg;
35 ipsec_key_t key;
36 uint32_t block_len;
37 uint32_t iv_len;
38 uint32_t icv_len;
39 sa_mode_t mode;
40 int flags;
41} sa_db_entry_t;
42
46typedef struct sa_db_s {
47 uint32_t index;
48 sa_db_entry_t *list;
49 sa_db_entry_t array[MAX_DB];
50} sa_db_t;
51
53void init_sa_db(void);
54
65int create_sa_db_entry(char *input, odp_bool_t cipher);
69void dump_sa_db(void);
70
80sa_db_entry_t *find_sa_db_entry(ip_addr_range_t *src,
81 ip_addr_range_t *dst,
82 odp_bool_t cipher);
83
87typedef struct tun_db_entry_s {
88 struct tun_db_entry_s *next;
89 uint32_t src_ip;
90 uint32_t dst_ip;
91 uint32_t tun_src_ip;
92 uint32_t tun_dst_ip;
93} tun_db_entry_t;
94
98typedef struct tun_db_s {
99 uint32_t index;
100 tun_db_entry_t *list;
101 tun_db_entry_t array[MAX_DB];
102} tun_db_t;
103
105void init_tun_db(void);
106
116int create_tun_db_entry(char *input);
117
121void dump_tun_db(void);
122
131tun_db_entry_t *find_tun_db_entry(uint32_t ip_src,
132 uint32_t ip_dst);
133
134#ifdef __cplusplus
135}
136#endif
137
138#endif
bool odp_bool_t
Boolean type.