Lines Matching refs:sec_ctx
440 static inline int pfkey_sec_ctx_len(const struct sadb_x_sec_ctx *sec_ctx) in pfkey_sec_ctx_len() argument
443 sec_ctx->sadb_x_ctx_len, in pfkey_sec_ctx_len()
449 const struct sadb_x_sec_ctx *sec_ctx = p; in verify_sec_ctx_len() local
450 int len = sec_ctx->sadb_x_ctx_len; in verify_sec_ctx_len()
455 len = pfkey_sec_ctx_len(sec_ctx); in verify_sec_ctx_len()
457 if (sec_ctx->sadb_x_sec_len != len) in verify_sec_ctx_len()
463 …inline struct xfrm_user_sec_ctx *pfkey_sadb2xfrm_user_sec_ctx(const struct sadb_x_sec_ctx *sec_ctx, in pfkey_sadb2xfrm_user_sec_ctx() argument
467 int ctx_size = sec_ctx->sadb_x_ctx_len; in pfkey_sadb2xfrm_user_sec_ctx()
474 uctx->len = pfkey_sec_ctx_len(sec_ctx); in pfkey_sadb2xfrm_user_sec_ctx()
475 uctx->exttype = sec_ctx->sadb_x_sec_exttype; in pfkey_sadb2xfrm_user_sec_ctx()
476 uctx->ctx_doi = sec_ctx->sadb_x_ctx_doi; in pfkey_sadb2xfrm_user_sec_ctx()
477 uctx->ctx_alg = sec_ctx->sadb_x_ctx_alg; in pfkey_sadb2xfrm_user_sec_ctx()
478 uctx->ctx_len = sec_ctx->sadb_x_ctx_len; in pfkey_sadb2xfrm_user_sec_ctx()
479 memcpy(uctx + 1, sec_ctx + 1, in pfkey_sadb2xfrm_user_sec_ctx()
770 struct sadb_x_sec_ctx *sec_ctx; in __pfkey_xfrm_state2msg() local
1028 sec_ctx = skb_put(skb, in __pfkey_xfrm_state2msg()
1030 sec_ctx->sadb_x_sec_len = in __pfkey_xfrm_state2msg()
1032 sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX; in __pfkey_xfrm_state2msg()
1033 sec_ctx->sadb_x_ctx_doi = xfrm_ctx->ctx_doi; in __pfkey_xfrm_state2msg()
1034 sec_ctx->sadb_x_ctx_alg = xfrm_ctx->ctx_alg; in __pfkey_xfrm_state2msg()
1035 sec_ctx->sadb_x_ctx_len = xfrm_ctx->ctx_len; in __pfkey_xfrm_state2msg()
1036 memcpy(sec_ctx + 1, xfrm_ctx->ctx_str, in __pfkey_xfrm_state2msg()
1067 const struct sadb_x_sec_ctx *sec_ctx; in pfkey_msg2xfrm_state() local
1152 sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; in pfkey_msg2xfrm_state()
1153 if (sec_ctx != NULL) { in pfkey_msg2xfrm_state()
1154 struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL); in pfkey_msg2xfrm_state()
2070 struct sadb_x_sec_ctx *sec_ctx; in pfkey_xfrm_policy2msg() local
2198 sec_ctx = skb_put(skb, ctx_size); in pfkey_xfrm_policy2msg()
2199 sec_ctx->sadb_x_sec_len = ctx_size / sizeof(uint64_t); in pfkey_xfrm_policy2msg()
2200 sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX; in pfkey_xfrm_policy2msg()
2201 sec_ctx->sadb_x_ctx_doi = xfrm_ctx->ctx_doi; in pfkey_xfrm_policy2msg()
2202 sec_ctx->sadb_x_ctx_alg = xfrm_ctx->ctx_alg; in pfkey_xfrm_policy2msg()
2203 sec_ctx->sadb_x_ctx_len = xfrm_ctx->ctx_len; in pfkey_xfrm_policy2msg()
2204 memcpy(sec_ctx + 1, xfrm_ctx->ctx_str, in pfkey_xfrm_policy2msg()
2254 struct sadb_x_sec_ctx *sec_ctx; in pfkey_spdadd() local
2297 sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; in pfkey_spdadd()
2298 if (sec_ctx != NULL) { in pfkey_spdadd()
2299 struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL); in pfkey_spdadd()
2369 struct sadb_x_sec_ctx *sec_ctx; in pfkey_spddelete() local
2399 sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; in pfkey_spddelete()
2400 if (sec_ctx != NULL) { in pfkey_spddelete()
2401 struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL); in pfkey_spddelete()
3161 struct sadb_x_sec_ctx *sec_ctx; in pfkey_send_acquire() local
3249 sec_ctx = skb_put(skb, in pfkey_send_acquire()
3251 sec_ctx->sadb_x_sec_len = in pfkey_send_acquire()
3253 sec_ctx->sadb_x_sec_exttype = SADB_X_EXT_SEC_CTX; in pfkey_send_acquire()
3254 sec_ctx->sadb_x_ctx_doi = xfrm_ctx->ctx_doi; in pfkey_send_acquire()
3255 sec_ctx->sadb_x_ctx_alg = xfrm_ctx->ctx_alg; in pfkey_send_acquire()
3256 sec_ctx->sadb_x_ctx_len = xfrm_ctx->ctx_len; in pfkey_send_acquire()
3257 memcpy(sec_ctx + 1, xfrm_ctx->ctx_str, in pfkey_send_acquire()
3271 struct sadb_x_sec_ctx *sec_ctx; in pfkey_compile_policy() local
3328 sec_ctx = (struct sadb_x_sec_ctx *)p; in pfkey_compile_policy()
3330 sec_ctx->sadb_x_sec_len*8) { in pfkey_compile_policy()
3336 uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_ATOMIC); in pfkey_compile_policy()