/linux/tools/testing/selftests/netfilter/ |
A D | nf-queue.c | 131 nlh->nlmsg_flags = NLM_F_REQUEST; in nfq_build_cfg_request() 141 return nlh; in nfq_build_cfg_request() 164 return nlh; in nfq_build_cfg_params() 174 struct nlmsghdr *nlh; in nfq_build_verdict() local 177 nlh = mnl_nlmsg_put_header(buf); in nfq_build_verdict() 187 return nlh; in nfq_build_verdict() 212 struct nlmsghdr *nlh; in open_queue() local 230 if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { in open_queue() 242 if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { in open_queue() 274 struct nlmsghdr *nlh; in mainloop() local [all …]
|
/linux/drivers/staging/gdm724x/ |
A D | netlink_k.c | 20 #define ND_NLMSG_DATA(nlh) ((void *)((char *)NLMSG_DATA(nlh) + \ argument 23 #define ND_NLMSG_R_LEN(nlh) ((nlh)->nlmsg_len - ND_IFINDEX_LEN) argument 24 #define ND_NLMSG_IFIDX(nlh) NLMSG_DATA(nlh) argument 31 struct nlmsghdr *nlh; in netlink_rcv_cb() local 47 nlh = (struct nlmsghdr *)skb->data; in netlink_rcv_cb() 49 if (skb->len < nlh->nlmsg_len || nlh->nlmsg_len > ND_MAX_MSG_LEN) { in netlink_rcv_cb() 51 skb->len, nlh->nlmsg_len); in netlink_rcv_cb() 56 msg = ND_NLMSG_DATA(nlh); in netlink_rcv_cb() 57 mlen = ND_NLMSG_R_LEN(nlh); in netlink_rcv_cb() 97 struct nlmsghdr *nlh; in netlink_send() local [all …]
|
/linux/net/netfilter/ |
A D | nfnetlink.c | 223 type = nlh->nlmsg_type; in nfnetlink_rcv_msg() 259 .nlh = nlh, in nfnetlink_rcv_msg() 260 .nfmsg = nlmsg_data(nlh), in nfnetlink_rcv_msg() 312 struct nlmsghdr *nlh; member 326 nfnl_err->nlh = nlh; in nfnl_err_add() 435 nlh = nlmsg_hdr(skb); in nfnetlink_rcv_batch() 452 type = nlh->nlmsg_type; in nfnetlink_rcv_batch() 495 .nlh = nlh, in nfnetlink_rcv_batch() 496 .nfmsg = nlmsg_data(nlh), in nfnetlink_rcv_batch() 626 nfgenmsg = nlmsg_data(nlh); in nfnetlink_rcv_skb_batch() [all …]
|
A D | nfnetlink_cttimeout.c | 174 struct nlmsghdr *nlh; in ctnl_timeout_fill_info() local 183 if (!nlh) in ctnl_timeout_fill_info() 204 nlmsg_end(skb, nlh); in ctnl_timeout_fill_info() 209 nlmsg_cancel(skb, nlh); in ctnl_timeout_fill_info() 237 cb->nlh->nlmsg_seq, in ctnl_timeout_dump() 283 info->nlh->nlmsg_seq, in cttimeout_get_timeout() 386 struct nlmsghdr *nlh; in cttimeout_default_fill_info() local 394 if (!nlh) in cttimeout_default_fill_info() 411 nlmsg_end(skb, nlh); in cttimeout_default_fill_info() 416 nlmsg_cancel(skb, nlh); in cttimeout_default_fill_info() [all …]
|
/linux/drivers/infiniband/core/ |
A D | iwpm_msg.c | 67 struct nlmsghdr *nlh; in iwpm_register_pid() local 80 nlh->nlmsg_seq = iwpm_get_nlmsg_seq(); in iwpm_register_pid() 106 nlmsg_end(skb, nlh); in iwpm_register_pid() 147 struct nlmsghdr *nlh; in iwpm_add_mapping() local 193 nlmsg_end(skb, nlh); in iwpm_add_mapping() 230 struct nlmsghdr *nlh; in iwpm_add_and_query_mapping() local 283 nlmsg_end(skb, nlh); in iwpm_add_and_query_mapping() 317 struct nlmsghdr *nlh; in iwpm_remove_mapping() local 346 nlmsg_end(skb, nlh); in iwpm_remove_mapping() 423 iwpm_user_pid = cb->nlh->nlmsg_pid; in iwpm_register_pid_cb() [all …]
|
A D | netlink.c | 135 if (!*nlh) in ibnl_put_msg() 137 return nlmsg_data(*nlh); in ibnl_put_msg() 145 nlmsg_cancel(skb, nlh); in ibnl_put_attr() 155 int type = nlh->nlmsg_type; in rdma_nl_rcv_msg() 212 struct nlmsghdr *nlh; in rdma_nl_rcv_skb() local 218 nlh = nlmsg_hdr(skb); in rdma_nl_rcv_skb() 221 if (nlh->nlmsg_len < NLMSG_HDRLEN || skb->len < nlh->nlmsg_len) in rdma_nl_rcv_skb() 236 if (nlh->nlmsg_type < NLMSG_MIN_TYPE) in rdma_nl_rcv_skb() 239 err = cb(skb, nlh, &extack); in rdma_nl_rcv_skb() 245 netlink_ack(skb, nlh, err, &extack); in rdma_nl_rcv_skb() [all …]
|
A D | nldev.c | 1041 nlh = nlmsg_put(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq, in nldev_get_doit() 1185 nlh = nlmsg_put(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq, in nldev_port_get_doit() 1288 nlh = nlmsg_put(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq, in nldev_res_get_doit() 1452 nlh = nlmsg_put(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq, in res_get_common_doit() 1794 nlh = nlmsg_put(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq, in nldev_get_chardev() 1851 nlh = nlmsg_put(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq, in nldev_sys_get_doit() 2030 nlh = nlmsg_put(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq, in nldev_stat_set_doit() 2099 nlh = nlmsg_put(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq, in nldev_stat_del_doit() 2168 nlh = nlmsg_put(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq, in stat_get_doit_default_counter() 2257 nlh = nlmsg_put(msg, NETLINK_CB(skb).portid, nlh->nlmsg_seq, in stat_get_doit_qp() [all …]
|
A D | iwpm_util.c | 581 struct nlmsghdr *nlh; in send_mapinfo_num() local 602 nlmsg_end(skb, nlh); in send_mapinfo_num() 620 struct nlmsghdr *nlh = NULL; in send_nlmsg_done() local 631 nlh->nlmsg_type = NLMSG_DONE; in send_nlmsg_done() 642 struct nlmsghdr *nlh; in iwpm_send_mapinfo() local 663 nlh = NULL; in iwpm_send_mapinfo() 671 ret = ibnl_put_attr(skb, nlh, in iwpm_send_mapinfo() 678 ret = ibnl_put_attr(skb, nlh, in iwpm_send_mapinfo() 693 nlmsg_end(skb, nlh); in iwpm_send_mapinfo() 764 struct nlmsghdr *nlh; in iwpm_send_hello() local [all …]
|
/linux/net/phonet/ |
A D | pn_netlink.c | 74 ifm = nlmsg_data(nlh); in addr_doit() 99 struct nlmsghdr *nlh; in fill_addr() local 102 if (nlh == NULL) in fill_addr() 105 ifm = nlmsg_data(nlh); in fill_addr() 113 nlmsg_end(skb, nlh); in fill_addr() 117 nlmsg_cancel(skb, nlh); in fill_addr() 164 struct nlmsghdr *nlh; in fill_route() local 167 if (nlh == NULL) in fill_route() 170 rtm = nlmsg_data(nlh); in fill_route() 183 nlmsg_end(skb, nlh); in fill_route() [all …]
|
/linux/drivers/scsi/ |
A D | scsi_netlink.c | 34 struct nlmsghdr *nlh; in scsi_nl_rcv_msg() local 42 nlh = nlmsg_hdr(skb); in scsi_nl_rcv_msg() 43 if ((nlh->nlmsg_len < (sizeof(*nlh) + sizeof(*hdr))) || in scsi_nl_rcv_msg() 44 (skb->len < nlh->nlmsg_len)) { in scsi_nl_rcv_msg() 50 rlen = NLMSG_ALIGN(nlh->nlmsg_len); in scsi_nl_rcv_msg() 54 if (nlh->nlmsg_type != SCSI_TRANSPORT_MSG) { in scsi_nl_rcv_msg() 59 hdr = nlmsg_data(nlh); in scsi_nl_rcv_msg() 71 if (nlh->nlmsg_len < (sizeof(*nlh) + hdr->msglen)) { in scsi_nl_rcv_msg() 99 if ((err) || (nlh->nlmsg_flags & NLM_F_ACK)) in scsi_nl_rcv_msg() 100 netlink_ack(skb, nlh, err, NULL); in scsi_nl_rcv_msg()
|
/linux/tools/bpf/bpftool/ |
A D | net.c | 217 struct nlmsghdr nlh; in netlink_get_class() member 221 .nlh.nlmsg_type = RTM_GETTCLASS, in netlink_get_class() 228 req.nlh.nlmsg_seq = seq; in netlink_get_class() 256 struct nlmsghdr nlh; in netlink_get_qdisc() member 260 .nlh.nlmsg_type = RTM_GETQDISC, in netlink_get_qdisc() 267 req.nlh.nlmsg_seq = seq; in netlink_get_qdisc() 295 struct nlmsghdr nlh; in netlink_get_filter() member 307 req.nlh.nlmsg_seq = seq; in netlink_get_filter() 334 struct nlmsghdr nlh; in netlink_get_link() member 338 .nlh.nlmsg_type = RTM_GETLINK, in netlink_get_link() [all …]
|
/linux/net/xfrm/ |
A D | xfrm_user.c | 1045 if (nlh == NULL) in dump_one_state() 1869 if (nlh == NULL) in dump_one_policy() 2188 if (nlh == NULL) in build_aevent() 2673 if (nlh == NULL) in build_migrate() 2880 nlh = nlh64; in xfrm_user_rcv_msg() 2951 if (nlh == NULL) in build_expire() 3100 if (nlh == NULL) in xfrm_notify_sa() 3177 if (nlh == NULL) in build_acquire() 3303 if (nlh == NULL) in build_polexpire() 3369 if (nlh == NULL) in xfrm_notify_policy() [all …]
|
/linux/include/net/ |
A D | netlink.h | 454 struct nlmsghdr *nlh; member 579 return nlh->nlmsg_len - NLMSG_HDRLEN; in nlmsg_len() 590 unsigned char *data = nlmsg_data(nlh); in nlmsg_attrdata() 613 nlh->nlmsg_len <= remaining); in nlmsg_ok() 808 nlmsg_attrlen(nlh, hdrlen), attrtype); in nlmsg_find_attr() 888 return nlh ? !!(nlh->nlmsg_flags & NLM_F_ECHO) : 0; in nlmsg_report() 900 nlmsg_attrlen(nlh, hdrlen), rem) 967 nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh; in nlmsg_end() 1006 nlmsg_trim(skb, nlh); in nlmsg_cancel() 1086 struct nlmsghdr *nlh) in nl_dump_check_consistent() argument [all …]
|
/linux/net/decnet/netfilter/ |
A D | dn_rtmsg.c | 36 struct nlmsghdr *nlh; in dnrmg_build_message() local 48 nlh = nlmsg_put(skb, 0, 0, 0, size, 0); in dnrmg_build_message() 49 if (!nlh) { in dnrmg_build_message() 54 rtm = (struct nf_dn_rtmsg *)nlmsg_data(nlh); in dnrmg_build_message() 58 nlh->nlmsg_len = skb->tail - old_tail; in dnrmg_build_message() 97 #define RCV_SKB_FAIL(err) do { netlink_ack(skb, nlh, (err), NULL); return; } while (0) 101 struct nlmsghdr *nlh = nlmsg_hdr(skb); in dnrmg_receive_user_skb() local 103 if (skb->len < sizeof(*nlh) || in dnrmg_receive_user_skb() 104 nlh->nlmsg_len < sizeof(*nlh) || in dnrmg_receive_user_skb() 105 skb->len < nlh->nlmsg_len) in dnrmg_receive_user_skb()
|
/linux/net/ipv6/ |
A D | addrlabel.c | 399 ifal = nlmsg_data(nlh); in ip6addrlbl_newdel() 415 switch (nlh->nlmsg_type) { in ip6addrlbl_newdel() 454 if (!nlh) in ip6addrlbl_fill() 461 nlmsg_cancel(skb, nlh); in ip6addrlbl_fill() 465 nlmsg_end(skb, nlh); in ip6addrlbl_fill() 479 ifal = nlmsg_data(nlh); in ip6addrlbl_valid_dump_req() 496 const struct nlmsghdr *nlh = cb->nlh; in ip6addrlbl_dump() local 514 nlh->nlmsg_seq, in ip6addrlbl_dump() 551 ifal = nlmsg_data(nlh); in ip6addrlbl_valid_get_req() 594 ifal = nlmsg_data(nlh); in ip6addrlbl_get() [all …]
|
/linux/tools/include/uapi/linux/ |
A D | netlink.h | 94 #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) argument 95 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ argument 96 (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len))) 97 #define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \ argument 98 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ 99 (nlh)->nlmsg_len <= (len)) 100 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len))) argument
|
/linux/include/uapi/linux/ |
A D | netlink.h | 94 #define NLMSG_DATA(nlh) ((void *)(((char *)nlh) + NLMSG_HDRLEN)) argument 95 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ argument 96 (struct nlmsghdr *)(((char *)(nlh)) + \ 97 NLMSG_ALIGN((nlh)->nlmsg_len))) 98 #define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \ argument 99 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ 100 (nlh)->nlmsg_len <= (len)) 101 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len))) argument
|
/linux/net/ipv4/ |
A D | inet_diag.c | 252 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, in inet_sk_diag_fill() 254 if (!nlh) in inet_sk_diag_fill() 257 r = nlmsg_data(nlh); in inet_sk_diag_fill() 405 nlmsg_end(skb, nlh); in inet_sk_diag_fill() 425 cb->nlh->nlmsg_seq, cb->nlh->nlmsg_type, in inet_twsk_diag_fill() 427 if (!nlh) in inet_twsk_diag_fill() 464 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, in inet_req_diag_fill() 466 if (!nlh) in inet_req_diag_fill() 612 .nlh = nlh, in inet_diag_cmd_exact() 1202 const struct nlmsghdr *nlh = cb->nlh; in __inet_diag_dump_start() local [all …]
|
/linux/security/selinux/ |
A D | netlink.c | 43 static void selnl_add_payload(struct nlmsghdr *nlh, int len, int msgtype, void *data) in selnl_add_payload() argument 47 struct selnl_msg_setenforce *msg = nlmsg_data(nlh); in selnl_add_payload() 55 struct selnl_msg_policyload *msg = nlmsg_data(nlh); in selnl_add_payload() 72 struct nlmsghdr *nlh; in selnl_notify() local 81 nlh = nlmsg_put(skb, 0, 0, msgtype, len, 0); in selnl_notify() 82 if (!nlh) in selnl_notify() 84 selnl_add_payload(nlh, len, msgtype, data); in selnl_notify() 85 nlh->nlmsg_len = skb->tail - tmp; in selnl_notify()
|
/linux/crypto/ |
A D | crypto_user_base.c | 159 struct nlmsghdr *nlh; in crypto_report_alg() local 165 if (!nlh) { in crypto_report_alg() 170 ualg = nlmsg_data(nlh); in crypto_report_alg() 174 nlmsg_cancel(skb, nlh); in crypto_report_alg() 178 nlmsg_end(skb, nlh); in crypto_report_alg() 234 info.nlmsg_seq = cb->nlh->nlmsg_seq; in crypto_dump_report() 264 struct crypto_user_alg *p = nlmsg_data(nlh); in crypto_update_alg() 300 struct crypto_user_alg *p = nlmsg_data(nlh); in crypto_del_alg() 430 type = nlh->nlmsg_type; in crypto_user_rcv_msg() 438 (nlh->nlmsg_flags & NLM_F_DUMP))) { in crypto_user_rcv_msg() [all …]
|
/linux/net/core/ |
A D | sock_diag.c | 19 static int (*inet_rcv_compat)(struct sk_buff *skb, struct nlmsghdr *nlh); 213 static int __sock_diag_cmd(struct sk_buff *skb, struct nlmsghdr *nlh) in __sock_diag_cmd() argument 216 struct sock_diag_req *req = nlmsg_data(nlh); in __sock_diag_cmd() 219 if (nlmsg_len(nlh) < sizeof(*req)) in __sock_diag_cmd() 233 else if (nlh->nlmsg_type == SOCK_DIAG_BY_FAMILY) in __sock_diag_cmd() 234 err = hndl->dump(skb, nlh); in __sock_diag_cmd() 235 else if (nlh->nlmsg_type == SOCK_DESTROY && hndl->destroy) in __sock_diag_cmd() 236 err = hndl->destroy(skb, nlh); in __sock_diag_cmd() 249 switch (nlh->nlmsg_type) { in sock_diag_rcv_msg() 257 ret = inet_rcv_compat(skb, nlh); in sock_diag_rcv_msg() [all …]
|
/linux/drivers/connector/ |
A D | connector.c | 67 struct nlmsghdr *nlh; in cn_netlink_send_mult() local 100 nlh = nlmsg_put(skb, 0, msg->seq, NLMSG_DONE, size, 0); in cn_netlink_send_mult() 101 if (!nlh) { in cn_netlink_send_mult() 106 data = nlmsg_data(nlh); in cn_netlink_send_mult() 133 struct nlmsghdr *nlh; in cn_call_callback() local 141 nlh = nlmsg_hdr(skb); in cn_call_callback() 142 if (nlh->nlmsg_len < NLMSG_HDRLEN + sizeof(struct cn_msg) + msg->len) in cn_call_callback() 172 struct nlmsghdr *nlh; in cn_rx_skb() local 176 nlh = nlmsg_hdr(skb); in cn_rx_skb() 177 len = nlmsg_len(nlh); in cn_rx_skb() [all …]
|
/linux/net/mctp/ |
A D | neigh.c | 128 rc = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, nd_mctp_policy, in mctp_rtm_newneigh() 154 ndm = nlmsg_data(nlh); in mctp_rtm_newneigh() 197 ndm = nlmsg_data(nlh); in mctp_rtm_delneigh() 213 struct nlmsghdr *nlh; in mctp_fill_neigh() local 216 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*hdr), flags); in mctp_fill_neigh() 217 if (!nlh) in mctp_fill_neigh() 220 hdr = nlmsg_data(nlh); in mctp_fill_neigh() 235 nlmsg_end(skb, nlh); in mctp_fill_neigh() 239 nlmsg_cancel(skb, nlh); in mctp_fill_neigh() 253 ndmsg = nlmsg_data(cb->nlh); in mctp_rtm_getneigh() [all …]
|
/linux/include/linux/netfilter/ |
A D | nfnetlink.h | 13 const struct nlmsghdr *nlh; member 68 static inline void nfnl_fill_hdr(struct nlmsghdr *nlh, u8 family, u8 version, in nfnl_fill_hdr() argument 73 nfmsg = nlmsg_data(nlh); in nfnl_fill_hdr() 84 struct nlmsghdr *nlh; in nfnl_msg_put() local 86 nlh = nlmsg_put(skb, portid, seq, type, sizeof(struct nfgenmsg), flags); in nfnl_msg_put() 87 if (!nlh) in nfnl_msg_put() 90 nfnl_fill_hdr(nlh, family, version, res_id); in nfnl_msg_put() 92 return nlh; in nfnl_msg_put()
|
/linux/samples/connector/ |
A D | ucon.c | 48 struct nlmsghdr *nlh; in netlink_send() local 56 nlh = (struct nlmsghdr *)buf; in netlink_send() 57 nlh->nlmsg_seq = seq++; in netlink_send() 58 nlh->nlmsg_pid = getpid(); in netlink_send() 59 nlh->nlmsg_type = NLMSG_DONE; in netlink_send() 60 nlh->nlmsg_len = size; in netlink_send() 61 nlh->nlmsg_flags = 0; in netlink_send() 63 m = NLMSG_DATA(nlh); in netlink_send() 70 err = send(s, nlh, size, 0); in netlink_send()
|