MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fill_ipsec_param

Function fill_ipsec_param

dpdk/app/test/test_ipsec.c:668–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

666}
667
668static int
669fill_ipsec_param(uint32_t replay_win_sz, uint64_t flags)
670{
671 struct ipsec_unitest_params *ut_params = &unittest_params;
672 struct rte_ipsec_sa_prm *prm = &ut_params->sa_prm;
673 const struct supported_auth_algo *auth_algo;
674 const struct supported_cipher_algo *cipher_algo;
675
676 memset(prm, 0, sizeof(*prm));
677
678 prm->userdata = 1;
679 prm->flags = flags;
680
681 /* setup ipsec xform */
682 prm->ipsec_xform = ut_params->ipsec_xform;
683 prm->ipsec_xform.salt = (uint32_t)rte_rand();
684 prm->ipsec_xform.replay_win_sz = replay_win_sz;
685
686 /* setup tunnel related fields */
687 prm->tun.hdr_len = sizeof(ipv4_outer);
688 prm->tun.next_proto = IPPROTO_IPIP;
689 prm->tun.hdr = &ipv4_outer;
690
691 /* setup crypto section */
692 if (uparams.aead != 0) {
693 /* TODO: will need to fill out with other test cases */
694 } else {
695 if (uparams.auth == 0 && uparams.cipher == 0)
696 return TEST_FAILED;
697
698 auth_algo = find_match_auth_algo(uparams.auth_algo);
699 cipher_algo = find_match_cipher_algo(uparams.cipher_algo);
700
701 fill_crypto_xform(ut_params, auth_algo, cipher_algo);
702 }
703
704 prm->crypto_xform = ut_params->crypto_xforms;
705 return TEST_SUCCESS;
706}
707
708static int
709create_sa(enum rte_security_session_action_type action_type,

Callers 1

create_saFunction · 0.70

Calls 5

memsetFunction · 0.85
rte_randFunction · 0.85
find_match_auth_algoFunction · 0.70
find_match_cipher_algoFunction · 0.70
fill_crypto_xformFunction · 0.70

Tested by

no test coverage detected