aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/odp/ipsec/ipsec.h
diff options
context:
space:
mode:
authorSzymon Sliwa <szs@semihalf.com>2017-08-23 17:42:22 +0200
committerSzymon Sliwa <szs@semihalf.com>2018-02-05 11:01:09 +0100
commit11959b50936026a43106f9079b1df0d9b67e674a (patch)
tree5f7a0e00e210e301c75c5af4327fb9296b2305ce /src/plugins/odp/ipsec/ipsec.h
parent130c8f744801d71982e30993b884c76d9d97d309 (diff)
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 <szs@semihalf.com>
Diffstat (limited to 'src/plugins/odp/ipsec/ipsec.h')
-rw-r--r--src/plugins/odp/ipsec/ipsec.h57
1 files changed, 57 insertions, 0 deletions
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 <odp_api.h>
+#include <vnet/ipsec/ipsec.h>
+
+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:
+ */