Lines Matching refs:nlh

679 static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
683 struct xfrm_usersa_info *p = nlmsg_data(nlh);
697 if (nlh->nlmsg_type == XFRM_MSG_NEWSA)
714 c.seq = nlh->nlmsg_seq;
715 c.portid = nlh->nlmsg_pid;
716 c.event = nlh->nlmsg_type;
758 static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
765 struct xfrm_usersa_id *p = nlmsg_data(nlh);
784 c.seq = nlh->nlmsg_seq;
785 c.portid = nlh->nlmsg_pid;
786 c.event = nlh->nlmsg_type;
993 struct nlmsghdr *nlh;
996 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq,
998 if (nlh == NULL)
1001 p = nlmsg_data(nlh);
1005 nlmsg_cancel(skb, nlh);
1008 nlmsg_end(skb, nlh);
1012 err = xtr->alloc_compat(skb, nlh);
1016 nlmsg_cancel(skb, nlh);
1046 info.nlmsg_seq = cb->nlh->nlmsg_seq;
1055 err = nlmsg_parse_deprecated(cb->nlh, 0, attrs, XFRMA_MAX,
1157 struct nlmsghdr *nlh;
1162 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSPDINFO, sizeof(u32), 0);
1163 if (nlh == NULL) /* shouldn't really happen ... */
1166 f = nlmsg_data(nlh);
1195 nlmsg_cancel(skb, nlh);
1199 nlmsg_end(skb, nlh);
1203 static int xfrm_set_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
1248 static int xfrm_get_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
1253 u32 *flags = nlmsg_data(nlh);
1255 u32 seq = nlh->nlmsg_seq;
1280 struct nlmsghdr *nlh;
1284 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSADINFO, sizeof(u32), 0);
1285 if (nlh == NULL) /* shouldn't really happen ... */
1288 f = nlmsg_data(nlh);
1299 nlmsg_cancel(skb, nlh);
1303 nlmsg_end(skb, nlh);
1307 static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh,
1312 u32 *flags = nlmsg_data(nlh);
1314 u32 seq = nlh->nlmsg_seq;
1327 static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
1331 struct xfrm_usersa_id *p = nlmsg_data(nlh);
1340 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq);
1351 static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh,
1366 p = nlmsg_data(nlh);
1402 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq);
1703 static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
1707 struct xfrm_userpolicy_info *p = nlmsg_data(nlh);
1724 /* shouldn't excl be based on nlh flags??
1728 excl = nlh->nlmsg_type == XFRM_MSG_NEWPOLICY;
1738 c.event = nlh->nlmsg_type;
1739 c.seq = nlh->nlmsg_seq;
1740 c.portid = nlh->nlmsg_pid;
1826 struct nlmsghdr *nlh;
1829 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq,
1831 if (nlh == NULL)
1834 p = nlmsg_data(nlh);
1846 nlmsg_cancel(skb, nlh);
1849 nlmsg_end(skb, nlh);
1853 err = xtr->alloc_compat(skb, nlh);
1857 nlmsg_cancel(skb, nlh);
1892 info.nlmsg_seq = cb->nlh->nlmsg_seq;
1930 struct nlmsghdr *nlh;
1938 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_GETDEFAULT, sizeof(*up), 0);
1939 if (nlh == NULL) {
1944 up = nlmsg_data(nlh);
1949 nlmsg_end(skb, nlh);
1964 static int xfrm_set_default(struct sk_buff *skb, struct nlmsghdr *nlh,
1968 struct xfrm_userpolicy_default *up = nlmsg_data(nlh);
1985 static int xfrm_get_default(struct sk_buff *skb, struct nlmsghdr *nlh,
1994 u32 seq = nlh->nlmsg_seq;
2015 static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
2028 p = nlmsg_data(nlh);
2029 delete = nlh->nlmsg_type == XFRM_MSG_DELPOLICY;
2073 resp_skb = xfrm_policy_netlink(skb, xp, p->dir, nlh->nlmsg_seq);
2087 c.event = nlh->nlmsg_type;
2088 c.seq = nlh->nlmsg_seq;
2089 c.portid = nlh->nlmsg_pid;
2098 static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
2103 struct xfrm_usersa_flush *p = nlmsg_data(nlh);
2113 c.event = nlh->nlmsg_type;
2114 c.seq = nlh->nlmsg_seq;
2115 c.portid = nlh->nlmsg_pid;
2139 struct nlmsghdr *nlh;
2142 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0);
2143 if (nlh == NULL)
2146 id = nlmsg_data(nlh);
2190 nlmsg_end(skb, nlh);
2194 nlmsg_cancel(skb, nlh);
2198 static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
2208 struct xfrm_aevent_id *p = nlmsg_data(nlh);
2230 c.seq = nlh->nlmsg_seq;
2231 c.portid = nlh->nlmsg_pid;
2242 static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh,
2251 struct xfrm_aevent_id *p = nlmsg_data(nlh);
2262 if (!(nlh->nlmsg_flags&NLM_F_REPLACE))
2282 c.event = nlh->nlmsg_type;
2283 c.seq = nlh->nlmsg_seq;
2284 c.portid = nlh->nlmsg_pid;
2293 static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
2313 c.event = nlh->nlmsg_type;
2314 c.seq = nlh->nlmsg_seq;
2315 c.portid = nlh->nlmsg_pid;
2321 static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
2326 struct xfrm_user_polexpire *up = nlmsg_data(nlh);
2380 km_policy_expired(xp, p->dir, up->hard, nlh->nlmsg_pid);
2387 static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
2393 struct xfrm_user_expire *ue = nlmsg_data(nlh);
2408 km_state_expired(x, ue->hard, nlh->nlmsg_pid);
2421 static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh,
2431 struct xfrm_user_acquire *ua = nlmsg_data(nlh);
2526 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
2529 struct xfrm_userpolicy_id *pi = nlmsg_data(nlh);
2572 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
2628 struct nlmsghdr *nlh;
2631 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MIGRATE, sizeof(*pol_id), 0);
2632 if (nlh == NULL)
2635 pol_id = nlmsg_data(nlh);
2660 nlmsg_end(skb, nlh);
2664 nlmsg_cancel(skb, nlh);
2808 static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
2817 type = nlh->nlmsg_type;
2834 nlh64 = xtr->rcv_msg_compat(nlh, link->nla_max,
2840 nlh = nlh64;
2845 (nlh->nlmsg_flags & NLM_F_DUMP)) {
2857 err = netlink_dump_start(net->xfrm.nlsk, skb, nlh, &c);
2861 err = nlmsg_parse_deprecated(nlh, xfrm_msg_min[type], attrs,
2872 err = link->doit(skb, nlh, attrs);
2907 struct nlmsghdr *nlh;
2910 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0);
2911 if (nlh == NULL)
2914 ue = nlmsg_data(nlh);
2928 nlmsg_end(skb, nlh);
2969 struct nlmsghdr *nlh;
2977 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0);
2978 if (nlh == NULL) {
2983 p = nlmsg_data(nlh);
2986 nlmsg_end(skb, nlh);
3043 struct nlmsghdr *nlh;
3061 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0);
3063 if (nlh == NULL)
3066 p = nlmsg_data(nlh);
3070 id = nlmsg_data(nlh);
3088 nlmsg_end(skb, nlh);
3136 struct nlmsghdr *nlh;
3139 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_ACQUIRE, sizeof(*ua), 0);
3140 if (nlh == NULL)
3143 ua = nlmsg_data(nlh);
3163 nlmsg_cancel(skb, nlh);
3167 nlmsg_end(skb, nlh);
3262 struct nlmsghdr *nlh;
3265 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0);
3266 if (nlh == NULL)
3269 upe = nlmsg_data(nlh);
3281 nlmsg_cancel(skb, nlh);
3286 nlmsg_end(skb, nlh);
3312 struct nlmsghdr *nlh;
3330 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0);
3332 if (nlh == NULL)
3335 p = nlmsg_data(nlh);
3339 id = nlmsg_data(nlh);
3366 nlmsg_end(skb, nlh);
3378 struct nlmsghdr *nlh;
3386 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0);
3388 if (nlh == NULL)
3394 nlmsg_end(skb, nlh);
3433 struct nlmsghdr *nlh;
3435 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_REPORT, sizeof(*ur), 0);
3436 if (nlh == NULL)
3439 ur = nlmsg_data(nlh);
3446 nlmsg_cancel(skb, nlh);
3450 nlmsg_end(skb, nlh);
3479 struct nlmsghdr *nlh;
3481 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MAPPING, sizeof(*um), 0);
3482 if (nlh == NULL)
3485 um = nlmsg_data(nlh);
3497 nlmsg_end(skb, nlh);