Home
last modified time | relevance | path

Searched refs:nlmsg_len (Results 1 – 25 of 69) sorted by relevance

123

/linux/tools/include/uapi/linux/
A Dnetlink.h45 __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 Dnetlink.h45 __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 Dscsi_netlink.c43 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 Dnet.c205 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 Dnlattr.h126 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 Dnlattr.c81 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 Dnetlink.c172 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 Dnfnetlink.c220 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 Dipsec.c188 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 Dnetlink_k.c23 #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 Ddn_rtmsg.c58 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 Dconnector.c142 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 Dpm_nl_ctl.c46 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 Dnetlink.h577 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 Drtnetlink.h25 if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg)) in rtnl_msg_family()
/linux/drivers/infiniband/core/
A Dnetlink.c221 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 Dgetdelays.c130 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 Dnf-queue.c230 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 Dxfrm_compat.c355 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 Dvsock_diag_test.c174 .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 Dxdp_router_ipv4_user.c345 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 Ddiag.c82 if (nlmsg_len(h) < hdrlen) in tipc_sock_diag_handler_dump()
/linux/security/selinux/
A Dnetlink.c85 nlh->nlmsg_len = skb->tail - tmp; in selnl_notify()
/linux/samples/connector/
A Ducon.c60 nlh->nlmsg_len = size; in netlink_send()
/linux/net/vmw_vsock/
A Ddiag.c146 if (nlmsg_len(h) < hdrlen) in vsock_diag_handler_dump()

Completed in 38 milliseconds

123