Lines Matching refs:desc
569 struct xfrm_desc desc; member
578 tr.desc = *d; in write_test_result()
827 struct xfrm_desc *desc) in xfrm_state_pack_algo() argument
840 alen = strlen(desc->a_algo); in xfrm_state_pack_algo()
841 elen = strlen(desc->e_algo); in xfrm_state_pack_algo()
842 clen = strlen(desc->c_algo); in xfrm_state_pack_algo()
843 aelen = strlen(desc->ae_algo); in xfrm_state_pack_algo()
846 switch (desc->proto) { in xfrm_state_pack_algo()
852 strncpy(alg.u.alg.alg_name, desc->a_algo, ALGO_LEN - 1); in xfrm_state_pack_algo()
853 if (xfrm_fill_key(desc->a_algo, alg.u.alg.alg_key, in xfrm_state_pack_algo()
863 strncpy(alg.u.alg.alg_name, desc->c_algo, ALGO_LEN - 1); in xfrm_state_pack_algo()
864 if (xfrm_fill_key(desc->c_algo, alg.u.alg.alg_key, in xfrm_state_pack_algo()
875 alg.u.aead.alg_icv_len = desc->icv_len; in xfrm_state_pack_algo()
876 strncpy(alg.u.aead.alg_name, desc->ae_algo, ALGO_LEN - 1); in xfrm_state_pack_algo()
877 if (xfrm_fill_key(desc->ae_algo, alg.u.aead.alg_key, in xfrm_state_pack_algo()
883 strncpy(alg.u.alg.alg_name, desc->e_algo, ALGO_LEN - 1); in xfrm_state_pack_algo()
885 if (xfrm_fill_key(desc->e_algo, alg.u.alg.alg_key, in xfrm_state_pack_algo()
891 strncpy(alg.u.alg.alg_name, desc->a_algo, ALGO_LEN); in xfrm_state_pack_algo()
893 if (xfrm_fill_key(desc->a_algo, alg.u.alg.alg_key, in xfrm_state_pack_algo()
916 struct xfrm_desc *desc) in xfrm_state_add() argument
941 req.info.id.proto = desc->proto; in xfrm_state_add()
954 if (xfrm_state_pack_algo(&req.nh, sizeof(req), desc)) in xfrm_state_add()
967 struct xfrm_desc *desc) in xfrm_usersa_found() argument
980 if (info->id.spi != spi || info->id.proto != desc->proto) in xfrm_usersa_found()
1005 struct xfrm_desc *desc) in xfrm_state_check() argument
1060 if (xfrm_usersa_found(&answer.info, spi, src, dst, desc)) in xfrm_state_check()
1069 struct xfrm_desc *desc) in xfrm_set() argument
1073 err = xfrm_state_add(xfrm_sock, (*seq)++, gen_spi(src), src, dst, desc); in xfrm_set()
1079 err = xfrm_state_add(xfrm_sock, (*seq)++, gen_spi(src), dst, src, desc); in xfrm_set()
1086 err = xfrm_state_check(xfrm_sock, (*seq)++, gen_spi(src), src, dst, desc); in xfrm_set()
1087 err |= xfrm_state_check(xfrm_sock, (*seq)++, gen_spi(src), dst, src, desc); in xfrm_set()
1435 unsigned int nr, struct xfrm_desc *desc) in xfrm_expire_state() argument
1451 if (xfrm_state_add(xfrm_sock, (*seq)++, gen_spi(src), src, dst, desc)) { in xfrm_expire_state()
1467 req.expire.state.id.proto = desc->proto; in xfrm_expire_state()
1507 unsigned int nr, struct xfrm_desc *desc) in xfrm_expire_policy() argument
1526 XFRM_POLICY_OUT, tunsrc, tundst, desc->proto)) { in xfrm_expire_policy()
1734 unsigned int nr, int cmd_fd, void *buf, struct xfrm_desc *desc) in child_serv() argument
1753 memcpy(&msg.body.xfrm_desc, desc, sizeof(*desc)); in child_serv()
1756 if (xfrm_prepare(xfrm_sock, seq, src, dst, tunsrc, tundst, desc->proto)) { in child_serv()
1763 memcpy(&msg.body.xfrm_desc, desc, sizeof(*desc)); in child_serv()
1765 if (xfrm_set(xfrm_sock, seq, src, dst, tunsrc, tundst, desc)) { in child_serv()
1782 memcpy(&msg.body.xfrm_desc, desc, sizeof(*desc)); in child_serv()
1785 if (xfrm_delete(xfrm_sock, seq, src, dst, tunsrc, tundst, desc->proto)) { in child_serv()
1793 memcpy(&msg.body.xfrm_desc, desc, sizeof(*desc)); in child_serv()
1804 struct xfrm_desc desc; in child_f() local
1828 ssize_t received = read(test_desc_fd, &desc, sizeof(desc)); in child_f()
1834 if (received != sizeof(desc)) { in child_f()
1839 switch (desc.type) { in child_f()
1842 cmd_fd, buf, &desc); in child_f()
1846 -1, desc.proto); in child_f()
1852 ret = xfrm_expire_state(xfrm_sock, &seq, nr, &desc); in child_f()
1855 ret = xfrm_expire_policy(xfrm_sock, &seq, nr, &desc); in child_f()
1861 printk("Unknown desc type %d", desc.type); in child_f()
1864 write_test_result(ret, &desc); in child_f()
1879 struct xfrm_desc *desc = &msg->body.xfrm_desc; in grand_child_serv() local
1903 desc->proto)) { in grand_child_serv()
1909 if (xfrm_set(xfrm_sock, seq, src, dst, tunsrc, tundst, desc)) { in grand_child_serv()
1916 desc->proto)) { in grand_child_serv()
2019 static int __write_desc(int test_desc_fd, struct xfrm_desc *desc) in __write_desc() argument
2023 ret = write(test_desc_fd, desc, sizeof(*desc)); in __write_desc()
2025 if (ret == sizeof(*desc)) in __write_desc()
2036 struct xfrm_desc desc = {}; in write_desc() local
2038 desc.type = CREATE_TUNNEL; in write_desc()
2039 desc.proto = proto; in write_desc()
2042 strncpy(desc.a_algo, a, ALGO_LEN - 1); in write_desc()
2044 strncpy(desc.e_algo, e, ALGO_LEN - 1); in write_desc()
2046 strncpy(desc.c_algo, c, ALGO_LEN - 1); in write_desc()
2048 strncpy(desc.ae_algo, ae, ALGO_LEN - 1); in write_desc()
2050 return __write_desc(test_desc_fd, &desc); in write_desc()
2143 struct xfrm_desc desc = {}; in write_compat_struct_tests() local
2145 desc.type = ALLOCATE_SPI; in write_compat_struct_tests()
2146 desc.proto = IPPROTO_AH; in write_compat_struct_tests()
2147 strncpy(desc.a_algo, ah_list[0], ALGO_LEN - 1); in write_compat_struct_tests()
2149 if (__write_desc(test_desc_fd, &desc)) in write_compat_struct_tests()
2152 desc.type = MONITOR_ACQUIRE; in write_compat_struct_tests()
2153 if (__write_desc(test_desc_fd, &desc)) in write_compat_struct_tests()
2156 desc.type = EXPIRE_STATE; in write_compat_struct_tests()
2157 if (__write_desc(test_desc_fd, &desc)) in write_compat_struct_tests()
2160 desc.type = EXPIRE_POLICY; in write_compat_struct_tests()
2161 if (__write_desc(test_desc_fd, &desc)) in write_compat_struct_tests()
2164 desc.type = SPDINFO_ATTRS; in write_compat_struct_tests()
2165 if (__write_desc(test_desc_fd, &desc)) in write_compat_struct_tests()
2231 struct xfrm_desc *d = &tr.desc; in check_results()