DPDK
25.11.0
Toggle main menu visibility
Loading...
Searching...
No Matches
rte_ipsec_sad.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause
2
* Copyright(c) 2019 Intel Corporation
3
*/
4
5
#ifndef _RTE_IPSEC_SAD_H_
6
#define _RTE_IPSEC_SAD_H_
7
8
#include <stdint.h>
9
10
#include <
rte_ip6.h
>
11
18
19
#ifdef __cplusplus
20
extern
"C"
{
21
#endif
22
23
struct
rte_ipsec_sad;
24
26
enum
{
27
RTE_IPSEC_SAD_SPI_ONLY = 0,
28
RTE_IPSEC_SAD_SPI_DIP,
29
RTE_IPSEC_SAD_SPI_DIP_SIP,
30
RTE_IPSEC_SAD_KEY_TYPE_MASK,
31
};
32
33
struct
rte_ipsec_sadv4_key {
34
uint32_t spi;
35
uint32_t dip;
36
uint32_t sip;
37
};
38
39
struct
rte_ipsec_sadv6_key {
40
uint32_t spi;
41
struct
rte_ipv6_addr dip;
42
struct
rte_ipv6_addr sip;
43
};
44
45
union
rte_ipsec_sad_key {
46
struct
rte_ipsec_sadv4_key v4;
47
struct
rte_ipsec_sadv6_key v6;
48
};
49
51
#define RTE_IPSEC_SAD_NAMESIZE 64
53
#define RTE_IPSEC_SAD_FLAG_IPV6 0x1
55
#define RTE_IPSEC_SAD_FLAG_RW_CONCURRENCY 0x2
56
58
struct
rte_ipsec_sad_conf
{
60
int
socket_id
;
62
uint32_t
max_sa
[RTE_IPSEC_SAD_KEY_TYPE_MASK];
64
uint32_t
flags
;
65
};
66
85
int
86
rte_ipsec_sad_add
(
struct
rte_ipsec_sad *sad,
87
const
union
rte_ipsec_sad_key *key,
88
int
key_type,
void
*sa);
89
105
int
106
rte_ipsec_sad_del
(
struct
rte_ipsec_sad *sad,
107
const
union
rte_ipsec_sad_key *key,
108
int
key_type);
109
/*
110
* Create SAD
111
*
112
* @param name
113
* SAD name
114
* @param conf
115
* Structure containing the configuration
116
* @return
117
* Handle to SAD object on success
118
* NULL otherwise with rte_errno set to an appropriate values.
119
*/
120
struct
rte_ipsec_sad *
121
rte_ipsec_sad_create(
const
char
*name,
const
struct
rte_ipsec_sad_conf
*conf);
122
133
struct
rte_ipsec_sad *
134
rte_ipsec_sad_find_existing
(
const
char
*name);
135
142
void
143
rte_ipsec_sad_destroy
(
struct
rte_ipsec_sad *sad);
144
161
int
162
rte_ipsec_sad_lookup
(
const
struct
rte_ipsec_sad *sad,
163
const
union
rte_ipsec_sad_key *keys[],
164
void
*sa[], uint32_t n);
165
166
#ifdef __cplusplus
167
}
168
#endif
169
170
#endif
/* _RTE_IPSEC_SAD_H_ */
rte_ip6.h
rte_ipsec_sad_add
int rte_ipsec_sad_add(struct rte_ipsec_sad *sad, const union rte_ipsec_sad_key *key, int key_type, void *sa)
rte_ipsec_sad_find_existing
struct rte_ipsec_sad * rte_ipsec_sad_find_existing(const char *name)
rte_ipsec_sad_del
int rte_ipsec_sad_del(struct rte_ipsec_sad *sad, const union rte_ipsec_sad_key *key, int key_type)
rte_ipsec_sad_lookup
int rte_ipsec_sad_lookup(const struct rte_ipsec_sad *sad, const union rte_ipsec_sad_key *keys[], void *sa[], uint32_t n)
rte_ipsec_sad_destroy
void rte_ipsec_sad_destroy(struct rte_ipsec_sad *sad)
rte_ipsec_sad_conf
Definition
rte_ipsec_sad.h:58
rte_ipsec_sad_conf::socket_id
int socket_id
Definition
rte_ipsec_sad.h:60
rte_ipsec_sad_conf::max_sa
uint32_t max_sa[RTE_IPSEC_SAD_KEY_TYPE_MASK]
Definition
rte_ipsec_sad.h:62
rte_ipsec_sad_conf::flags
uint32_t flags
Definition
rte_ipsec_sad.h:64
lib
ipsec
rte_ipsec_sad.h
Generated by
1.17.0