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