Lines Matching refs:nh
96 struct nlmsghdr *nh; in libbpf_netlink_recv() local
112 for (nh = (struct nlmsghdr *)buf; NLMSG_OK(nh, len); in libbpf_netlink_recv()
113 nh = NLMSG_NEXT(nh, len)) { in libbpf_netlink_recv()
114 if (nh->nlmsg_pid != nl_pid) { in libbpf_netlink_recv()
118 if (nh->nlmsg_seq != seq) { in libbpf_netlink_recv()
122 if (nh->nlmsg_flags & NLM_F_MULTI) in libbpf_netlink_recv()
124 switch (nh->nlmsg_type) { in libbpf_netlink_recv()
126 err = (struct nlmsgerr *)NLMSG_DATA(nh); in libbpf_netlink_recv()
130 libbpf_nla_dump_errormsg(nh); in libbpf_netlink_recv()
138 ret = _fn(nh, fn, cookie); in libbpf_netlink_recv()
169 req->nh.nlmsg_pid = 0; in libbpf_netlink_send_recv()
170 req->nh.nlmsg_seq = time(NULL); in libbpf_netlink_send_recv()
172 if (send(sock, req, req->nh.nlmsg_len, 0) < 0) { in libbpf_netlink_send_recv()
177 ret = libbpf_netlink_recv(sock, nl_pid, req->nh.nlmsg_seq, in libbpf_netlink_send_recv()
192 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); in __bpf_set_link_xdp_fd_replace()
193 req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; in __bpf_set_link_xdp_fd_replace()
194 req.nh.nlmsg_type = RTM_SETLINK; in __bpf_set_link_xdp_fd_replace()
313 .nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)), in bpf_get_link_xdp_info()
314 .nh.nlmsg_type = RTM_GETLINK, in bpf_get_link_xdp_info()
315 .nh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST, in bpf_get_link_xdp_info()
432 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in tc_qdisc_modify()
433 req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags; in tc_qdisc_modify()
434 req.nh.nlmsg_type = cmd; in tc_qdisc_modify()
520 static int get_tc_info(struct nlmsghdr *nh, libbpf_dump_nlmsg_t fn, in get_tc_info() argument
523 struct tcmsg *tc = NLMSG_DATA(nh); in get_tc_info()
528 NLMSG_PAYLOAD(nh, sizeof(*tc)), NULL); in get_tc_info()
531 return __get_tc_info(cookie, tc, tb, nh->nlmsg_flags & NLM_F_ECHO); in get_tc_info()
590 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in bpf_tc_attach()
591 req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE | in bpf_tc_attach()
593 req.nh.nlmsg_type = RTM_NEWTFILTER; in bpf_tc_attach()
666 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in __bpf_tc_detach()
667 req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; in __bpf_tc_detach()
668 req.nh.nlmsg_type = RTM_DELTFILTER; in __bpf_tc_detach()
733 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg)); in bpf_tc_query()
734 req.nh.nlmsg_flags = NLM_F_REQUEST; in bpf_tc_query()
735 req.nh.nlmsg_type = RTM_GETTFILTER; in bpf_tc_query()