bool aead;
+ bool aes_gmac;
+
+ bool auth_only;
+
+ /* Antireplay packet */
+ bool ar_packet;
+
union {
struct {
struct rte_crypto_sym_xform cipher;
} xform;
};
+enum df_flags {
+ TEST_IPSEC_COPY_DF_INNER_0 = 1,
+ TEST_IPSEC_COPY_DF_INNER_1,
+ TEST_IPSEC_SET_DF_0_INNER_1,
+ TEST_IPSEC_SET_DF_1_INNER_0,
+};
+
+#define TEST_IPSEC_DSCP_VAL 0x12
+
+enum dscp_flags {
+ TEST_IPSEC_COPY_DSCP_INNER_0 = 1,
+ TEST_IPSEC_COPY_DSCP_INNER_1,
+ TEST_IPSEC_SET_DSCP_0_INNER_1,
+ TEST_IPSEC_SET_DSCP_1_INNER_0,
+};
+
+#define TEST_IPSEC_FLABEL_VAL 0x1234
+
+enum flabel_flags {
+ TEST_IPSEC_COPY_FLABEL_INNER_0 = 1,
+ TEST_IPSEC_COPY_FLABEL_INNER_1,
+ TEST_IPSEC_SET_FLABEL_0_INNER_1,
+ TEST_IPSEC_SET_FLABEL_1_INNER_0,
+};
+
struct ipsec_test_flags {
bool display_alg;
bool sa_expiry_pkts_soft;
bool transport;
bool fragment;
bool stats_success;
+ bool antireplay;
+ enum df_flags df;
+ enum dscp_flags dscp;
+ enum flabel_flags flabel;
+ bool dec_ttl_or_hop_limit;
+ bool ah;
};
struct crypto_param {
enum rte_crypto_aead_algorithm aead;
} alg;
uint16_t key_length;
+ uint16_t iv_length;
uint16_t digest_length;
};
};
static const struct crypto_param cipher_list[] = {
+ {
+ .type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+ .alg.cipher = RTE_CRYPTO_CIPHER_NULL,
+ .key_length = 0,
+ .iv_length = 0,
+ },
{
.type = RTE_CRYPTO_SYM_XFORM_CIPHER,
.alg.cipher = RTE_CRYPTO_CIPHER_AES_CBC,
.key_length = 16,
+ .iv_length = 16,
},
{
.type = RTE_CRYPTO_SYM_XFORM_CIPHER,
.alg.cipher = RTE_CRYPTO_CIPHER_AES_CTR,
.key_length = 16,
+ .iv_length = 16,
},
{
.type = RTE_CRYPTO_SYM_XFORM_CIPHER,
.alg.cipher = RTE_CRYPTO_CIPHER_AES_CTR,
.key_length = 24,
+ .iv_length = 16,
},
{
.type = RTE_CRYPTO_SYM_XFORM_CIPHER,
.alg.cipher = RTE_CRYPTO_CIPHER_AES_CTR,
.key_length = 32,
+ .iv_length = 16,
},
};
.key_length = 64,
.digest_length = 32,
},
+ {
+ .type = RTE_CRYPTO_SYM_XFORM_AUTH,
+ .alg.auth = RTE_CRYPTO_AUTH_AES_XCBC_MAC,
+ .key_length = 16,
+ .digest_length = 12,
+ },
+ {
+ .type = RTE_CRYPTO_SYM_XFORM_AUTH,
+ .alg.auth = RTE_CRYPTO_AUTH_AES_GMAC,
+ .key_length = 16,
+ .digest_length = 16,
+ .iv_length = 12,
+ },
};
struct crypto_param_comb {
(RTE_DIM(cipher_list) *
RTE_DIM(auth_list))];
+extern struct crypto_param_comb ah_alg_list[2 * (RTE_DIM(auth_list) - 1)];
+
void test_ipsec_alg_list_populate(void);
+void test_ipsec_ah_alg_list_populate(void);
+
int test_ipsec_sec_caps_verify(struct rte_security_ipsec_xform *ipsec_xform,
const struct rte_security_capability *sec_cap,
bool silent);
struct ipsec_test_data *res_d, bool silent,
const struct ipsec_test_flags *flags);
-int test_ipsec_status_check(struct rte_crypto_op *op,
+int test_ipsec_status_check(const struct ipsec_test_data *td,
+ struct rte_crypto_op *op,
const struct ipsec_test_flags *flags,
enum rte_security_ipsec_sa_direction dir,
int pkt_num);
const struct ipsec_test_flags *flags,
enum rte_security_ipsec_sa_direction dir);
+int test_ipsec_pkt_update(uint8_t *pkt, const struct ipsec_test_flags *flags);
+
#endif