Lines Matching refs:pol
1991 parse_ipsecrequests(struct xfrm_policy *xp, struct sadb_x_policy *pol) in parse_ipsecrequests() argument
1994 int len = pol->sadb_x_policy_len*8 - sizeof(struct sadb_x_policy); in parse_ipsecrequests()
1995 struct sadb_x_ipsecrequest *rq = (void*)(pol+1); in parse_ipsecrequests()
1997 if (pol->sadb_x_policy_len * 8 < sizeof(struct sadb_x_policy)) in parse_ipsecrequests()
2066 struct sadb_x_policy *pol; in pfkey_xfrm_policy2msg() local
2137 pol = skb_put(skb, sizeof(struct sadb_x_policy)); in pfkey_xfrm_policy2msg()
2138 pol->sadb_x_policy_len = sizeof(struct sadb_x_policy)/sizeof(uint64_t); in pfkey_xfrm_policy2msg()
2139 pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; in pfkey_xfrm_policy2msg()
2140 pol->sadb_x_policy_type = IPSEC_POLICY_DISCARD; in pfkey_xfrm_policy2msg()
2143 pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC; in pfkey_xfrm_policy2msg()
2145 pol->sadb_x_policy_type = IPSEC_POLICY_NONE; in pfkey_xfrm_policy2msg()
2147 pol->sadb_x_policy_dir = dir+1; in pfkey_xfrm_policy2msg()
2148 pol->sadb_x_policy_reserved = 0; in pfkey_xfrm_policy2msg()
2149 pol->sadb_x_policy_id = xp->index; in pfkey_xfrm_policy2msg()
2150 pol->sadb_x_policy_priority = xp->priority; in pfkey_xfrm_policy2msg()
2166 pol->sadb_x_policy_len += req_size/8; in pfkey_xfrm_policy2msg()
2248 struct sadb_x_policy *pol; in pfkey_spdadd() local
2258 pol = ext_hdrs[SADB_X_EXT_POLICY-1]; in pfkey_spdadd()
2259 if (pol->sadb_x_policy_type > IPSEC_POLICY_IPSEC) in pfkey_spdadd()
2261 if (!pol->sadb_x_policy_dir || pol->sadb_x_policy_dir >= IPSEC_DIR_MAX) in pfkey_spdadd()
2268 xp->action = (pol->sadb_x_policy_type == IPSEC_POLICY_DISCARD ? in pfkey_spdadd()
2270 xp->priority = pol->sadb_x_policy_priority; in pfkey_spdadd()
2327 if (pol->sadb_x_policy_type == IPSEC_POLICY_IPSEC && in pfkey_spdadd()
2328 (err = parse_ipsecrequests(xp, pol)) < 0) in pfkey_spdadd()
2331 err = xfrm_policy_insert(pol->sadb_x_policy_dir-1, xp, in pfkey_spdadd()
2347 km_policy_notify(xp, pol->sadb_x_policy_dir-1, &c); in pfkey_spdadd()
2362 struct sadb_x_policy *pol; in pfkey_spddelete() local
2374 pol = ext_hdrs[SADB_X_EXT_POLICY-1]; in pfkey_spddelete()
2375 if (!pol->sadb_x_policy_dir || pol->sadb_x_policy_dir >= IPSEC_DIR_MAX) in pfkey_spddelete()
2410 pol->sadb_x_policy_dir - 1, &sel, pol_ctx, in pfkey_spddelete()
2425 km_policy_notify(xp, pol->sadb_x_policy_dir-1, &c); in pfkey_spddelete()
2550 struct sadb_x_policy *pol; in pfkey_migrate() local
2565 pol = ext_hdrs[SADB_X_EXT_POLICY - 1]; in pfkey_migrate()
2567 if (pol->sadb_x_policy_dir >= IPSEC_DIR_MAX) { in pfkey_migrate()
2584 dir = pol->sadb_x_policy_dir - 1; in pfkey_migrate()
2605 rq = (struct sadb_x_ipsecrequest *)(pol + 1); in pfkey_migrate()
2609 len = pol->sadb_x_policy_len * 8 - sizeof(struct sadb_x_policy); in pfkey_migrate()
2648 struct sadb_x_policy *pol; in pfkey_spdget() local
2652 if ((pol = ext_hdrs[SADB_X_EXT_POLICY-1]) == NULL) in pfkey_spdget()
2655 dir = xfrm_policy_id2dir(pol->sadb_x_policy_id); in pfkey_spdget()
2661 dir, pol->sadb_x_policy_id, delete, &err); in pfkey_spdget()
3155 struct sadb_x_policy *pol; in pfkey_send_acquire() local
3226 pol = skb_put(skb, sizeof(struct sadb_x_policy)); in pfkey_send_acquire()
3227 pol->sadb_x_policy_len = sizeof(struct sadb_x_policy)/sizeof(uint64_t); in pfkey_send_acquire()
3228 pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; in pfkey_send_acquire()
3229 pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC; in pfkey_send_acquire()
3230 pol->sadb_x_policy_dir = XFRM_POLICY_OUT + 1; in pfkey_send_acquire()
3231 pol->sadb_x_policy_reserved = 0; in pfkey_send_acquire()
3232 pol->sadb_x_policy_id = xp->index; in pfkey_send_acquire()
3233 pol->sadb_x_policy_priority = xp->priority; in pfkey_send_acquire()
3267 struct sadb_x_policy *pol = (struct sadb_x_policy*)data; in pfkey_compile_policy() local
3293 pol->sadb_x_policy_len*8 > len || in pfkey_compile_policy()
3294 pol->sadb_x_policy_type > IPSEC_POLICY_BYPASS || in pfkey_compile_policy()
3295 (!pol->sadb_x_policy_dir || pol->sadb_x_policy_dir > IPSEC_DIR_OUTBOUND)) in pfkey_compile_policy()
3304 xp->action = (pol->sadb_x_policy_type == IPSEC_POLICY_DISCARD ? in pfkey_compile_policy()
3314 if (pol->sadb_x_policy_type == IPSEC_POLICY_IPSEC && in pfkey_compile_policy()
3315 (*dir = parse_ipsecrequests(xp, pol)) < 0) in pfkey_compile_policy()
3319 if (len >= (pol->sadb_x_policy_len*8 + in pfkey_compile_policy()
3321 char *p = (char *)pol; in pfkey_compile_policy()
3324 p += pol->sadb_x_policy_len*8; in pfkey_compile_policy()
3326 if (len < pol->sadb_x_policy_len*8 + in pfkey_compile_policy()
3341 *dir = pol->sadb_x_policy_dir-1; in pfkey_compile_policy()
3556 struct sadb_x_policy *pol; in pfkey_send_migrate() local
3618 pol = skb_put(skb, sizeof(struct sadb_x_policy)); in pfkey_send_migrate()
3619 pol->sadb_x_policy_len = size_pol / 8; in pfkey_send_migrate()
3620 pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; in pfkey_send_migrate()
3621 pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC; in pfkey_send_migrate()
3622 pol->sadb_x_policy_dir = dir + 1; in pfkey_send_migrate()
3623 pol->sadb_x_policy_reserved = 0; in pfkey_send_migrate()
3624 pol->sadb_x_policy_id = 0; in pfkey_send_migrate()
3625 pol->sadb_x_policy_priority = 0; in pfkey_send_migrate()