diff options
author | Szymon Sliwa <szs@semihalf.com> | 2017-08-23 17:42:22 +0200 |
---|---|---|
committer | Szymon Sliwa <szs@semihalf.com> | 2018-02-05 11:01:09 +0100 |
commit | 11959b50936026a43106f9079b1df0d9b67e674a (patch) | |
tree | 5f7a0e00e210e301c75c5af4327fb9296b2305ce /src/plugins/odp/odp_packet.c | |
parent | 130c8f744801d71982e30993b884c76d9d97d309 (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/odp_packet.c')
-rwxr-xr-x | src/plugins/odp/odp_packet.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/odp/odp_packet.c b/src/plugins/odp/odp_packet.c index 840a7e91..fb9ab192 100755 --- a/src/plugins/odp/odp_packet.c +++ b/src/plugins/odp/odp_packet.c @@ -13,6 +13,7 @@ #include <vnet/plugin/plugin.h> #include <vpp/app/version.h> #include <odp/odp_packet.h> +#include <odp/ipsec/ipsec.h> odp_packet_main_t *odp_packet_main; u32 rx_sched_wait; @@ -20,6 +21,8 @@ u32 tx_burst_size; u32 num_pkts_in_pool = SHM_PKT_POOL_NB_PKTS; odp_if_mode_t def_if_mode; odp_if_config_t *if_config; +odp_crypto_main_t odp_crypto_main; +u8 enable_odp_crypto; static u32 odp_packet_eth_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hi, @@ -422,6 +425,10 @@ odp_config (vlib_main_t * vm, unformat_input_t * input) odp_device_config (param, NULL); vec_free (param); } + else if (unformat (input, "enable-odp-crypto")) + { + enable_odp_crypto = 1; + } else if (unformat (input, "%s", ¶m)) { clib_warning ("%s: Unknown option %s\n", __func__, param); @@ -464,6 +471,8 @@ odp_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) /* Initialization complete and worker threads can start */ tm->worker_thread_release = 1; + ipsec_init (vlib_get_main ()); + return 0; } |