Lines Matching refs:nlh
786 static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_sa() argument
790 struct xfrm_usersa_info *p = nlmsg_data(nlh); in xfrm_add_sa()
804 if (nlh->nlmsg_type == XFRM_MSG_NEWSA) in xfrm_add_sa()
821 c.seq = nlh->nlmsg_seq; in xfrm_add_sa()
822 c.portid = nlh->nlmsg_pid; in xfrm_add_sa()
823 c.event = nlh->nlmsg_type; in xfrm_add_sa()
865 static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_del_sa() argument
872 struct xfrm_usersa_id *p = nlmsg_data(nlh); in xfrm_del_sa()
891 c.seq = nlh->nlmsg_seq; in xfrm_del_sa()
892 c.portid = nlh->nlmsg_pid; in xfrm_del_sa()
893 c.event = nlh->nlmsg_type; in xfrm_del_sa()
1204 struct nlmsghdr *nlh; in dump_one_state() local
1207 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq, in dump_one_state()
1209 if (nlh == NULL) in dump_one_state()
1212 p = nlmsg_data(nlh); in dump_one_state()
1216 nlmsg_cancel(skb, nlh); in dump_one_state()
1219 nlmsg_end(skb, nlh); in dump_one_state()
1223 err = xtr->alloc_compat(skb, nlh); in dump_one_state()
1227 nlmsg_cancel(skb, nlh); in dump_one_state()
1257 info.nlmsg_seq = cb->nlh->nlmsg_seq; in xfrm_dump_sa()
1266 err = nlmsg_parse_deprecated(cb->nlh, 0, attrs, XFRMA_MAX, in xfrm_dump_sa()
1368 struct nlmsghdr *nlh; in build_spdinfo() local
1373 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSPDINFO, sizeof(u32), 0); in build_spdinfo()
1374 if (nlh == NULL) /* shouldn't really happen ... */ in build_spdinfo()
1377 f = nlmsg_data(nlh); in build_spdinfo()
1406 nlmsg_cancel(skb, nlh); in build_spdinfo()
1410 nlmsg_end(skb, nlh); in build_spdinfo()
1414 static int xfrm_set_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_set_spdinfo() argument
1468 static int xfrm_get_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_spdinfo() argument
1474 u32 *flags = nlmsg_data(nlh); in xfrm_get_spdinfo()
1476 u32 seq = nlh->nlmsg_seq; in xfrm_get_spdinfo()
1501 struct nlmsghdr *nlh; in build_sadinfo() local
1505 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSADINFO, sizeof(u32), 0); in build_sadinfo()
1506 if (nlh == NULL) /* shouldn't really happen ... */ in build_sadinfo()
1509 f = nlmsg_data(nlh); in build_sadinfo()
1520 nlmsg_cancel(skb, nlh); in build_sadinfo()
1524 nlmsg_end(skb, nlh); in build_sadinfo()
1528 static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_sadinfo() argument
1534 u32 *flags = nlmsg_data(nlh); in xfrm_get_sadinfo()
1536 u32 seq = nlh->nlmsg_seq; in xfrm_get_sadinfo()
1549 static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_sa() argument
1553 struct xfrm_usersa_id *p = nlmsg_data(nlh); in xfrm_get_sa()
1562 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); in xfrm_get_sa()
1573 static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_alloc_userspi() argument
1589 p = nlmsg_data(nlh); in xfrm_alloc_userspi()
1627 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); in xfrm_alloc_userspi()
1970 static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_policy() argument
1975 struct xfrm_userpolicy_info *p = nlmsg_data(nlh); in xfrm_add_policy()
1996 excl = nlh->nlmsg_type == XFRM_MSG_NEWPOLICY; in xfrm_add_policy()
2008 c.event = nlh->nlmsg_type; in xfrm_add_policy()
2009 c.seq = nlh->nlmsg_seq; in xfrm_add_policy()
2010 c.portid = nlh->nlmsg_pid; in xfrm_add_policy()
2099 struct nlmsghdr *nlh; in dump_one_policy() local
2102 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq, in dump_one_policy()
2104 if (nlh == NULL) in dump_one_policy()
2107 p = nlmsg_data(nlh); in dump_one_policy()
2121 nlmsg_cancel(skb, nlh); in dump_one_policy()
2124 nlmsg_end(skb, nlh); in dump_one_policy()
2128 err = xtr->alloc_compat(skb, nlh); in dump_one_policy()
2132 nlmsg_cancel(skb, nlh); in dump_one_policy()
2167 info.nlmsg_seq = cb->nlh->nlmsg_seq; in xfrm_dump_policy()
2205 struct nlmsghdr *nlh; in xfrm_notify_userpolicy() local
2213 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_GETDEFAULT, sizeof(*up), 0); in xfrm_notify_userpolicy()
2214 if (nlh == NULL) { in xfrm_notify_userpolicy()
2219 up = nlmsg_data(nlh); in xfrm_notify_userpolicy()
2224 nlmsg_end(skb, nlh); in xfrm_notify_userpolicy()
2239 static int xfrm_set_default(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_set_default() argument
2243 struct xfrm_userpolicy_default *up = nlmsg_data(nlh); in xfrm_set_default()
2260 static int xfrm_get_default(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_default() argument
2269 u32 seq = nlh->nlmsg_seq; in xfrm_get_default()
2290 static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_policy() argument
2304 p = nlmsg_data(nlh); in xfrm_get_policy()
2305 delete = nlh->nlmsg_type == XFRM_MSG_DELPOLICY; in xfrm_get_policy()
2349 resp_skb = xfrm_policy_netlink(skb, xp, p->dir, nlh->nlmsg_seq); in xfrm_get_policy()
2363 c.event = nlh->nlmsg_type; in xfrm_get_policy()
2364 c.seq = nlh->nlmsg_seq; in xfrm_get_policy()
2365 c.portid = nlh->nlmsg_pid; in xfrm_get_policy()
2374 static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_flush_sa() argument
2380 struct xfrm_usersa_flush *p = nlmsg_data(nlh); in xfrm_flush_sa()
2390 c.event = nlh->nlmsg_type; in xfrm_flush_sa()
2391 c.seq = nlh->nlmsg_seq; in xfrm_flush_sa()
2392 c.portid = nlh->nlmsg_pid; in xfrm_flush_sa()
2416 struct nlmsghdr *nlh; in build_aevent() local
2419 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0); in build_aevent()
2420 if (nlh == NULL) in build_aevent()
2423 id = nlmsg_data(nlh); in build_aevent()
2467 nlmsg_end(skb, nlh); in build_aevent()
2471 nlmsg_cancel(skb, nlh); in build_aevent()
2475 static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_ae() argument
2485 struct xfrm_aevent_id *p = nlmsg_data(nlh); in xfrm_get_ae()
2507 c.seq = nlh->nlmsg_seq; in xfrm_get_ae()
2508 c.portid = nlh->nlmsg_pid; in xfrm_get_ae()
2519 static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_new_ae() argument
2528 struct xfrm_aevent_id *p = nlmsg_data(nlh); in xfrm_new_ae()
2541 if (!(nlh->nlmsg_flags & NLM_F_REPLACE)) { in xfrm_new_ae()
2565 c.event = nlh->nlmsg_type; in xfrm_new_ae()
2566 c.seq = nlh->nlmsg_seq; in xfrm_new_ae()
2567 c.portid = nlh->nlmsg_pid; in xfrm_new_ae()
2576 static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_flush_policy() argument
2597 c.event = nlh->nlmsg_type; in xfrm_flush_policy()
2598 c.seq = nlh->nlmsg_seq; in xfrm_flush_policy()
2599 c.portid = nlh->nlmsg_pid; in xfrm_flush_policy()
2605 static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_pol_expire() argument
2611 struct xfrm_user_polexpire *up = nlmsg_data(nlh); in xfrm_add_pol_expire()
2665 km_policy_expired(xp, p->dir, up->hard, nlh->nlmsg_pid); in xfrm_add_pol_expire()
2672 static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_sa_expire() argument
2679 struct xfrm_user_expire *ue = nlmsg_data(nlh); in xfrm_add_sa_expire()
2697 km_state_expired(x, ue->hard, nlh->nlmsg_pid); in xfrm_add_sa_expire()
2710 static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_acquire() argument
2721 struct xfrm_user_acquire *ua = nlmsg_data(nlh); in xfrm_add_acquire()
2819 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_do_migrate() argument
2822 struct xfrm_userpolicy_id *pi = nlmsg_data(nlh); in xfrm_do_migrate()
2868 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_do_migrate() argument
2924 struct nlmsghdr *nlh; in build_migrate() local
2927 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MIGRATE, sizeof(*pol_id), 0); in build_migrate()
2928 if (nlh == NULL) in build_migrate()
2931 pol_id = nlmsg_data(nlh); in build_migrate()
2956 nlmsg_end(skb, nlh); in build_migrate()
2960 nlmsg_cancel(skb, nlh); in build_migrate()
3105 static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_user_rcv_msg() argument
3114 type = nlh->nlmsg_type; in xfrm_user_rcv_msg()
3131 nlh64 = xtr->rcv_msg_compat(nlh, link->nla_max, in xfrm_user_rcv_msg()
3137 nlh = nlh64; in xfrm_user_rcv_msg()
3142 (nlh->nlmsg_flags & NLM_F_DUMP)) { in xfrm_user_rcv_msg()
3154 err = netlink_dump_start(net->xfrm.nlsk, skb, nlh, &c); in xfrm_user_rcv_msg()
3158 err = nlmsg_parse_deprecated(nlh, xfrm_msg_min[type], attrs, in xfrm_user_rcv_msg()
3169 err = link->doit(skb, nlh, attrs, extack); in xfrm_user_rcv_msg()
3204 struct nlmsghdr *nlh; in build_expire() local
3207 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0); in build_expire()
3208 if (nlh == NULL) in build_expire()
3211 ue = nlmsg_data(nlh); in build_expire()
3225 nlmsg_end(skb, nlh); in build_expire()
3266 struct nlmsghdr *nlh; in xfrm_notify_sa_flush() local
3274 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0); in xfrm_notify_sa_flush()
3275 if (nlh == NULL) { in xfrm_notify_sa_flush()
3280 p = nlmsg_data(nlh); in xfrm_notify_sa_flush()
3283 nlmsg_end(skb, nlh); in xfrm_notify_sa_flush()
3340 struct nlmsghdr *nlh; in xfrm_notify_sa() local
3358 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0); in xfrm_notify_sa()
3360 if (nlh == NULL) in xfrm_notify_sa()
3363 p = nlmsg_data(nlh); in xfrm_notify_sa()
3367 id = nlmsg_data(nlh); in xfrm_notify_sa()
3385 nlmsg_end(skb, nlh); in xfrm_notify_sa()
3433 struct nlmsghdr *nlh; in build_acquire() local
3436 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_ACQUIRE, sizeof(*ua), 0); in build_acquire()
3437 if (nlh == NULL) in build_acquire()
3440 ua = nlmsg_data(nlh); in build_acquire()
3462 nlmsg_cancel(skb, nlh); in build_acquire()
3466 nlmsg_end(skb, nlh); in build_acquire()
3561 struct nlmsghdr *nlh; in build_polexpire() local
3564 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0); in build_polexpire()
3565 if (nlh == NULL) in build_polexpire()
3568 upe = nlmsg_data(nlh); in build_polexpire()
3582 nlmsg_cancel(skb, nlh); in build_polexpire()
3587 nlmsg_end(skb, nlh); in build_polexpire()
3613 struct nlmsghdr *nlh; in xfrm_notify_policy() local
3631 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0); in xfrm_notify_policy()
3633 if (nlh == NULL) in xfrm_notify_policy()
3636 p = nlmsg_data(nlh); in xfrm_notify_policy()
3640 id = nlmsg_data(nlh); in xfrm_notify_policy()
3669 nlmsg_end(skb, nlh); in xfrm_notify_policy()
3681 struct nlmsghdr *nlh; in xfrm_notify_policy_flush() local
3689 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0); in xfrm_notify_policy_flush()
3691 if (nlh == NULL) in xfrm_notify_policy_flush()
3697 nlmsg_end(skb, nlh); in xfrm_notify_policy_flush()
3736 struct nlmsghdr *nlh; in build_report() local
3738 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_REPORT, sizeof(*ur), 0); in build_report()
3739 if (nlh == NULL) in build_report()
3742 ur = nlmsg_data(nlh); in build_report()
3749 nlmsg_cancel(skb, nlh); in build_report()
3753 nlmsg_end(skb, nlh); in build_report()
3782 struct nlmsghdr *nlh; in build_mapping() local
3784 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MAPPING, sizeof(*um), 0); in build_mapping()
3785 if (nlh == NULL) in build_mapping()
3788 um = nlmsg_data(nlh); in build_mapping()
3800 nlmsg_end(skb, nlh); in build_mapping()