Lines Matching defs:nlh

782 static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
786 struct xfrm_usersa_info *p = nlmsg_data(nlh);
800 if (nlh->nlmsg_type == XFRM_MSG_NEWSA)
817 c.seq = nlh->nlmsg_seq;
818 c.portid = nlh->nlmsg_pid;
819 c.event = nlh->nlmsg_type;
861 static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
868 struct xfrm_usersa_id *p = nlmsg_data(nlh);
887 c.seq = nlh->nlmsg_seq;
888 c.portid = nlh->nlmsg_pid;
889 c.event = nlh->nlmsg_type;
1198 struct nlmsghdr *nlh;
1201 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq,
1203 if (nlh == NULL)
1206 p = nlmsg_data(nlh);
1210 nlmsg_cancel(skb, nlh);
1213 nlmsg_end(skb, nlh);
1217 err = xtr->alloc_compat(skb, nlh);
1221 nlmsg_cancel(skb, nlh);
1251 info.nlmsg_seq = cb->nlh->nlmsg_seq;
1260 err = nlmsg_parse_deprecated(cb->nlh, 0, attrs, XFRMA_MAX,
1362 struct nlmsghdr *nlh;
1367 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSPDINFO, sizeof(u32), 0);
1368 if (nlh == NULL) /* shouldn't really happen ... */
1371 f = nlmsg_data(nlh);
1400 nlmsg_cancel(skb, nlh);
1404 nlmsg_end(skb, nlh);
1408 static int xfrm_set_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
1462 static int xfrm_get_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
1468 u32 *flags = nlmsg_data(nlh);
1470 u32 seq = nlh->nlmsg_seq;
1495 struct nlmsghdr *nlh;
1499 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSADINFO, sizeof(u32), 0);
1500 if (nlh == NULL) /* shouldn't really happen ... */
1503 f = nlmsg_data(nlh);
1514 nlmsg_cancel(skb, nlh);
1518 nlmsg_end(skb, nlh);
1522 static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
1528 u32 *flags = nlmsg_data(nlh);
1530 u32 seq = nlh->nlmsg_seq;
1543 static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
1547 struct xfrm_usersa_id *p = nlmsg_data(nlh);
1556 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq);
1567 static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh,
1583 p = nlmsg_data(nlh);
1621 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq);
1964 static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1969 struct xfrm_userpolicy_info *p = nlmsg_data(nlh);
1986 /* shouldn't excl be based on nlh flags??
1990 excl = nlh->nlmsg_type == XFRM_MSG_NEWPOLICY;
2002 c.event = nlh->nlmsg_type;
2003 c.seq = nlh->nlmsg_seq;
2004 c.portid = nlh->nlmsg_pid;
2090 struct nlmsghdr *nlh;
2093 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq,
2095 if (nlh == NULL)
2098 p = nlmsg_data(nlh);
2112 nlmsg_cancel(skb, nlh);
2115 nlmsg_end(skb, nlh);
2119 err = xtr->alloc_compat(skb, nlh);
2123 nlmsg_cancel(skb, nlh);
2158 info.nlmsg_seq = cb->nlh->nlmsg_seq;
2196 struct nlmsghdr *nlh;
2204 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_GETDEFAULT, sizeof(*up), 0);
2205 if (nlh == NULL) {
2210 up = nlmsg_data(nlh);
2215 nlmsg_end(skb, nlh);
2230 static int xfrm_set_default(struct sk_buff *skb, struct nlmsghdr *nlh,
2234 struct xfrm_userpolicy_default *up = nlmsg_data(nlh);
2251 static int xfrm_get_default(struct sk_buff *skb, struct nlmsghdr *nlh,
2260 u32 seq = nlh->nlmsg_seq;
2281 static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
2295 p = nlmsg_data(nlh);
2296 delete = nlh->nlmsg_type == XFRM_MSG_DELPOLICY;
2340 resp_skb = xfrm_policy_netlink(skb, xp, p->dir, nlh->nlmsg_seq);
2355 c.event = nlh->nlmsg_type;
2356 c.seq = nlh->nlmsg_seq;
2357 c.portid = nlh->nlmsg_pid;
2366 static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
2372 struct xfrm_usersa_flush *p = nlmsg_data(nlh);
2382 c.event = nlh->nlmsg_type;
2383 c.seq = nlh->nlmsg_seq;
2384 c.portid = nlh->nlmsg_pid;
2408 struct nlmsghdr *nlh;
2411 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0);
2412 if (nlh == NULL)
2415 id = nlmsg_data(nlh);
2459 nlmsg_end(skb, nlh);
2463 nlmsg_cancel(skb, nlh);
2467 static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
2477 struct xfrm_aevent_id *p = nlmsg_data(nlh);
2499 c.seq = nlh->nlmsg_seq;
2500 c.portid = nlh->nlmsg_pid;
2511 static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
2520 struct xfrm_aevent_id *p = nlmsg_data(nlh);
2533 if (!(nlh->nlmsg_flags & NLM_F_REPLACE)) {
2557 c.event = nlh->nlmsg_type;
2558 c.seq = nlh->nlmsg_seq;
2559 c.portid = nlh->nlmsg_pid;
2568 static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
2589 c.event = nlh->nlmsg_type;
2590 c.seq = nlh->nlmsg_seq;
2591 c.portid = nlh->nlmsg_pid;
2597 static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
2603 struct xfrm_user_polexpire *up = nlmsg_data(nlh);
2657 km_policy_expired(xp, p->dir, up->hard, nlh->nlmsg_pid);
2664 static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
2671 struct xfrm_user_expire *ue = nlmsg_data(nlh);
2689 km_state_expired(x, ue->hard, nlh->nlmsg_pid);
2702 static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh,
2713 struct xfrm_user_acquire *ua = nlmsg_data(nlh);
2811 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
2814 struct xfrm_userpolicy_id *pi = nlmsg_data(nlh);
2860 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
2916 struct nlmsghdr *nlh;
2919 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MIGRATE, sizeof(*pol_id), 0);
2920 if (nlh == NULL)
2923 pol_id = nlmsg_data(nlh);
2948 nlmsg_end(skb, nlh);
2952 nlmsg_cancel(skb, nlh);
3097 static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
3106 type = nlh->nlmsg_type;
3123 nlh64 = xtr->rcv_msg_compat(nlh, link->nla_max,
3129 nlh = nlh64;
3134 (nlh->nlmsg_flags & NLM_F_DUMP)) {
3146 err = netlink_dump_start(net->xfrm.nlsk, skb, nlh, &c);
3150 err = nlmsg_parse_deprecated(nlh, xfrm_msg_min[type], attrs,
3161 err = link->doit(skb, nlh, attrs, extack);
3196 struct nlmsghdr *nlh;
3199 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0);
3200 if (nlh == NULL)
3203 ue = nlmsg_data(nlh);
3217 nlmsg_end(skb, nlh);
3258 struct nlmsghdr *nlh;
3266 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0);
3267 if (nlh == NULL) {
3272 p = nlmsg_data(nlh);
3275 nlmsg_end(skb, nlh);
3332 struct nlmsghdr *nlh;
3350 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0);
3352 if (nlh == NULL)
3355 p = nlmsg_data(nlh);
3359 id = nlmsg_data(nlh);
3377 nlmsg_end(skb, nlh);
3425 struct nlmsghdr *nlh;
3428 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_ACQUIRE, sizeof(*ua), 0);
3429 if (nlh == NULL)
3432 ua = nlmsg_data(nlh);
3454 nlmsg_cancel(skb, nlh);
3458 nlmsg_end(skb, nlh);
3553 struct nlmsghdr *nlh;
3556 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0);
3557 if (nlh == NULL)
3560 upe = nlmsg_data(nlh);
3574 nlmsg_cancel(skb, nlh);
3579 nlmsg_end(skb, nlh);
3605 struct nlmsghdr *nlh;
3623 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0);
3625 if (nlh == NULL)
3628 p = nlmsg_data(nlh);
3632 id = nlmsg_data(nlh);
3661 nlmsg_end(skb, nlh);
3673 struct nlmsghdr *nlh;
3681 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0);
3683 if (nlh == NULL)
3689 nlmsg_end(skb, nlh);
3728 struct nlmsghdr *nlh;
3730 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_REPORT, sizeof(*ur), 0);
3731 if (nlh == NULL)
3734 ur = nlmsg_data(nlh);
3741 nlmsg_cancel(skb, nlh);
3745 nlmsg_end(skb, nlh);
3774 struct nlmsghdr *nlh;
3776 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MAPPING, sizeof(*um), 0);
3777 if (nlh == NULL)
3780 um = nlmsg_data(nlh);
3792 nlmsg_end(skb, nlh);