[dpdk-dev,RFC,1/5] cryptodev: Updated API to add suport for inline IPSec.
Checks
Commit Message
Added new xform, rte_crypto_ipsec_xform
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
lib/librte_cryptodev/rte_crypto_sym.h | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
@@ -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 */
+
};
};