Lines Matching full:nh
53 struct nlmsghdr *nh = (void *)data; in init_genl_req() local
57 nh->nlmsg_type = family; in init_genl_req()
58 nh->nlmsg_flags = NLM_F_REQUEST; in init_genl_req()
59 nh->nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN); in init_genl_req()
60 off += NLMSG_ALIGN(sizeof(*nh)); in init_genl_req()
69 static void nl_error(struct nlmsghdr *nh) in nl_error() argument
71 struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(nh); in nl_error()
72 int len = nh->nlmsg_len - sizeof(*nh); in nl_error()
81 struct rtattr *attrs = (struct rtattr *)NLMSG_DATA(nh); in nl_error()
105 struct nlmsghdr *nh; in capture_events() local
130 nh = (struct nlmsghdr *)buffer; in capture_events()
132 for (; NLMSG_OK(nh, res_len); nh = NLMSG_NEXT(nh, res_len)) { in capture_events()
133 if (nh->nlmsg_type == NLMSG_ERROR) in capture_events()
136 ghdr = (struct genlmsghdr *)NLMSG_DATA(nh); in capture_events()
143 msg_len = nh->nlmsg_len - NLMSG_LENGTH(GENL_HDRLEN); in capture_events()
202 static int do_nl_req(int fd, struct nlmsghdr *nh, int len, int max) in do_nl_req() argument
206 void *data = nh; in do_nl_req()
210 nh->nlmsg_len = len; in do_nl_req()
223 for (; NLMSG_OK(nh, rem); nh = NLMSG_NEXT(nh, rem)) { in do_nl_req()
224 if (nh->nlmsg_type == NLMSG_ERROR) { in do_nl_req()
225 nl_error(nh); in do_nl_req()
308 struct nlmsghdr *nh; in resolve_mptcp_pm_netlink() local
314 nh = (void *)data; in resolve_mptcp_pm_netlink()
324 do_nl_req(fd, nh, off, sizeof(data)); in resolve_mptcp_pm_netlink()
335 struct nlmsghdr *nh; in dsf() local
346 nh = (void *)data; in dsf()
435 do_nl_req(fd, nh, off, 0); in dsf()
446 struct nlmsghdr *nh; in csf() local
460 nh = (void *)data; in csf()
561 do_nl_req(fd, nh, off, 0); in csf()
571 struct nlmsghdr *nh; in remove_addr() local
579 nh = (void *)data; in remove_addr()
611 do_nl_req(fd, nh, off, 0); in remove_addr()
624 struct nlmsghdr *nh; in announce_addr() local
631 nh = (void *)data; in announce_addr()
737 do_nl_req(fd, nh, off, 0); in announce_addr()
748 struct nlmsghdr *nh; in add_addr() local
757 nh = (void *)data; in add_addr()
869 do_nl_req(fd, nh, off, 0); in add_addr()
879 struct nlmsghdr *nh; in del_addr() local
886 nh = (void *)data; in del_addr()
937 do_nl_req(fd, nh, off, 0); in del_addr()
1037 static void print_addrs(struct nlmsghdr *nh, int pm_family, int total_len) in print_addrs() argument
1041 for (; NLMSG_OK(nh, total_len); nh = NLMSG_NEXT(nh, total_len)) { in print_addrs()
1042 int len = nh->nlmsg_len; in print_addrs()
1044 if (nh->nlmsg_type == NLMSG_DONE) in print_addrs()
1046 if (nh->nlmsg_type == NLMSG_ERROR) in print_addrs()
1047 nl_error(nh); in print_addrs()
1048 if (nh->nlmsg_type != pm_family) in print_addrs()
1052 attrs = (struct rtattr *) ((char *) NLMSG_DATA(nh) + in print_addrs()
1070 struct nlmsghdr *nh; in get_addr() local
1076 nh = (void *)data; in get_addr()
1100 print_addrs(nh, pm_family, do_nl_req(fd, nh, off, sizeof(data))); in get_addr()
1110 struct nlmsghdr *nh; in dump_addrs() local
1114 nh = (void *)data; in dump_addrs()
1117 nh->nlmsg_flags |= NLM_F_DUMP; in dump_addrs()
1118 nh->nlmsg_seq = 1; in dump_addrs()
1119 nh->nlmsg_pid = pid; in dump_addrs()
1120 nh->nlmsg_len = off; in dump_addrs()
1122 print_addrs(nh, pm_family, do_nl_req(fd, nh, off, sizeof(data))); in dump_addrs()
1131 struct nlmsghdr *nh; in flush_addrs() local
1135 nh = (void *)data; in flush_addrs()
1139 do_nl_req(fd, nh, off, 0); in flush_addrs()
1143 static void print_limits(struct nlmsghdr *nh, int pm_family, int total_len) in print_limits() argument
1148 for (; NLMSG_OK(nh, total_len); nh = NLMSG_NEXT(nh, total_len)) { in print_limits()
1149 int len = nh->nlmsg_len; in print_limits()
1151 if (nh->nlmsg_type == NLMSG_DONE) in print_limits()
1153 if (nh->nlmsg_type == NLMSG_ERROR) in print_limits()
1154 nl_error(nh); in print_limits()
1155 if (nh->nlmsg_type != pm_family) in print_limits()
1159 attrs = (struct rtattr *) ((char *) NLMSG_DATA(nh) + in print_limits()
1185 struct nlmsghdr *nh; in get_set_limits() local
1198 nh = (void *)data; in get_set_limits()
1220 len = do_nl_req(fd, nh, off, len); in get_set_limits()
1222 print_limits(nh, pm_family, len); in get_set_limits()
1280 struct nlmsghdr *nh; in set_flags() local
1293 nh = (void *)data; in set_flags()
1456 do_nl_req(fd, nh, off, 0); in set_flags()