Home
last modified time | relevance | path

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

/tools/include/uapi/linux/
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)))
/tools/lib/bpf/
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()
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 = (void *)nlh + nlh->nlmsg_len - (void *)attr; in libbpf_nla_dump_errormsg()
Dnetlink.c221 if (send(sock, req, req->nh.nlmsg_len, 0) < 0) { in libbpf_netlink_send_recv()
241 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); in __bpf_set_link_xdp_fd_replace()
301 len = nlh->nlmsg_len - NLMSG_LENGTH(sizeof(*ifi)); in __dump_link_nlmsg()
362 .nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)), in bpf_get_link_xdp_info()
481 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in tc_qdisc_modify()
639 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in bpf_tc_attach()
715 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in __bpf_tc_detach()
782 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in bpf_tc_query()
/tools/bpf/bpftool/
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 …]
/tools/testing/selftests/net/
Dipsec.c174 return (struct rtattr *)((char *)(nh) + RTA_ALIGN((nh)->nlmsg_len)); in rtattr_hdr()
182 size_t nl_size = RTA_ALIGN(nh->nlmsg_len) + RTA_LENGTH(size); in rtattr_pack()
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()
[all …]
Dudpgso.c420 nh->nlmsg_len = off; in set_route_mtu()
/tools/testing/selftests/net/mptcp/
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()
/tools/accounting/
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()
/tools/testing/selftests/netfilter/
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()
/tools/testing/vsock/
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()
/tools/testing/selftests/nci/
Dnci_dev.c122 msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN); in send_cmd_mt_nla()
140 msg.n.nlmsg_len += prv_len; in send_cmd_mt_nla()
144 buflen = msg.n.nlmsg_len; in send_cmd_mt_nla()