Lines Matching refs:nh
40 struct nlmsghdr *nh = (void *)data; in init_genl_req() local
44 nh->nlmsg_type = family; in init_genl_req()
45 nh->nlmsg_flags = NLM_F_REQUEST; in init_genl_req()
46 nh->nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN); in init_genl_req()
47 off += NLMSG_ALIGN(sizeof(*nh)); in init_genl_req()
56 static void nl_error(struct nlmsghdr *nh) in nl_error() argument
58 struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(nh); in nl_error()
59 int len = nh->nlmsg_len - sizeof(*nh); in nl_error()
68 struct rtattr *attrs = (struct rtattr *)NLMSG_DATA(nh); in nl_error()
87 static int do_nl_req(int fd, struct nlmsghdr *nh, int len, int max) in do_nl_req() argument
91 void *data = nh; in do_nl_req()
95 nh->nlmsg_len = len; in do_nl_req()
108 for (; NLMSG_OK(nh, rem); nh = NLMSG_NEXT(nh, rem)) { in do_nl_req()
109 if (nh->nlmsg_type == NLMSG_ERROR) { in do_nl_req()
110 nl_error(nh); in do_nl_req()
153 struct nlmsghdr *nh; in resolve_mptcp_pm_netlink() local
159 nh = (void *)data; in resolve_mptcp_pm_netlink()
169 do_nl_req(fd, nh, off, sizeof(data)); in resolve_mptcp_pm_netlink()
179 struct nlmsghdr *nh; in add_addr() local
188 nh = (void *)data; in add_addr()
300 do_nl_req(fd, nh, off, 0); in add_addr()
310 struct nlmsghdr *nh; in del_addr() local
317 nh = (void *)data; in del_addr()
368 do_nl_req(fd, nh, off, 0); in del_addr()
461 static void print_addrs(struct nlmsghdr *nh, int pm_family, int total_len) in print_addrs() argument
465 for (; NLMSG_OK(nh, total_len); nh = NLMSG_NEXT(nh, total_len)) { in print_addrs()
466 int len = nh->nlmsg_len; in print_addrs()
468 if (nh->nlmsg_type == NLMSG_DONE) in print_addrs()
470 if (nh->nlmsg_type == NLMSG_ERROR) in print_addrs()
471 nl_error(nh); in print_addrs()
472 if (nh->nlmsg_type != pm_family) in print_addrs()
476 attrs = (struct rtattr *) ((char *) NLMSG_DATA(nh) + in print_addrs()
494 struct nlmsghdr *nh; in get_addr() local
500 nh = (void *)data; in get_addr()
524 print_addrs(nh, pm_family, do_nl_req(fd, nh, off, sizeof(data))); in get_addr()
534 struct nlmsghdr *nh; in dump_addrs() local
538 nh = (void *)data; in dump_addrs()
541 nh->nlmsg_flags |= NLM_F_DUMP; in dump_addrs()
542 nh->nlmsg_seq = 1; in dump_addrs()
543 nh->nlmsg_pid = pid; in dump_addrs()
544 nh->nlmsg_len = off; in dump_addrs()
546 print_addrs(nh, pm_family, do_nl_req(fd, nh, off, sizeof(data))); in dump_addrs()
555 struct nlmsghdr *nh; in flush_addrs() local
559 nh = (void *)data; in flush_addrs()
563 do_nl_req(fd, nh, off, 0); in flush_addrs()
567 static void print_limits(struct nlmsghdr *nh, int pm_family, int total_len) in print_limits() argument
572 for (; NLMSG_OK(nh, total_len); nh = NLMSG_NEXT(nh, total_len)) { in print_limits()
573 int len = nh->nlmsg_len; in print_limits()
575 if (nh->nlmsg_type == NLMSG_DONE) in print_limits()
577 if (nh->nlmsg_type == NLMSG_ERROR) in print_limits()
578 nl_error(nh); in print_limits()
579 if (nh->nlmsg_type != pm_family) in print_limits()
583 attrs = (struct rtattr *) ((char *) NLMSG_DATA(nh) + in print_limits()
609 struct nlmsghdr *nh; in get_set_limits() local
622 nh = (void *)data; in get_set_limits()
644 len = do_nl_req(fd, nh, off, len); in get_set_limits()
646 print_limits(nh, pm_family, len); in get_set_limits()
656 struct nlmsghdr *nh; in set_flags() local
664 nh = (void *)data; in set_flags()
728 do_nl_req(fd, nh, off, 0); in set_flags()