Lines Matching refs:nlh
590 static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_sa() argument
594 struct xfrm_usersa_info *p = nlmsg_data(nlh); in xfrm_add_sa()
608 if (nlh->nlmsg_type == XFRM_MSG_NEWSA) in xfrm_add_sa()
621 c.seq = nlh->nlmsg_seq; in xfrm_add_sa()
622 c.portid = nlh->nlmsg_pid; in xfrm_add_sa()
623 c.event = nlh->nlmsg_type; in xfrm_add_sa()
665 static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_del_sa() argument
672 struct xfrm_usersa_id *p = nlmsg_data(nlh); in xfrm_del_sa()
691 c.seq = nlh->nlmsg_seq; in xfrm_del_sa()
692 c.portid = nlh->nlmsg_pid; in xfrm_del_sa()
693 c.event = nlh->nlmsg_type; in xfrm_del_sa()
848 struct nlmsghdr *nlh; in dump_one_state() local
851 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq, in dump_one_state()
853 if (nlh == NULL) in dump_one_state()
856 p = nlmsg_data(nlh); in dump_one_state()
860 nlmsg_cancel(skb, nlh); in dump_one_state()
863 nlmsg_end(skb, nlh); in dump_one_state()
889 info.nlmsg_seq = cb->nlh->nlmsg_seq; in xfrm_dump_sa()
900 err = nlmsg_parse(cb->nlh, 0, attrs, XFRMA_MAX, in xfrm_dump_sa()
980 struct nlmsghdr *nlh; in build_spdinfo() local
985 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSPDINFO, sizeof(u32), 0); in build_spdinfo()
986 if (nlh == NULL) /* shouldn't really happen ... */ in build_spdinfo()
989 f = nlmsg_data(nlh); in build_spdinfo()
1018 nlmsg_cancel(skb, nlh); in build_spdinfo()
1022 nlmsg_end(skb, nlh); in build_spdinfo()
1026 static int xfrm_set_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_set_spdinfo() argument
1071 static int xfrm_get_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_spdinfo() argument
1076 u32 *flags = nlmsg_data(nlh); in xfrm_get_spdinfo()
1078 u32 seq = nlh->nlmsg_seq; in xfrm_get_spdinfo()
1102 struct nlmsghdr *nlh; in build_sadinfo() local
1106 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSADINFO, sizeof(u32), 0); in build_sadinfo()
1107 if (nlh == NULL) /* shouldn't really happen ... */ in build_sadinfo()
1110 f = nlmsg_data(nlh); in build_sadinfo()
1121 nlmsg_cancel(skb, nlh); in build_sadinfo()
1125 nlmsg_end(skb, nlh); in build_sadinfo()
1129 static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_sadinfo() argument
1134 u32 *flags = nlmsg_data(nlh); in xfrm_get_sadinfo()
1136 u32 seq = nlh->nlmsg_seq; in xfrm_get_sadinfo()
1148 static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_sa() argument
1152 struct xfrm_usersa_id *p = nlmsg_data(nlh); in xfrm_get_sa()
1161 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); in xfrm_get_sa()
1172 static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_alloc_userspi() argument
1185 p = nlmsg_data(nlh); in xfrm_alloc_userspi()
1217 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); in xfrm_alloc_userspi()
1478 static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_policy() argument
1482 struct xfrm_userpolicy_info *p = nlmsg_data(nlh); in xfrm_add_policy()
1503 excl = nlh->nlmsg_type == XFRM_MSG_NEWPOLICY; in xfrm_add_policy()
1513 c.event = nlh->nlmsg_type; in xfrm_add_policy()
1514 c.seq = nlh->nlmsg_seq; in xfrm_add_policy()
1515 c.portid = nlh->nlmsg_pid; in xfrm_add_policy()
1598 struct nlmsghdr *nlh; in dump_one_policy() local
1601 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq, in dump_one_policy()
1603 if (nlh == NULL) in dump_one_policy()
1606 p = nlmsg_data(nlh); in dump_one_policy()
1616 nlmsg_cancel(skb, nlh); in dump_one_policy()
1619 nlmsg_end(skb, nlh); in dump_one_policy()
1643 info.nlmsg_seq = cb->nlh->nlmsg_seq; in xfrm_dump_policy()
1682 static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_policy() argument
1695 p = nlmsg_data(nlh); in xfrm_get_policy()
1696 delete = nlh->nlmsg_type == XFRM_MSG_DELPOLICY; in xfrm_get_policy()
1734 resp_skb = xfrm_policy_netlink(skb, xp, p->dir, nlh->nlmsg_seq); in xfrm_get_policy()
1748 c.event = nlh->nlmsg_type; in xfrm_get_policy()
1749 c.seq = nlh->nlmsg_seq; in xfrm_get_policy()
1750 c.portid = nlh->nlmsg_pid; in xfrm_get_policy()
1761 static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_flush_sa() argument
1766 struct xfrm_usersa_flush *p = nlmsg_data(nlh); in xfrm_flush_sa()
1776 c.event = nlh->nlmsg_type; in xfrm_flush_sa()
1777 c.seq = nlh->nlmsg_seq; in xfrm_flush_sa()
1778 c.portid = nlh->nlmsg_pid; in xfrm_flush_sa()
1802 struct nlmsghdr *nlh; in build_aevent() local
1805 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0); in build_aevent()
1806 if (nlh == NULL) in build_aevent()
1809 id = nlmsg_data(nlh); in build_aevent()
1847 nlmsg_end(skb, nlh); in build_aevent()
1851 nlmsg_cancel(skb, nlh); in build_aevent()
1855 static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_ae() argument
1865 struct xfrm_aevent_id *p = nlmsg_data(nlh); in xfrm_get_ae()
1887 c.seq = nlh->nlmsg_seq; in xfrm_get_ae()
1888 c.portid = nlh->nlmsg_pid; in xfrm_get_ae()
1898 static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_new_ae() argument
1907 struct xfrm_aevent_id *p = nlmsg_data(nlh); in xfrm_new_ae()
1916 if (!(nlh->nlmsg_flags&NLM_F_REPLACE)) in xfrm_new_ae()
1936 c.event = nlh->nlmsg_type; in xfrm_new_ae()
1937 c.seq = nlh->nlmsg_seq; in xfrm_new_ae()
1938 c.portid = nlh->nlmsg_pid; in xfrm_new_ae()
1947 static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_flush_policy() argument
1967 c.event = nlh->nlmsg_type; in xfrm_flush_policy()
1968 c.seq = nlh->nlmsg_seq; in xfrm_flush_policy()
1969 c.portid = nlh->nlmsg_pid; in xfrm_flush_policy()
1975 static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_pol_expire() argument
1980 struct xfrm_user_polexpire *up = nlmsg_data(nlh); in xfrm_add_pol_expire()
2031 km_policy_expired(xp, p->dir, up->hard, nlh->nlmsg_pid); in xfrm_add_pol_expire()
2038 static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_sa_expire() argument
2044 struct xfrm_user_expire *ue = nlmsg_data(nlh); in xfrm_add_sa_expire()
2059 km_state_expired(x, ue->hard, nlh->nlmsg_pid); in xfrm_add_sa_expire()
2072 static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_acquire() argument
2082 struct xfrm_user_acquire *ua = nlmsg_data(nlh); in xfrm_add_acquire()
2176 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_do_migrate() argument
2179 struct xfrm_userpolicy_id *pi = nlmsg_data(nlh); in xfrm_do_migrate()
2208 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_do_migrate() argument
2261 struct nlmsghdr *nlh; in build_migrate() local
2264 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MIGRATE, sizeof(*pol_id), 0); in build_migrate()
2265 if (nlh == NULL) in build_migrate()
2268 pol_id = nlmsg_data(nlh); in build_migrate()
2288 nlmsg_end(skb, nlh); in build_migrate()
2292 nlmsg_cancel(skb, nlh); in build_migrate()
2419 static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) in xfrm_user_rcv_msg() argument
2431 type = nlh->nlmsg_type; in xfrm_user_rcv_msg()
2444 (nlh->nlmsg_flags & NLM_F_DUMP)) { in xfrm_user_rcv_msg()
2453 return netlink_dump_start(net->xfrm.nlsk, skb, nlh, &c); in xfrm_user_rcv_msg()
2457 err = nlmsg_parse(nlh, xfrm_msg_min[type], attrs, in xfrm_user_rcv_msg()
2466 return link->doit(skb, nlh, attrs); in xfrm_user_rcv_msg()
2487 struct nlmsghdr *nlh; in build_expire() local
2490 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0); in build_expire()
2491 if (nlh == NULL) in build_expire()
2494 ue = nlmsg_data(nlh); in build_expire()
2502 nlmsg_end(skb, nlh); in build_expire()
2542 struct nlmsghdr *nlh; in xfrm_notify_sa_flush() local
2550 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0); in xfrm_notify_sa_flush()
2551 if (nlh == NULL) { in xfrm_notify_sa_flush()
2556 p = nlmsg_data(nlh); in xfrm_notify_sa_flush()
2559 nlmsg_end(skb, nlh); in xfrm_notify_sa_flush()
2605 struct nlmsghdr *nlh; in xfrm_notify_sa() local
2622 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0); in xfrm_notify_sa()
2624 if (nlh == NULL) in xfrm_notify_sa()
2627 p = nlmsg_data(nlh); in xfrm_notify_sa()
2631 id = nlmsg_data(nlh); in xfrm_notify_sa()
2648 nlmsg_end(skb, nlh); in xfrm_notify_sa()
2696 struct nlmsghdr *nlh; in build_acquire() local
2699 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_ACQUIRE, sizeof(*ua), 0); in build_acquire()
2700 if (nlh == NULL) in build_acquire()
2703 ua = nlmsg_data(nlh); in build_acquire()
2721 nlmsg_cancel(skb, nlh); in build_acquire()
2725 nlmsg_end(skb, nlh); in build_acquire()
2819 struct nlmsghdr *nlh; in build_polexpire() local
2822 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0); in build_polexpire()
2823 if (nlh == NULL) in build_polexpire()
2826 upe = nlmsg_data(nlh); in build_polexpire()
2836 nlmsg_cancel(skb, nlh); in build_polexpire()
2841 nlmsg_end(skb, nlh); in build_polexpire()
2866 struct nlmsghdr *nlh; in xfrm_notify_policy() local
2883 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0); in xfrm_notify_policy()
2885 if (nlh == NULL) in xfrm_notify_policy()
2888 p = nlmsg_data(nlh); in xfrm_notify_policy()
2892 id = nlmsg_data(nlh); in xfrm_notify_policy()
2917 nlmsg_end(skb, nlh); in xfrm_notify_policy()
2929 struct nlmsghdr *nlh; in xfrm_notify_policy_flush() local
2937 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0); in xfrm_notify_policy_flush()
2939 if (nlh == NULL) in xfrm_notify_policy_flush()
2945 nlmsg_end(skb, nlh); in xfrm_notify_policy_flush()
2984 struct nlmsghdr *nlh; in build_report() local
2986 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_REPORT, sizeof(*ur), 0); in build_report()
2987 if (nlh == NULL) in build_report()
2990 ur = nlmsg_data(nlh); in build_report()
2997 nlmsg_cancel(skb, nlh); in build_report()
3001 nlmsg_end(skb, nlh); in build_report()
3029 struct nlmsghdr *nlh; in build_mapping() local
3031 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MAPPING, sizeof(*um), 0); in build_mapping()
3032 if (nlh == NULL) in build_mapping()
3035 um = nlmsg_data(nlh); in build_mapping()
3047 nlmsg_end(skb, nlh); in build_mapping()