test/threads: add unit test
[dpdk.git] / app / test / test_cryptodev_security_ipsec.h
index c4ecfaf..0d9b5b6 100644 (file)
@@ -41,6 +41,13 @@ struct ipsec_test_data {
 
        bool aead;
 
+       bool aes_gmac;
+
+       bool auth_only;
+
+       /* Antireplay packet */
+       bool ar_packet;
+
        union {
                struct {
                        struct rte_crypto_sym_xform cipher;
@@ -82,8 +89,11 @@ struct ipsec_test_flags {
        bool transport;
        bool fragment;
        bool stats_success;
+       bool antireplay;
        enum df_flags df;
        enum dscp_flags dscp;
+       bool dec_ttl_or_hop_limit;
+       bool ah;
 };
 
 struct crypto_param {
@@ -178,6 +188,13 @@ static const struct crypto_param auth_list[] = {
                .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 {
@@ -194,8 +211,12 @@ extern struct crypto_param_comb alg_list[RTE_DIM(aead_list) +
                                         (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);
@@ -234,7 +255,8 @@ int test_ipsec_post_process(struct rte_mbuf *m,
                            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);