blob: c947d7ce6174820375d4e132d6594d860cdc2c43 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
/*
* Copyright (c) 2015 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __ODP_IPSEC_H__
#define __ODP_IPSEC_H__
#include <odp_api.h>
#include <vnet/ipsec/ipsec.h>
typedef struct
{
u8 is_odp_sa_present;
odp_ipsec_sa_t odp_sa;
odp_crypto_session_t sess;
u32 digest_size;
u8 iv_data[16];
u32 iv_len;
u32 key_size;
ip46_address_t tunnel_dst, tunnel_src;
} sa_data_t;
typedef struct
{
sa_data_t *sa_sess_d[2];
odp_queue_t post_encrypt, post_decrypt;
} odp_crypto_worker_main_t;
typedef struct
{
odp_crypto_worker_main_t *workers;
} odp_crypto_main_t;
extern vlib_node_registration_t odp_crypto_input_node;
extern odp_crypto_main_t odp_crypto_main;
extern u8 enable_odp_crypto;
int create_sess (ipsec_sa_t * sa, sa_data_t * sess, int is_outbound);
int create_odp_sa (ipsec_sa_t * sa, sa_data_t * sess, int flow_label,
int is_outbound);
clib_error_t *ipsec_init (vlib_main_t * vm, u8 ipsec_api);
#endif /* __IPSEC_H__ */
/*
* fd.io coding-style-patch-verification: ON
*
* Local Variables:
* eval: (c-set-style "gnu")
* End:
*/
|