/linux/tools/include/uapi/linux/ |
A D | netlink.h | 45 __u32 nlmsg_len; /* Length of message including header */ member 95 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ 96 (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len))) 98 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ 99 (nlh)->nlmsg_len <= (len)) 100 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
|
/linux/include/uapi/linux/ |
A D | netlink.h | 45 __u32 nlmsg_len; /* Length of message including header */ member 95 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ 97 NLMSG_ALIGN((nlh)->nlmsg_len))) 99 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ 100 (nlh)->nlmsg_len <= (len)) 101 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
|
/linux/drivers/scsi/ |
A D | scsi_netlink.c | 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() 71 if (nlh->nlmsg_len < (sizeof(*nlh) + hdr->msglen)) { in scsi_nl_rcv_msg()
|
/linux/tools/bpf/bpftool/ |
A D | net.c | 205 len = nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*t)); in __dump_class_nlmsg() 220 .nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)), in netlink_get_class() 229 if (send(sock, &req, req.nlh.nlmsg_len, 0) < 0) in netlink_get_class() 244 len = nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*t)); in __dump_qdisc_nlmsg() 259 .nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)), in netlink_get_qdisc() 268 if (send(sock, &req, req.nlh.nlmsg_len, 0) < 0) in netlink_get_qdisc() 283 len = nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*t)); in __dump_filter_nlmsg() 298 .nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)), in netlink_get_filter() 308 if (send(sock, &req, req.nlh.nlmsg_len, 0) < 0) in netlink_get_filter() 322 len = nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*ifi)); in __dump_link_nlmsg() [all …]
|
/linux/tools/lib/bpf/ |
A D | nlattr.h | 126 return (struct nlattr *)((void *)req + NLMSG_ALIGN(req->nh.nlmsg_len)); in req_tail() 134 if (NLMSG_ALIGN(req->nh.nlmsg_len) + NLA_ALIGN(NLA_HDRLEN + len) > sizeof(*req)) in nlattr_add() 144 req->nh.nlmsg_len = NLMSG_ALIGN(req->nh.nlmsg_len) + NLA_ALIGN(nla->nla_len); in nlattr_add()
|
A D | nlattr.c | 81 static inline int nlmsg_len(const struct nlmsghdr *nlh) in nlmsg_len() function 83 return nlh->nlmsg_len - NLMSG_HDRLEN; in nlmsg_len() 178 hlen += nlmsg_len(&err->msg); in libbpf_nla_dump_errormsg() 181 alen = nlh->nlmsg_len - hlen; in libbpf_nla_dump_errormsg()
|
A D | netlink.c | 172 if (send(sock, req, req->nh.nlmsg_len, 0) < 0) { in libbpf_netlink_send_recv() 192 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); in __bpf_set_link_xdp_fd_replace() 252 len = nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*ifi)); in __dump_link_nlmsg() 313 .nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)), in bpf_get_link_xdp_info() 432 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in tc_qdisc_modify() 590 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in bpf_tc_attach() 666 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in __bpf_tc_detach() 733 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in bpf_tc_query()
|
/linux/net/netfilter/ |
A D | nfnetlink.c | 220 if (nlmsg_len(nlh) < sizeof(struct nfgenmsg)) in nfnetlink_rcv_msg() 254 int attrlen = nlh->nlmsg_len - min_len; in nfnetlink_rcv_msg() 438 if (nlh->nlmsg_len < NLMSG_HDRLEN || in nfnetlink_rcv_batch() 439 skb->len < nlh->nlmsg_len || in nfnetlink_rcv_batch() 440 nlmsg_len(nlh) < sizeof(struct nfgenmsg)) { in nfnetlink_rcv_batch() 491 int attrlen = nlh->nlmsg_len - min_len; in nfnetlink_rcv_batch() 549 msglen = NLMSG_ALIGN(nlh->nlmsg_len); in nfnetlink_rcv_batch() 604 int attrlen = nlh->nlmsg_len - min_len; in nfnetlink_rcv_skb_batch() 610 msglen = NLMSG_ALIGN(nlh->nlmsg_len); in nfnetlink_rcv_skb_batch() 642 nlh->nlmsg_len < NLMSG_HDRLEN || in nfnetlink_rcv() [all …]
|
/linux/tools/testing/selftests/net/ |
A D | ipsec.c | 188 nh->nlmsg_len = nl_size; in rtattr_pack() 216 char *nlmsg_end = (char *)nh + nh->nlmsg_len; in rtattr_end() 282 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info)); in veth_add() 312 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in veth_add() 330 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info)); in ip4_addr_set() 354 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in ip4_addr_set() 370 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info)); in link_set_up() 380 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in link_set_up() 398 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.rt)); in ip4_route_set() 418 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in ip4_route_set() [all …]
|
/linux/drivers/staging/gdm724x/ |
A D | netlink_k.c | 23 #define ND_NLMSG_R_LEN(nlh) ((nlh)->nlmsg_len - ND_IFINDEX_LEN) 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()
|
/linux/net/decnet/netfilter/ |
A D | dn_rtmsg.c | 58 nlh->nlmsg_len = skb->tail - old_tail; in dnrmg_build_message() 104 nlh->nlmsg_len < sizeof(*nlh) || in dnrmg_receive_user_skb() 105 skb->len < nlh->nlmsg_len) in dnrmg_receive_user_skb()
|
/linux/drivers/connector/ |
A D | connector.c | 142 if (nlh->nlmsg_len < NLMSG_HDRLEN + sizeof(struct cn_msg) + msg->len) in cn_call_callback() 177 len = nlmsg_len(nlh); in cn_rx_skb() 180 skb->len < nlh->nlmsg_len || in cn_rx_skb()
|
/linux/tools/testing/selftests/net/mptcp/ |
A D | pm_nl_ctl.c | 46 nh->nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN); in init_genl_req() 59 int len = nh->nlmsg_len - sizeof(*nh); in nl_error() 95 nh->nlmsg_len = len; in do_nl_req() 122 int len = nlh->nlmsg_len; in genl_parse_getfamily() 127 nlh->nlmsg_len, nlh->nlmsg_type); in genl_parse_getfamily() 466 int len = nh->nlmsg_len; in print_addrs() 544 nh->nlmsg_len = off; in dump_addrs() 573 int len = nh->nlmsg_len; in print_limits()
|
/linux/include/net/ |
A D | netlink.h | 577 static inline int nlmsg_len(const struct nlmsghdr *nlh) in nlmsg_len() function 579 return nlh->nlmsg_len - NLMSG_HDRLEN; in nlmsg_len() 601 return nlmsg_len(nlh) - NLMSG_ALIGN(hdrlen); in nlmsg_attrlen() 612 nlh->nlmsg_len >= sizeof(struct nlmsghdr) && in nlmsg_ok() 613 nlh->nlmsg_len <= remaining); in nlmsg_ok() 627 int totlen = NLMSG_ALIGN(nlh->nlmsg_len); in nlmsg_next() 728 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) { in __nlmsg_parse() 870 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) in nlmsg_validate_deprecated() 967 nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh; in nlmsg_end()
|
A D | rtnetlink.h | 25 if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg)) in rtnl_msg_family()
|
/linux/drivers/infiniband/core/ |
A D | netlink.c | 221 if (nlh->nlmsg_len < NLMSG_HDRLEN || skb->len < nlh->nlmsg_len) in rdma_nl_rcv_skb() 248 msglen = NLMSG_ALIGN(nlh->nlmsg_len); in rdma_nl_rcv_skb()
|
/linux/tools/accounting/ |
A D | getdelays.c | 130 msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN); in send_cmd() 141 msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len); in send_cmd() 144 buflen = msg.n.nlmsg_len ; in send_cmd() 469 sizeof(struct nlmsghdr), msg.n.nlmsg_len, rep_len); in main()
|
/linux/tools/testing/selftests/netfilter/ |
A D | nf-queue.c | 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() 317 if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { in mainloop()
|
/linux/net/xfrm/ |
A D | xfrm_compat.c | 355 size_t len = nlmsg_len(src); in xfrm_user_rcv_calculate_len64() 417 nlmsg->nlmsg_len += nla->nla_len; in xfrm_attr_cpy32() 469 dst->nlmsg_len = NLMSG_HDRLEN + xfrm_msg_min[type]; in xfrm_xlate32() 541 pos = dst->nlmsg_len; in xfrm_xlate32() 608 if (len == nlmsg_len(h32)) in xfrm_user_rcv_msg_compat()
|
/linux/tools/testing/vsock/ |
A D | vsock_diag_test.c | 174 .nlmsg_len = sizeof(req), in send_req() 288 if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) in read_vsock_stat() 303 if (h->nlmsg_len < in read_vsock_stat()
|
/linux/samples/bpf/ |
A D | xdp_router_ipv4_user.c | 345 req.nl.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); in get_route_table() 355 iov.iov_len = req.nl.nlmsg_len; in get_route_table() 495 req.nl.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); in get_arp_table() 504 iov.iov_len = req.nl.nlmsg_len; in get_arp_table()
|
/linux/net/tipc/ |
A D | diag.c | 82 if (nlmsg_len(h) < hdrlen) in tipc_sock_diag_handler_dump()
|
/linux/security/selinux/ |
A D | netlink.c | 85 nlh->nlmsg_len = skb->tail - tmp; in selnl_notify()
|
/linux/samples/connector/ |
A D | ucon.c | 60 nlh->nlmsg_len = size; in netlink_send()
|
/linux/net/vmw_vsock/ |
A D | diag.c | 146 if (nlmsg_len(h) < hdrlen) in vsock_diag_handler_dump()
|