From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radu Nicolau Subject: [RFC][PATCH 1/5] cryptodev: Updated API to add suport for inline IPSec. Date: Tue, 9 May 2017 15:57:55 +0100 Message-ID: <1494341879-18718-2-git-send-email-radu.nicolau@intel.com> References: <1494341879-18718-1-git-send-email-radu.nicolau@intel.com> Cc: Radu Nicolau To: dev@dpdk.org Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 8ED31688B for ; Tue, 9 May 2017 17:01:02 +0200 (CEST) In-Reply-To: <1494341879-18718-1-git-send-email-radu.nicolau@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Added new xform, rte_crypto_ipsec_xform Signed-off-by: Radu Nicolau --- lib/librte_cryptodev/rte_crypto_sym.h | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h index 3a40844..b11df10 100644 --- a/lib/librte_cryptodev/rte_crypto_sym.h +++ b/lib/librte_cryptodev/rte_crypto_sym.h @@ -346,11 +346,40 @@ struct rte_crypto_auth_xform { */ }; + +enum rte_crypto_ipsec_direction { + RTE_CRYPTO_INBOUND = 1, + RTE_CRYPTO_OUTBOUND +}; + +struct rte_crypto_ipsec_addr { + enum ip_addr_type { + IPV4_ADDRESS, + IPV6_ADDRESS + } type; /**< IP address type IPv4/v6 */ + + union { + uint32_t ipv4; /**< IPv4 Address */ + uint32_t ipv6[4]; /**< IPv6 Address */ + }; /**< IP address */ +}; + + +struct rte_crypto_ipsec_xform { + enum rte_crypto_ipsec_direction dir; /**< Direction - In/Out */ + uint32_t spi; /**< SPI */ + uint32_t salt; /**< Salt */ + struct rte_crypto_ipsec_addr src_ip; /**< Source IP */ + struct rte_crypto_ipsec_addr dst_ip; /**< Destination IP */ +}; + + /** Crypto transformation types */ enum rte_crypto_sym_xform_type { RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED = 0, /**< No xform specified */ RTE_CRYPTO_SYM_XFORM_AUTH, /**< Authentication xform */ - RTE_CRYPTO_SYM_XFORM_CIPHER /**< Cipher xform */ + RTE_CRYPTO_SYM_XFORM_CIPHER, /**< Cipher xform */ + RTE_CRYPTO_SYM_XFORM_IPSEC /**< IPsec xform */ }; /** @@ -373,6 +402,9 @@ struct rte_crypto_sym_xform { /**< Authentication / hash xform */ struct rte_crypto_cipher_xform cipher; /**< Cipher xform */ + struct rte_crypto_ipsec_xform ipsec; + /**< IPsec xform */ + }; }; -- 2.7.4