Lines Matching refs:nlh
596 static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_sa() argument
600 struct xfrm_usersa_info *p = nlmsg_data(nlh); in xfrm_add_sa()
617 if (nlh->nlmsg_type == XFRM_MSG_NEWSA) in xfrm_add_sa()
631 c.seq = nlh->nlmsg_seq; in xfrm_add_sa()
632 c.portid = nlh->nlmsg_pid; in xfrm_add_sa()
633 c.event = nlh->nlmsg_type; in xfrm_add_sa()
675 static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_del_sa() argument
682 struct xfrm_usersa_id *p = nlmsg_data(nlh); in xfrm_del_sa()
704 c.seq = nlh->nlmsg_seq; in xfrm_del_sa()
705 c.portid = nlh->nlmsg_pid; in xfrm_del_sa()
706 c.event = nlh->nlmsg_type; in xfrm_del_sa()
865 struct nlmsghdr *nlh; in dump_one_state() local
868 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq, in dump_one_state()
870 if (nlh == NULL) in dump_one_state()
873 p = nlmsg_data(nlh); in dump_one_state()
877 nlmsg_cancel(skb, nlh); in dump_one_state()
880 nlmsg_end(skb, nlh); in dump_one_state()
902 info.nlmsg_seq = cb->nlh->nlmsg_seq; in xfrm_dump_sa()
953 struct nlmsghdr *nlh; in build_spdinfo() local
957 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSPDINFO, sizeof(u32), 0); in build_spdinfo()
958 if (nlh == NULL) /* shouldn't really happen ... */ in build_spdinfo()
961 f = nlmsg_data(nlh); in build_spdinfo()
977 nlmsg_cancel(skb, nlh); in build_spdinfo()
981 return nlmsg_end(skb, nlh); in build_spdinfo()
984 static int xfrm_get_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_spdinfo() argument
989 u32 *flags = nlmsg_data(nlh); in xfrm_get_spdinfo()
991 u32 seq = nlh->nlmsg_seq; in xfrm_get_spdinfo()
1015 struct nlmsghdr *nlh; in build_sadinfo() local
1019 nlh = nlmsg_put(skb, portid, seq, XFRM_MSG_NEWSADINFO, sizeof(u32), 0); in build_sadinfo()
1020 if (nlh == NULL) /* shouldn't really happen ... */ in build_sadinfo()
1023 f = nlmsg_data(nlh); in build_sadinfo()
1034 nlmsg_cancel(skb, nlh); in build_sadinfo()
1038 return nlmsg_end(skb, nlh); in build_sadinfo()
1041 static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_sadinfo() argument
1046 u32 *flags = nlmsg_data(nlh); in xfrm_get_sadinfo()
1048 u32 seq = nlh->nlmsg_seq; in xfrm_get_sadinfo()
1060 static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_sa() argument
1064 struct xfrm_usersa_id *p = nlmsg_data(nlh); in xfrm_get_sa()
1073 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); in xfrm_get_sa()
1107 static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_alloc_userspi() argument
1120 p = nlmsg_data(nlh); in xfrm_alloc_userspi()
1152 resp_skb = xfrm_state_netlink(skb, x, nlh->nlmsg_seq); in xfrm_alloc_userspi()
1405 static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_policy() argument
1409 struct xfrm_userpolicy_info *p = nlmsg_data(nlh); in xfrm_add_policy()
1433 excl = nlh->nlmsg_type == XFRM_MSG_NEWPOLICY; in xfrm_add_policy()
1444 c.event = nlh->nlmsg_type; in xfrm_add_policy()
1445 c.seq = nlh->nlmsg_seq; in xfrm_add_policy()
1446 c.portid = nlh->nlmsg_pid; in xfrm_add_policy()
1529 struct nlmsghdr *nlh; in dump_one_policy() local
1532 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, sp->nlmsg_seq, in dump_one_policy()
1534 if (nlh == NULL) in dump_one_policy()
1537 p = nlmsg_data(nlh); in dump_one_policy()
1547 nlmsg_cancel(skb, nlh); in dump_one_policy()
1550 nlmsg_end(skb, nlh); in dump_one_policy()
1573 info.nlmsg_seq = cb->nlh->nlmsg_seq; in xfrm_dump_policy()
1616 static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_policy() argument
1629 p = nlmsg_data(nlh); in xfrm_get_policy()
1630 delete = nlh->nlmsg_type == XFRM_MSG_DELPOLICY; in xfrm_get_policy()
1668 resp_skb = xfrm_policy_netlink(skb, xp, p->dir, nlh->nlmsg_seq); in xfrm_get_policy()
1688 c.event = nlh->nlmsg_type; in xfrm_get_policy()
1689 c.seq = nlh->nlmsg_seq; in xfrm_get_policy()
1690 c.portid = nlh->nlmsg_pid; in xfrm_get_policy()
1701 static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_flush_sa() argument
1706 struct xfrm_usersa_flush *p = nlmsg_data(nlh); in xfrm_flush_sa()
1720 c.event = nlh->nlmsg_type; in xfrm_flush_sa()
1721 c.seq = nlh->nlmsg_seq; in xfrm_flush_sa()
1722 c.portid = nlh->nlmsg_pid; in xfrm_flush_sa()
1746 struct nlmsghdr *nlh; in build_aevent() local
1749 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_NEWAE, sizeof(*id), 0); in build_aevent()
1750 if (nlh == NULL) in build_aevent()
1753 id = nlmsg_data(nlh); in build_aevent()
1791 return nlmsg_end(skb, nlh); in build_aevent()
1794 nlmsg_cancel(skb, nlh); in build_aevent()
1798 static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_get_ae() argument
1808 struct xfrm_aevent_id *p = nlmsg_data(nlh); in xfrm_get_ae()
1830 c.seq = nlh->nlmsg_seq; in xfrm_get_ae()
1831 c.portid = nlh->nlmsg_pid; in xfrm_get_ae()
1841 static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_new_ae() argument
1850 struct xfrm_aevent_id *p = nlmsg_data(nlh); in xfrm_new_ae()
1859 if (!(nlh->nlmsg_flags&NLM_F_REPLACE)) in xfrm_new_ae()
1879 c.event = nlh->nlmsg_type; in xfrm_new_ae()
1880 c.seq = nlh->nlmsg_seq; in xfrm_new_ae()
1881 c.portid = nlh->nlmsg_pid; in xfrm_new_ae()
1890 static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_flush_policy() argument
1914 c.event = nlh->nlmsg_type; in xfrm_flush_policy()
1915 c.seq = nlh->nlmsg_seq; in xfrm_flush_policy()
1916 c.portid = nlh->nlmsg_pid; in xfrm_flush_policy()
1922 static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_pol_expire() argument
1927 struct xfrm_user_polexpire *up = nlmsg_data(nlh); in xfrm_add_pol_expire()
1984 km_policy_expired(xp, p->dir, up->hard, nlh->nlmsg_pid); in xfrm_add_pol_expire()
1991 static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_sa_expire() argument
1997 struct xfrm_user_expire *ue = nlmsg_data(nlh); in xfrm_add_sa_expire()
2012 km_state_expired(x, ue->hard, nlh->nlmsg_pid); in xfrm_add_sa_expire()
2030 static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_acquire() argument
2040 struct xfrm_user_acquire *ua = nlmsg_data(nlh); in xfrm_add_acquire()
2134 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_do_migrate() argument
2137 struct xfrm_userpolicy_id *pi = nlmsg_data(nlh); in xfrm_do_migrate()
2169 static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_do_migrate() argument
2222 struct nlmsghdr *nlh; in build_migrate() local
2225 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MIGRATE, sizeof(*pol_id), 0); in build_migrate()
2226 if (nlh == NULL) in build_migrate()
2229 pol_id = nlmsg_data(nlh); in build_migrate()
2249 return nlmsg_end(skb, nlh); in build_migrate()
2252 nlmsg_cancel(skb, nlh); in build_migrate()
2372 static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) in xfrm_user_rcv_msg() argument
2379 type = nlh->nlmsg_type; in xfrm_user_rcv_msg()
2392 (nlh->nlmsg_flags & NLM_F_DUMP)) { in xfrm_user_rcv_msg()
2401 return netlink_dump_start(net->xfrm.nlsk, skb, nlh, &c); in xfrm_user_rcv_msg()
2405 err = nlmsg_parse(nlh, xfrm_msg_min[type], attrs, XFRMA_MAX, in xfrm_user_rcv_msg()
2413 return link->doit(skb, nlh, attrs); in xfrm_user_rcv_msg()
2432 struct nlmsghdr *nlh; in build_expire() local
2435 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_EXPIRE, sizeof(*ue), 0); in build_expire()
2436 if (nlh == NULL) in build_expire()
2439 ue = nlmsg_data(nlh); in build_expire()
2447 return nlmsg_end(skb, nlh); in build_expire()
2486 struct nlmsghdr *nlh; in xfrm_notify_sa_flush() local
2494 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0); in xfrm_notify_sa_flush()
2495 if (nlh == NULL) { in xfrm_notify_sa_flush()
2500 p = nlmsg_data(nlh); in xfrm_notify_sa_flush()
2503 nlmsg_end(skb, nlh); in xfrm_notify_sa_flush()
2549 struct nlmsghdr *nlh; in xfrm_notify_sa() local
2566 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0); in xfrm_notify_sa()
2568 if (nlh == NULL) in xfrm_notify_sa()
2571 p = nlmsg_data(nlh); in xfrm_notify_sa()
2575 id = nlmsg_data(nlh); in xfrm_notify_sa()
2592 nlmsg_end(skb, nlh); in xfrm_notify_sa()
2640 struct nlmsghdr *nlh; in build_acquire() local
2643 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_ACQUIRE, sizeof(*ua), 0); in build_acquire()
2644 if (nlh == NULL) in build_acquire()
2647 ua = nlmsg_data(nlh); in build_acquire()
2665 nlmsg_cancel(skb, nlh); in build_acquire()
2669 return nlmsg_end(skb, nlh); in build_acquire()
2762 struct nlmsghdr *nlh; in build_polexpire() local
2765 nlh = nlmsg_put(skb, c->portid, 0, XFRM_MSG_POLEXPIRE, sizeof(*upe), 0); in build_polexpire()
2766 if (nlh == NULL) in build_polexpire()
2769 upe = nlmsg_data(nlh); in build_polexpire()
2779 nlmsg_cancel(skb, nlh); in build_polexpire()
2784 return nlmsg_end(skb, nlh); in build_polexpire()
2808 struct nlmsghdr *nlh; in xfrm_notify_policy() local
2825 nlh = nlmsg_put(skb, c->portid, c->seq, c->event, headlen, 0); in xfrm_notify_policy()
2827 if (nlh == NULL) in xfrm_notify_policy()
2830 p = nlmsg_data(nlh); in xfrm_notify_policy()
2834 id = nlmsg_data(nlh); in xfrm_notify_policy()
2859 nlmsg_end(skb, nlh); in xfrm_notify_policy()
2871 struct nlmsghdr *nlh; in xfrm_notify_policy_flush() local
2879 nlh = nlmsg_put(skb, c->portid, c->seq, XFRM_MSG_FLUSHPOLICY, 0, 0); in xfrm_notify_policy_flush()
2881 if (nlh == NULL) in xfrm_notify_policy_flush()
2887 nlmsg_end(skb, nlh); in xfrm_notify_policy_flush()
2931 struct nlmsghdr *nlh; in build_report() local
2933 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_REPORT, sizeof(*ur), 0); in build_report()
2934 if (nlh == NULL) in build_report()
2937 ur = nlmsg_data(nlh); in build_report()
2944 nlmsg_cancel(skb, nlh); in build_report()
2948 return nlmsg_end(skb, nlh); in build_report()
2975 struct nlmsghdr *nlh; in build_mapping() local
2977 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MAPPING, sizeof(*um), 0); in build_mapping()
2978 if (nlh == NULL) in build_mapping()
2981 um = nlmsg_data(nlh); in build_mapping()
2993 return nlmsg_end(skb, nlh); in build_mapping()