From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2017 08:00:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,315,1491289200"; d="scan'208";a="97610233" Received: from silpixa00383879.ir.intel.com (HELO silpixa00383879.ger.corp.intel.com) ([10.237.223.127]) by orsmga005.jf.intel.com with ESMTP; 09 May 2017 08:00:57 -0700 From: Radu Nicolau To: dev@dpdk.org Cc: Radu Nicolau Date: Tue, 9 May 2017 15:57:55 +0100 Message-Id: <1494341879-18718-2-git-send-email-radu.nicolau@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494341879-18718-1-git-send-email-radu.nicolau@intel.com> References: <1494341879-18718-1-git-send-email-radu.nicolau@intel.com> Subject: [dpdk-dev] [RFC][PATCH 1/5] cryptodev: Updated API to add suport for inline IPSec. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 May 2017 15:01:03 -0000 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