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()
1040 struct nlmsghdr *nlh; in dump_one_state() local
1043 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq, in dump_one_state()
1045 if (nlh == NULL) in dump_one_state()
1048 p = nlmsg_data(nlh); in dump_one_state()
1052 nlmsg_cancel(skb, nlh); in dump_one_state()
1055 nlmsg_end(skb, nlh); in dump_one_state()
1059 err = xtr->alloc_compat(skb, nlh); in dump_one_state()
1063 nlmsg_cancel(skb, nlh); in dump_one_state()
1093 info.nlmsg_seq = cb->nlh->nlmsg_seq; in xfrm_dump_sa()
1102 err = nlmsg_parse_deprecated(cb->nlh, 0, attrs, XFRMA_MAX, in xfrm_dump_sa()
1195 struct nlmsghdr *nlh; in build_spdinfo() local
1200 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSPDINFO, sizeof(u32), 0); in build_spdinfo()
1201 if (nlh == NULL) /* shouldn't really happen ... */ in build_spdinfo()
1204 f = nlmsg_data(nlh); in build_spdinfo()
1233 nlmsg_cancel(skb, nlh); in build_spdinfo()
1237 nlmsg_end(skb, nlh); in build_spdinfo()
1241 static int xfrm_set_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_set_spdinfo() argument
1286 static int xfrm_get_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_spdinfo() argument
1291 u32 *flags = nlmsg_data(nlh); in xfrm_get_spdinfo()
1293 u32 seq = nlh->nlmsg_seq; in xfrm_get_spdinfo()
1318 struct nlmsghdr *nlh; in build_sadinfo() local
1322 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSADINFO, sizeof(u32), 0); in build_sadinfo()
1323 if (nlh == NULL) /* shouldn't really happen ... */ in build_sadinfo()
1326 f = nlmsg_data(nlh); in build_sadinfo()
1337 nlmsg_cancel(skb, nlh); in build_sadinfo()
1341 nlmsg_end(skb, nlh); in build_sadinfo()
1345 static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_sadinfo() argument
1350 u32 *flags = nlmsg_data(nlh); in xfrm_get_sadinfo()
1352 u32 seq = nlh->nlmsg_seq; in xfrm_get_sadinfo()
1365 static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_sa() argument
1369 struct xfrm_usersa_id *p = nlmsg_data(nlh); in xfrm_get_sa()
1378 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); in xfrm_get_sa()
1389 static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_alloc_userspi() argument
1404 p = nlmsg_data(nlh); in xfrm_alloc_userspi()
1440 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); in xfrm_alloc_userspi()
1741 static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_policy() argument
1745 struct xfrm_userpolicy_info *p = nlmsg_data(nlh); in xfrm_add_policy()
1766 excl = nlh->nlmsg_type == XFRM_MSG_NEWPOLICY; in xfrm_add_policy()
1776 c.event = nlh->nlmsg_type; in xfrm_add_policy()
1777 c.seq = nlh->nlmsg_seq; in xfrm_add_policy()
1778 c.portid = nlh->nlmsg_pid; in xfrm_add_policy()
1864 struct nlmsghdr *nlh; in dump_one_policy() local
1867 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq, in dump_one_policy()
1869 if (nlh == NULL) in dump_one_policy()
1872 p = nlmsg_data(nlh); in dump_one_policy()
1884 nlmsg_cancel(skb, nlh); in dump_one_policy()
1887 nlmsg_end(skb, nlh); in dump_one_policy()
1891 err = xtr->alloc_compat(skb, nlh); in dump_one_policy()
1895 nlmsg_cancel(skb, nlh); in dump_one_policy()
1930 info.nlmsg_seq = cb->nlh->nlmsg_seq; in xfrm_dump_policy()
1968 struct nlmsghdr *nlh; in xfrm_notify_userpolicy() local
1976 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_GETDEFAULT, sizeof(*up), 0); in xfrm_notify_userpolicy()
1977 if (nlh == NULL) { in xfrm_notify_userpolicy()
1982 up = nlmsg_data(nlh); in xfrm_notify_userpolicy()
1990 nlmsg_end(skb, nlh); in xfrm_notify_userpolicy()
1999 static int xfrm_set_default(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_set_default() argument
2003 struct xfrm_userpolicy_default *up = nlmsg_data(nlh); in xfrm_set_default()
2026 static int xfrm_get_default(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_default() argument
2035 u32 seq = nlh->nlmsg_seq; in xfrm_get_default()
2060 static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_policy() argument
2073 p = nlmsg_data(nlh); in xfrm_get_policy()
2074 delete = nlh->nlmsg_type == XFRM_MSG_DELPOLICY; in xfrm_get_policy()
2118 resp_skb = xfrm_policy_netlink(skb, xp, p->dir, nlh->nlmsg_seq); in xfrm_get_policy()
2132 c.event = nlh->nlmsg_type; in xfrm_get_policy()
2133 c.seq = nlh->nlmsg_seq; in xfrm_get_policy()
2134 c.portid = nlh->nlmsg_pid; in xfrm_get_policy()
2143 static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_flush_sa() argument
2148 struct xfrm_usersa_flush *p = nlmsg_data(nlh); in xfrm_flush_sa()
2158 c.event = nlh->nlmsg_type; in xfrm_flush_sa()
2159 c.seq = nlh->nlmsg_seq; in xfrm_flush_sa()
2160 c.portid = nlh->nlmsg_pid; in xfrm_flush_sa()
2184 struct nlmsghdr *nlh; in build_aevent() local
2187 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0); in build_aevent()
2188 if (nlh == NULL) in build_aevent()
2191 id = nlmsg_data(nlh); in build_aevent()
2235 nlmsg_end(skb, nlh); in build_aevent()
2239 nlmsg_cancel(skb, nlh); in build_aevent()
2243 static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_ae() argument
2253 struct xfrm_aevent_id *p = nlmsg_data(nlh); in xfrm_get_ae()
2275 c.seq = nlh->nlmsg_seq; in xfrm_get_ae()
2276 c.portid = nlh->nlmsg_pid; in xfrm_get_ae()
2287 static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_new_ae() argument
2296 struct xfrm_aevent_id *p = nlmsg_data(nlh); in xfrm_new_ae()
2307 if (!(nlh->nlmsg_flags&NLM_F_REPLACE)) in xfrm_new_ae()
2327 c.event = nlh->nlmsg_type; in xfrm_new_ae()
2328 c.seq = nlh->nlmsg_seq; in xfrm_new_ae()
2329 c.portid = nlh->nlmsg_pid; in xfrm_new_ae()
2338 static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_flush_policy() argument
2358 c.event = nlh->nlmsg_type; in xfrm_flush_policy()
2359 c.seq = nlh->nlmsg_seq; in xfrm_flush_policy()
2360 c.portid = nlh->nlmsg_pid; in xfrm_flush_policy()
2366 static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_pol_expire() argument
2371 struct xfrm_user_polexpire *up = nlmsg_data(nlh); in xfrm_add_pol_expire()
2425 km_policy_expired(xp, p->dir, up->hard, nlh->nlmsg_pid); in xfrm_add_pol_expire()
2432 static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_sa_expire() argument
2438 struct xfrm_user_expire *ue = nlmsg_data(nlh); in xfrm_add_sa_expire()
2453 km_state_expired(x, ue->hard, nlh->nlmsg_pid); in xfrm_add_sa_expire()
2466 static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_acquire() argument
2476 struct xfrm_user_acquire *ua = nlmsg_data(nlh); in xfrm_add_acquire()
2571 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_do_migrate() argument
2574 struct xfrm_userpolicy_id *pi = nlmsg_data(nlh); in xfrm_do_migrate()
2613 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_do_migrate() argument
2669 struct nlmsghdr *nlh; in build_migrate() local
2672 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MIGRATE, sizeof(*pol_id), 0); in build_migrate()
2673 if (nlh == NULL) in build_migrate()
2676 pol_id = nlmsg_data(nlh); in build_migrate()
2701 nlmsg_end(skb, nlh); in build_migrate()
2705 nlmsg_cancel(skb, nlh); in build_migrate()
2848 static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_user_rcv_msg() argument
2857 type = nlh->nlmsg_type; in xfrm_user_rcv_msg()
2874 nlh64 = xtr->rcv_msg_compat(nlh, link->nla_max, in xfrm_user_rcv_msg()
2880 nlh = nlh64; in xfrm_user_rcv_msg()
2885 (nlh->nlmsg_flags & NLM_F_DUMP)) { in xfrm_user_rcv_msg()
2897 err = netlink_dump_start(net->xfrm.nlsk, skb, nlh, &c); in xfrm_user_rcv_msg()
2901 err = nlmsg_parse_deprecated(nlh, xfrm_msg_min[type], attrs, in xfrm_user_rcv_msg()
2912 err = link->doit(skb, nlh, attrs); in xfrm_user_rcv_msg()
2947 struct nlmsghdr *nlh; in build_expire() local
2950 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0); in build_expire()
2951 if (nlh == NULL) in build_expire()
2954 ue = nlmsg_data(nlh); in build_expire()
2968 nlmsg_end(skb, nlh); in build_expire()
3009 struct nlmsghdr *nlh; in xfrm_notify_sa_flush() local
3017 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0); in xfrm_notify_sa_flush()
3018 if (nlh == NULL) { in xfrm_notify_sa_flush()
3023 p = nlmsg_data(nlh); in xfrm_notify_sa_flush()
3026 nlmsg_end(skb, nlh); in xfrm_notify_sa_flush()
3080 struct nlmsghdr *nlh; in xfrm_notify_sa() local
3098 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0); in xfrm_notify_sa()
3100 if (nlh == NULL) in xfrm_notify_sa()
3103 p = nlmsg_data(nlh); in xfrm_notify_sa()
3107 id = nlmsg_data(nlh); in xfrm_notify_sa()
3125 nlmsg_end(skb, nlh); in xfrm_notify_sa()
3173 struct nlmsghdr *nlh; in build_acquire() local
3176 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_ACQUIRE, sizeof(*ua), 0); in build_acquire()
3177 if (nlh == NULL) in build_acquire()
3180 ua = nlmsg_data(nlh); in build_acquire()
3200 nlmsg_cancel(skb, nlh); in build_acquire()
3204 nlmsg_end(skb, nlh); in build_acquire()
3299 struct nlmsghdr *nlh; in build_polexpire() local
3302 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0); in build_polexpire()
3303 if (nlh == NULL) in build_polexpire()
3306 upe = nlmsg_data(nlh); in build_polexpire()
3318 nlmsg_cancel(skb, nlh); in build_polexpire()
3323 nlmsg_end(skb, nlh); in build_polexpire()
3349 struct nlmsghdr *nlh; in xfrm_notify_policy() local
3367 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0); in xfrm_notify_policy()
3369 if (nlh == NULL) in xfrm_notify_policy()
3372 p = nlmsg_data(nlh); in xfrm_notify_policy()
3376 id = nlmsg_data(nlh); in xfrm_notify_policy()
3403 nlmsg_end(skb, nlh); in xfrm_notify_policy()
3415 struct nlmsghdr *nlh; in xfrm_notify_policy_flush() local
3423 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0); in xfrm_notify_policy_flush()
3425 if (nlh == NULL) in xfrm_notify_policy_flush()
3431 nlmsg_end(skb, nlh); in xfrm_notify_policy_flush()
3470 struct nlmsghdr *nlh; in build_report() local
3472 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_REPORT, sizeof(*ur), 0); in build_report()
3473 if (nlh == NULL) in build_report()
3476 ur = nlmsg_data(nlh); in build_report()
3483 nlmsg_cancel(skb, nlh); in build_report()
3487 nlmsg_end(skb, nlh); in build_report()
3516 struct nlmsghdr *nlh; in build_mapping() local
3518 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MAPPING, sizeof(*um), 0); in build_mapping()
3519 if (nlh == NULL) in build_mapping()
3522 um = nlmsg_data(nlh); in build_mapping()
3534 nlmsg_end(skb, nlh); in build_mapping()