From 11959b50936026a43106f9079b1df0d9b67e674a Mon Sep 17 00:00:00 2001 From: Szymon Sliwa Date: Wed, 23 Aug 2017 17:42:22 +0200 Subject: plugins: odp: Add ODP-IPsec node Based heavily on the src/vnet/ipsec. Reuses the pure software VPP IPsec implementation CLI command. To use enable-odp-crypto needs to be present in the odp section of startup configuration, like this: odp { enable-odp-crypto } Currenlty only IPv4 is supported, and only in transport mode. Authentication headers are not supported, this limitation is inherited from VPP. Supported crypto algorithms are aes-cbc-128 for encryption, and sha-512-256, sha-256-128, sha1-96 for authentication Change-Id: I08c66f96a73d8cb4ef1095f181ddf47506abc39a Signed-off-by: Szymon Sliwa --- src/plugins/odp/ipsec/ipsec.h | 57 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/plugins/odp/ipsec/ipsec.h (limited to 'src/plugins/odp/ipsec/ipsec.h') diff --git a/src/plugins/odp/ipsec/ipsec.h b/src/plugins/odp/ipsec/ipsec.h new file mode 100644 index 00000000..0f3ceb86 --- /dev/null +++ b/src/plugins/odp/ipsec/ipsec.h @@ -0,0 +1,57 @@ +/* + * 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 +#include + +typedef struct +{ + odp_crypto_session_t sess; + u32 digest_size; + u8 iv_data[16]; + u32 iv_len; + u32 key_size; +} 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); + +clib_error_t *ipsec_init (vlib_main_t * vm); + +#endif /* __IPSEC_H__ */ + +/* + * fd.io coding-style-patch-verification: ON + * + * Local Variables: + * eval: (c-set-style "gnu") + * End: + */ -- cgit 1.2.3-korg