Lines Matching full:nh
135 struct nlmsghdr *nh; in libbpf_netlink_recv() local
166 for (nh = (struct nlmsghdr *)iov.iov_base; NLMSG_OK(nh, len); in libbpf_netlink_recv()
167 nh = NLMSG_NEXT(nh, len)) { in libbpf_netlink_recv()
168 if (nh->nlmsg_pid != nl_pid) { in libbpf_netlink_recv()
172 if (nh->nlmsg_seq != seq) { in libbpf_netlink_recv()
176 if (nh->nlmsg_flags & NLM_F_MULTI) in libbpf_netlink_recv()
178 switch (nh->nlmsg_type) { in libbpf_netlink_recv()
180 err = (struct nlmsgerr *)NLMSG_DATA(nh); in libbpf_netlink_recv()
184 libbpf_nla_dump_errormsg(nh); in libbpf_netlink_recv()
193 ret = _fn(nh, fn, cookie); in libbpf_netlink_recv()
226 req->nh.nlmsg_pid = 0; in libbpf_netlink_send_recv()
227 req->nh.nlmsg_seq = time(NULL); in libbpf_netlink_send_recv()
229 if (send(sock, req, req->nh.nlmsg_len, 0) < 0) { in libbpf_netlink_send_recv()
234 ret = libbpf_netlink_recv(sock, nl_pid, req->nh.nlmsg_seq, in libbpf_netlink_send_recv()
249 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); in __bpf_set_link_xdp_fd_replace()
250 req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; in __bpf_set_link_xdp_fd_replace()
251 req.nh.nlmsg_type = RTM_SETLINK; in __bpf_set_link_xdp_fd_replace()
363 .nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)), in bpf_xdp_query()
364 .nh.nlmsg_type = RTM_GETLINK, in bpf_xdp_query()
365 .nh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST, in bpf_xdp_query()
486 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in tc_qdisc_modify()
487 req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags; in tc_qdisc_modify()
488 req.nh.nlmsg_type = cmd; in tc_qdisc_modify()
574 static int get_tc_info(struct nlmsghdr *nh, libbpf_dump_nlmsg_t fn, in get_tc_info() argument
577 struct tcmsg *tc = NLMSG_DATA(nh); in get_tc_info()
582 NLMSG_PAYLOAD(nh, sizeof(*tc)), NULL); in get_tc_info()
585 return __get_tc_info(cookie, tc, tb, nh->nlmsg_flags & NLM_F_ECHO); in get_tc_info()
645 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in bpf_tc_attach()
646 req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE | in bpf_tc_attach()
648 req.nh.nlmsg_type = RTM_NEWTFILTER; in bpf_tc_attach()
721 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in __bpf_tc_detach()
722 req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; in __bpf_tc_detach()
723 req.nh.nlmsg_type = RTM_DELTFILTER; in __bpf_tc_detach()
788 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in bpf_tc_query()
789 req.nh.nlmsg_flags = NLM_F_REQUEST; in bpf_tc_query()
790 req.nh.nlmsg_type = RTM_GETTFILTER; in bpf_tc_query()