Lines Matching refs:nlh

671 static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh,  in xfrm_add_sa()  argument
675 struct xfrm_usersa_info *p = nlmsg_data(nlh); in xfrm_add_sa()
689 if (nlh->nlmsg_type == XFRM_MSG_NEWSA) in xfrm_add_sa()
706 c.seq = nlh->nlmsg_seq; in xfrm_add_sa()
707 c.portid = nlh->nlmsg_pid; in xfrm_add_sa()
708 c.event = nlh->nlmsg_type; in xfrm_add_sa()
750 static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_del_sa() argument
757 struct xfrm_usersa_id *p = nlmsg_data(nlh); in xfrm_del_sa()
776 c.seq = nlh->nlmsg_seq; in xfrm_del_sa()
777 c.portid = nlh->nlmsg_pid; in xfrm_del_sa()
778 c.event = nlh->nlmsg_type; in xfrm_del_sa()
980 struct nlmsghdr *nlh; in dump_one_state() local
983 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq, in dump_one_state()
985 if (nlh == NULL) in dump_one_state()
988 p = nlmsg_data(nlh); in dump_one_state()
992 nlmsg_cancel(skb, nlh); in dump_one_state()
995 nlmsg_end(skb, nlh); in dump_one_state()
999 err = xtr->alloc_compat(skb, nlh); in dump_one_state()
1003 nlmsg_cancel(skb, nlh); in dump_one_state()
1033 info.nlmsg_seq = cb->nlh->nlmsg_seq; in xfrm_dump_sa()
1042 err = nlmsg_parse_deprecated(cb->nlh, 0, attrs, XFRMA_MAX, in xfrm_dump_sa()
1135 struct nlmsghdr *nlh; in build_spdinfo() local
1140 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSPDINFO, sizeof(u32), 0); in build_spdinfo()
1141 if (nlh == NULL) /* shouldn't really happen ... */ in build_spdinfo()
1144 f = nlmsg_data(nlh); in build_spdinfo()
1173 nlmsg_cancel(skb, nlh); in build_spdinfo()
1177 nlmsg_end(skb, nlh); in build_spdinfo()
1181 static int xfrm_set_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_set_spdinfo() argument
1226 static int xfrm_get_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_spdinfo() argument
1231 u32 *flags = nlmsg_data(nlh); in xfrm_get_spdinfo()
1233 u32 seq = nlh->nlmsg_seq; in xfrm_get_spdinfo()
1258 struct nlmsghdr *nlh; in build_sadinfo() local
1262 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSADINFO, sizeof(u32), 0); in build_sadinfo()
1263 if (nlh == NULL) /* shouldn't really happen ... */ in build_sadinfo()
1266 f = nlmsg_data(nlh); in build_sadinfo()
1277 nlmsg_cancel(skb, nlh); in build_sadinfo()
1281 nlmsg_end(skb, nlh); in build_sadinfo()
1285 static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_sadinfo() argument
1290 u32 *flags = nlmsg_data(nlh); in xfrm_get_sadinfo()
1292 u32 seq = nlh->nlmsg_seq; in xfrm_get_sadinfo()
1305 static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_sa() argument
1309 struct xfrm_usersa_id *p = nlmsg_data(nlh); in xfrm_get_sa()
1318 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); in xfrm_get_sa()
1329 static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_alloc_userspi() argument
1344 p = nlmsg_data(nlh); in xfrm_alloc_userspi()
1380 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); in xfrm_alloc_userspi()
1681 static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_policy() argument
1685 struct xfrm_userpolicy_info *p = nlmsg_data(nlh); in xfrm_add_policy()
1706 excl = nlh->nlmsg_type == XFRM_MSG_NEWPOLICY; in xfrm_add_policy()
1716 c.event = nlh->nlmsg_type; in xfrm_add_policy()
1717 c.seq = nlh->nlmsg_seq; in xfrm_add_policy()
1718 c.portid = nlh->nlmsg_pid; in xfrm_add_policy()
1804 struct nlmsghdr *nlh; in dump_one_policy() local
1807 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq, in dump_one_policy()
1809 if (nlh == NULL) in dump_one_policy()
1812 p = nlmsg_data(nlh); in dump_one_policy()
1824 nlmsg_cancel(skb, nlh); in dump_one_policy()
1827 nlmsg_end(skb, nlh); in dump_one_policy()
1831 err = xtr->alloc_compat(skb, nlh); in dump_one_policy()
1835 nlmsg_cancel(skb, nlh); in dump_one_policy()
1870 info.nlmsg_seq = cb->nlh->nlmsg_seq; in xfrm_dump_policy()
1904 static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_policy() argument
1917 p = nlmsg_data(nlh); in xfrm_get_policy()
1918 delete = nlh->nlmsg_type == XFRM_MSG_DELPOLICY; in xfrm_get_policy()
1962 resp_skb = xfrm_policy_netlink(skb, xp, p->dir, nlh->nlmsg_seq); in xfrm_get_policy()
1976 c.event = nlh->nlmsg_type; in xfrm_get_policy()
1977 c.seq = nlh->nlmsg_seq; in xfrm_get_policy()
1978 c.portid = nlh->nlmsg_pid; in xfrm_get_policy()
1987 static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_flush_sa() argument
1992 struct xfrm_usersa_flush *p = nlmsg_data(nlh); in xfrm_flush_sa()
2002 c.event = nlh->nlmsg_type; in xfrm_flush_sa()
2003 c.seq = nlh->nlmsg_seq; in xfrm_flush_sa()
2004 c.portid = nlh->nlmsg_pid; in xfrm_flush_sa()
2028 struct nlmsghdr *nlh; in build_aevent() local
2031 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0); in build_aevent()
2032 if (nlh == NULL) in build_aevent()
2035 id = nlmsg_data(nlh); in build_aevent()
2079 nlmsg_end(skb, nlh); in build_aevent()
2083 nlmsg_cancel(skb, nlh); in build_aevent()
2087 static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_ae() argument
2097 struct xfrm_aevent_id *p = nlmsg_data(nlh); in xfrm_get_ae()
2119 c.seq = nlh->nlmsg_seq; in xfrm_get_ae()
2120 c.portid = nlh->nlmsg_pid; in xfrm_get_ae()
2131 static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_new_ae() argument
2140 struct xfrm_aevent_id *p = nlmsg_data(nlh); in xfrm_new_ae()
2151 if (!(nlh->nlmsg_flags&NLM_F_REPLACE)) in xfrm_new_ae()
2171 c.event = nlh->nlmsg_type; in xfrm_new_ae()
2172 c.seq = nlh->nlmsg_seq; in xfrm_new_ae()
2173 c.portid = nlh->nlmsg_pid; in xfrm_new_ae()
2182 static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_flush_policy() argument
2202 c.event = nlh->nlmsg_type; in xfrm_flush_policy()
2203 c.seq = nlh->nlmsg_seq; in xfrm_flush_policy()
2204 c.portid = nlh->nlmsg_pid; in xfrm_flush_policy()
2210 static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_pol_expire() argument
2215 struct xfrm_user_polexpire *up = nlmsg_data(nlh); in xfrm_add_pol_expire()
2269 km_policy_expired(xp, p->dir, up->hard, nlh->nlmsg_pid); in xfrm_add_pol_expire()
2276 static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_sa_expire() argument
2282 struct xfrm_user_expire *ue = nlmsg_data(nlh); in xfrm_add_sa_expire()
2297 km_state_expired(x, ue->hard, nlh->nlmsg_pid); in xfrm_add_sa_expire()
2310 static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_acquire() argument
2320 struct xfrm_user_acquire *ua = nlmsg_data(nlh); in xfrm_add_acquire()
2415 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_do_migrate() argument
2418 struct xfrm_userpolicy_id *pi = nlmsg_data(nlh); in xfrm_do_migrate()
2461 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_do_migrate() argument
2517 struct nlmsghdr *nlh; in build_migrate() local
2520 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MIGRATE, sizeof(*pol_id), 0); in build_migrate()
2521 if (nlh == NULL) in build_migrate()
2524 pol_id = nlmsg_data(nlh); in build_migrate()
2549 nlmsg_end(skb, nlh); in build_migrate()
2553 nlmsg_cancel(skb, nlh); in build_migrate()
2692 static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_user_rcv_msg() argument
2701 type = nlh->nlmsg_type; in xfrm_user_rcv_msg()
2720 nlh64 = xtr->rcv_msg_compat(nlh, link->nla_max, in xfrm_user_rcv_msg()
2726 nlh = nlh64; in xfrm_user_rcv_msg()
2732 (nlh->nlmsg_flags & NLM_F_DUMP)) { in xfrm_user_rcv_msg()
2744 err = netlink_dump_start(net->xfrm.nlsk, skb, nlh, &c); in xfrm_user_rcv_msg()
2748 err = nlmsg_parse_deprecated(nlh, xfrm_msg_min[type], attrs, in xfrm_user_rcv_msg()
2759 err = link->doit(skb, nlh, attrs); in xfrm_user_rcv_msg()
2794 struct nlmsghdr *nlh; in build_expire() local
2797 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0); in build_expire()
2798 if (nlh == NULL) in build_expire()
2801 ue = nlmsg_data(nlh); in build_expire()
2815 nlmsg_end(skb, nlh); in build_expire()
2856 struct nlmsghdr *nlh; in xfrm_notify_sa_flush() local
2864 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0); in xfrm_notify_sa_flush()
2865 if (nlh == NULL) { in xfrm_notify_sa_flush()
2870 p = nlmsg_data(nlh); in xfrm_notify_sa_flush()
2873 nlmsg_end(skb, nlh); in xfrm_notify_sa_flush()
2927 struct nlmsghdr *nlh; in xfrm_notify_sa() local
2945 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0); in xfrm_notify_sa()
2947 if (nlh == NULL) in xfrm_notify_sa()
2950 p = nlmsg_data(nlh); in xfrm_notify_sa()
2954 id = nlmsg_data(nlh); in xfrm_notify_sa()
2972 nlmsg_end(skb, nlh); in xfrm_notify_sa()
3020 struct nlmsghdr *nlh; in build_acquire() local
3023 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_ACQUIRE, sizeof(*ua), 0); in build_acquire()
3024 if (nlh == NULL) in build_acquire()
3027 ua = nlmsg_data(nlh); in build_acquire()
3047 nlmsg_cancel(skb, nlh); in build_acquire()
3051 nlmsg_end(skb, nlh); in build_acquire()
3146 struct nlmsghdr *nlh; in build_polexpire() local
3149 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0); in build_polexpire()
3150 if (nlh == NULL) in build_polexpire()
3153 upe = nlmsg_data(nlh); in build_polexpire()
3165 nlmsg_cancel(skb, nlh); in build_polexpire()
3170 nlmsg_end(skb, nlh); in build_polexpire()
3196 struct nlmsghdr *nlh; in xfrm_notify_policy() local
3214 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0); in xfrm_notify_policy()
3216 if (nlh == NULL) in xfrm_notify_policy()
3219 p = nlmsg_data(nlh); in xfrm_notify_policy()
3223 id = nlmsg_data(nlh); in xfrm_notify_policy()
3250 nlmsg_end(skb, nlh); in xfrm_notify_policy()
3262 struct nlmsghdr *nlh; in xfrm_notify_policy_flush() local
3270 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0); in xfrm_notify_policy_flush()
3272 if (nlh == NULL) in xfrm_notify_policy_flush()
3278 nlmsg_end(skb, nlh); in xfrm_notify_policy_flush()
3317 struct nlmsghdr *nlh; in build_report() local
3319 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_REPORT, sizeof(*ur), 0); in build_report()
3320 if (nlh == NULL) in build_report()
3323 ur = nlmsg_data(nlh); in build_report()
3330 nlmsg_cancel(skb, nlh); in build_report()
3334 nlmsg_end(skb, nlh); in build_report()
3363 struct nlmsghdr *nlh; in build_mapping() local
3365 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MAPPING, sizeof(*um), 0); in build_mapping()
3366 if (nlh == NULL) in build_mapping()
3369 um = nlmsg_data(nlh); in build_mapping()
3381 nlmsg_end(skb, nlh); in build_mapping()