Lines Matching refs:nlh
613 static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_sa() argument
617 struct xfrm_usersa_info *p = nlmsg_data(nlh); in xfrm_add_sa()
631 if (nlh->nlmsg_type == XFRM_MSG_NEWSA) in xfrm_add_sa()
644 c.seq = nlh->nlmsg_seq; in xfrm_add_sa()
645 c.portid = nlh->nlmsg_pid; in xfrm_add_sa()
646 c.event = nlh->nlmsg_type; in xfrm_add_sa()
688 static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_del_sa() argument
695 struct xfrm_usersa_id *p = nlmsg_data(nlh); in xfrm_del_sa()
714 c.seq = nlh->nlmsg_seq; in xfrm_del_sa()
715 c.portid = nlh->nlmsg_pid; in xfrm_del_sa()
716 c.event = nlh->nlmsg_type; in xfrm_del_sa()
873 struct nlmsghdr *nlh; in dump_one_state() local
876 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq, in dump_one_state()
878 if (nlh == NULL) in dump_one_state()
881 p = nlmsg_data(nlh); in dump_one_state()
885 nlmsg_cancel(skb, nlh); in dump_one_state()
888 nlmsg_end(skb, nlh); in dump_one_state()
914 info.nlmsg_seq = cb->nlh->nlmsg_seq; in xfrm_dump_sa()
925 err = nlmsg_parse(cb->nlh, 0, attrs, XFRMA_MAX, in xfrm_dump_sa()
1003 struct nlmsghdr *nlh; in build_spdinfo() local
1008 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSPDINFO, sizeof(u32), 0); in build_spdinfo()
1009 if (nlh == NULL) /* shouldn't really happen ... */ in build_spdinfo()
1012 f = nlmsg_data(nlh); in build_spdinfo()
1041 nlmsg_cancel(skb, nlh); in build_spdinfo()
1045 nlmsg_end(skb, nlh); in build_spdinfo()
1049 static int xfrm_set_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_set_spdinfo() argument
1094 static int xfrm_get_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_spdinfo() argument
1099 u32 *flags = nlmsg_data(nlh); in xfrm_get_spdinfo()
1101 u32 seq = nlh->nlmsg_seq; in xfrm_get_spdinfo()
1125 struct nlmsghdr *nlh; in build_sadinfo() local
1129 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSADINFO, sizeof(u32), 0); in build_sadinfo()
1130 if (nlh == NULL) /* shouldn't really happen ... */ in build_sadinfo()
1133 f = nlmsg_data(nlh); in build_sadinfo()
1144 nlmsg_cancel(skb, nlh); in build_sadinfo()
1148 nlmsg_end(skb, nlh); in build_sadinfo()
1152 static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_sadinfo() argument
1157 u32 *flags = nlmsg_data(nlh); in xfrm_get_sadinfo()
1159 u32 seq = nlh->nlmsg_seq; in xfrm_get_sadinfo()
1171 static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_sa() argument
1175 struct xfrm_usersa_id *p = nlmsg_data(nlh); in xfrm_get_sa()
1184 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); in xfrm_get_sa()
1195 static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_alloc_userspi() argument
1208 p = nlmsg_data(nlh); in xfrm_alloc_userspi()
1240 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); in xfrm_alloc_userspi()
1501 static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_policy() argument
1505 struct xfrm_userpolicy_info *p = nlmsg_data(nlh); in xfrm_add_policy()
1526 excl = nlh->nlmsg_type == XFRM_MSG_NEWPOLICY; in xfrm_add_policy()
1536 c.event = nlh->nlmsg_type; in xfrm_add_policy()
1537 c.seq = nlh->nlmsg_seq; in xfrm_add_policy()
1538 c.portid = nlh->nlmsg_pid; in xfrm_add_policy()
1621 struct nlmsghdr *nlh; in dump_one_policy() local
1624 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq, in dump_one_policy()
1626 if (nlh == NULL) in dump_one_policy()
1629 p = nlmsg_data(nlh); in dump_one_policy()
1639 nlmsg_cancel(skb, nlh); in dump_one_policy()
1642 nlmsg_end(skb, nlh); in dump_one_policy()
1666 info.nlmsg_seq = cb->nlh->nlmsg_seq; in xfrm_dump_policy()
1705 static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_policy() argument
1718 p = nlmsg_data(nlh); in xfrm_get_policy()
1719 delete = nlh->nlmsg_type == XFRM_MSG_DELPOLICY; in xfrm_get_policy()
1757 resp_skb = xfrm_policy_netlink(skb, xp, p->dir, nlh->nlmsg_seq); in xfrm_get_policy()
1771 c.event = nlh->nlmsg_type; in xfrm_get_policy()
1772 c.seq = nlh->nlmsg_seq; in xfrm_get_policy()
1773 c.portid = nlh->nlmsg_pid; in xfrm_get_policy()
1784 static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_flush_sa() argument
1789 struct xfrm_usersa_flush *p = nlmsg_data(nlh); in xfrm_flush_sa()
1799 c.event = nlh->nlmsg_type; in xfrm_flush_sa()
1800 c.seq = nlh->nlmsg_seq; in xfrm_flush_sa()
1801 c.portid = nlh->nlmsg_pid; in xfrm_flush_sa()
1825 struct nlmsghdr *nlh; in build_aevent() local
1828 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0); in build_aevent()
1829 if (nlh == NULL) in build_aevent()
1832 id = nlmsg_data(nlh); in build_aevent()
1870 nlmsg_end(skb, nlh); in build_aevent()
1874 nlmsg_cancel(skb, nlh); in build_aevent()
1878 static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_ae() argument
1888 struct xfrm_aevent_id *p = nlmsg_data(nlh); in xfrm_get_ae()
1910 c.seq = nlh->nlmsg_seq; in xfrm_get_ae()
1911 c.portid = nlh->nlmsg_pid; in xfrm_get_ae()
1921 static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_new_ae() argument
1930 struct xfrm_aevent_id *p = nlmsg_data(nlh); in xfrm_new_ae()
1941 if (!(nlh->nlmsg_flags&NLM_F_REPLACE)) in xfrm_new_ae()
1961 c.event = nlh->nlmsg_type; in xfrm_new_ae()
1962 c.seq = nlh->nlmsg_seq; in xfrm_new_ae()
1963 c.portid = nlh->nlmsg_pid; in xfrm_new_ae()
1972 static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_flush_policy() argument
1992 c.event = nlh->nlmsg_type; in xfrm_flush_policy()
1993 c.seq = nlh->nlmsg_seq; in xfrm_flush_policy()
1994 c.portid = nlh->nlmsg_pid; in xfrm_flush_policy()
2000 static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_pol_expire() argument
2005 struct xfrm_user_polexpire *up = nlmsg_data(nlh); in xfrm_add_pol_expire()
2056 km_policy_expired(xp, p->dir, up->hard, nlh->nlmsg_pid); in xfrm_add_pol_expire()
2063 static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_sa_expire() argument
2069 struct xfrm_user_expire *ue = nlmsg_data(nlh); in xfrm_add_sa_expire()
2084 km_state_expired(x, ue->hard, nlh->nlmsg_pid); in xfrm_add_sa_expire()
2097 static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_acquire() argument
2107 struct xfrm_user_acquire *ua = nlmsg_data(nlh); in xfrm_add_acquire()
2201 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_do_migrate() argument
2204 struct xfrm_userpolicy_id *pi = nlmsg_data(nlh); in xfrm_do_migrate()
2233 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_do_migrate() argument
2286 struct nlmsghdr *nlh; in build_migrate() local
2289 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MIGRATE, sizeof(*pol_id), 0); in build_migrate()
2290 if (nlh == NULL) in build_migrate()
2293 pol_id = nlmsg_data(nlh); in build_migrate()
2313 nlmsg_end(skb, nlh); in build_migrate()
2317 nlmsg_cancel(skb, nlh); in build_migrate()
2444 static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) in xfrm_user_rcv_msg() argument
2456 type = nlh->nlmsg_type; in xfrm_user_rcv_msg()
2469 (nlh->nlmsg_flags & NLM_F_DUMP)) { in xfrm_user_rcv_msg()
2478 return netlink_dump_start(net->xfrm.nlsk, skb, nlh, &c); in xfrm_user_rcv_msg()
2482 err = nlmsg_parse(nlh, xfrm_msg_min[type], attrs, in xfrm_user_rcv_msg()
2491 return link->doit(skb, nlh, attrs); in xfrm_user_rcv_msg()
2512 struct nlmsghdr *nlh; in build_expire() local
2515 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0); in build_expire()
2516 if (nlh == NULL) in build_expire()
2519 ue = nlmsg_data(nlh); in build_expire()
2527 nlmsg_end(skb, nlh); in build_expire()
2567 struct nlmsghdr *nlh; in xfrm_notify_sa_flush() local
2575 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0); in xfrm_notify_sa_flush()
2576 if (nlh == NULL) { in xfrm_notify_sa_flush()
2581 p = nlmsg_data(nlh); in xfrm_notify_sa_flush()
2584 nlmsg_end(skb, nlh); in xfrm_notify_sa_flush()
2630 struct nlmsghdr *nlh; in xfrm_notify_sa() local
2647 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0); in xfrm_notify_sa()
2649 if (nlh == NULL) in xfrm_notify_sa()
2652 p = nlmsg_data(nlh); in xfrm_notify_sa()
2656 id = nlmsg_data(nlh); in xfrm_notify_sa()
2673 nlmsg_end(skb, nlh); in xfrm_notify_sa()
2721 struct nlmsghdr *nlh; in build_acquire() local
2724 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_ACQUIRE, sizeof(*ua), 0); in build_acquire()
2725 if (nlh == NULL) in build_acquire()
2728 ua = nlmsg_data(nlh); in build_acquire()
2746 nlmsg_cancel(skb, nlh); in build_acquire()
2750 nlmsg_end(skb, nlh); in build_acquire()
2844 struct nlmsghdr *nlh; in build_polexpire() local
2847 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0); in build_polexpire()
2848 if (nlh == NULL) in build_polexpire()
2851 upe = nlmsg_data(nlh); in build_polexpire()
2861 nlmsg_cancel(skb, nlh); in build_polexpire()
2866 nlmsg_end(skb, nlh); in build_polexpire()
2891 struct nlmsghdr *nlh; in xfrm_notify_policy() local
2908 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0); in xfrm_notify_policy()
2910 if (nlh == NULL) in xfrm_notify_policy()
2913 p = nlmsg_data(nlh); in xfrm_notify_policy()
2917 id = nlmsg_data(nlh); in xfrm_notify_policy()
2942 nlmsg_end(skb, nlh); in xfrm_notify_policy()
2954 struct nlmsghdr *nlh; in xfrm_notify_policy_flush() local
2962 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0); in xfrm_notify_policy_flush()
2964 if (nlh == NULL) in xfrm_notify_policy_flush()
2970 nlmsg_end(skb, nlh); in xfrm_notify_policy_flush()
3009 struct nlmsghdr *nlh; in build_report() local
3011 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_REPORT, sizeof(*ur), 0); in build_report()
3012 if (nlh == NULL) in build_report()
3015 ur = nlmsg_data(nlh); in build_report()
3022 nlmsg_cancel(skb, nlh); in build_report()
3026 nlmsg_end(skb, nlh); in build_report()
3054 struct nlmsghdr *nlh; in build_mapping() local
3056 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MAPPING, sizeof(*um), 0); in build_mapping()
3057 if (nlh == NULL) in build_mapping()
3060 um = nlmsg_data(nlh); in build_mapping()
3072 nlmsg_end(skb, nlh); in build_mapping()