Lines Matching full:req
73 test_print("req buf is too small: %zu < %zu", req_sz, nl_size); in rtattr_pack()
142 } req; in __add_veth() local
146 memset(&req, 0, sizeof(req)); in __add_veth()
147 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info)); in __add_veth()
148 req.nh.nlmsg_type = RTM_NEWLINK; in __add_veth()
149 req.nh.nlmsg_flags = flags; in __add_veth()
150 req.nh.nlmsg_seq = seq; in __add_veth()
151 req.info.ifi_family = AF_UNSPEC; in __add_veth()
152 req.info.ifi_change = 0xFFFFFFFF; in __add_veth()
154 if (rtattr_pack(&req.nh, sizeof(req), IFLA_IFNAME, name, strlen(name))) in __add_veth()
157 if (rtattr_pack(&req.nh, sizeof(req), IFLA_NET_NS_FD, &ns_a, sizeof(ns_a))) in __add_veth()
160 link_info = rtattr_begin(&req.nh, sizeof(req), IFLA_LINKINFO); in __add_veth()
164 if (rtattr_pack(&req.nh, sizeof(req), IFLA_INFO_KIND, veth_type, sizeof(veth_type))) in __add_veth()
167 info_data = rtattr_begin(&req.nh, sizeof(req), IFLA_INFO_DATA); in __add_veth()
171 if (veth_pack_peerb(&req.nh, sizeof(req), name, ns_b)) in __add_veth()
174 rtattr_end(&req.nh, info_data); in __add_veth()
175 rtattr_end(&req.nh, link_info); in __add_veth()
177 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in __add_veth()
205 } req; in __ip_addr_add() local
209 memset(&req, 0, sizeof(req)); in __ip_addr_add()
210 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info)); in __ip_addr_add()
211 req.nh.nlmsg_type = RTM_NEWADDR; in __ip_addr_add()
212 req.nh.nlmsg_flags = flags; in __ip_addr_add()
213 req.nh.nlmsg_seq = seq; in __ip_addr_add()
214 req.info.ifa_family = family; in __ip_addr_add()
215 req.info.ifa_prefixlen = prefix; in __ip_addr_add()
216 req.info.ifa_index = if_nametoindex(intf); in __ip_addr_add()
217 req.info.ifa_flags = IFA_F_NODAD; in __ip_addr_add()
219 if (rtattr_pack(&req.nh, sizeof(req), IFA_LOCAL, &addr, addr_len)) in __ip_addr_add()
222 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in __ip_addr_add()
252 } req; in __ip_route_add() local
257 memset(&req, 0, sizeof(req)); in __ip_route_add()
258 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.rt)); in __ip_route_add()
259 req.nh.nlmsg_type = RTM_NEWROUTE; in __ip_route_add()
260 req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE; in __ip_route_add()
261 req.nh.nlmsg_seq = seq; in __ip_route_add()
262 req.rt.rtm_family = family; in __ip_route_add()
263 req.rt.rtm_dst_len = (family == AF_INET) ? 32 : 128; in __ip_route_add()
264 req.rt.rtm_table = vrf; in __ip_route_add()
265 req.rt.rtm_protocol = RTPROT_BOOT; in __ip_route_add()
266 req.rt.rtm_scope = RT_SCOPE_UNIVERSE; in __ip_route_add()
267 req.rt.rtm_type = RTN_UNICAST; in __ip_route_add()
269 if (rtattr_pack(&req.nh, sizeof(req), RTA_DST, &dst, addr_len)) in __ip_route_add()
272 if (rtattr_pack(&req.nh, sizeof(req), RTA_PREFSRC, &src, addr_len)) in __ip_route_add()
275 if (rtattr_pack(&req.nh, sizeof(req), RTA_OIF, &index, sizeof(index))) in __ip_route_add()
278 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in __ip_route_add()
314 } req; in __link_set_up() local
316 memset(&req, 0, sizeof(req)); in __link_set_up()
317 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info)); in __link_set_up()
318 req.nh.nlmsg_type = RTM_NEWLINK; in __link_set_up()
319 req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; in __link_set_up()
320 req.nh.nlmsg_seq = seq; in __link_set_up()
321 req.info.ifi_family = AF_UNSPEC; in __link_set_up()
322 req.info.ifi_change = 0xFFFFFFFF; in __link_set_up()
323 req.info.ifi_index = if_nametoindex(intf); in __link_set_up()
324 req.info.ifi_flags = IFF_UP; in __link_set_up()
325 req.info.ifi_change = IFF_UP; in __link_set_up()
327 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in __link_set_up()
356 } req; in __add_vrf() local
360 memset(&req, 0, sizeof(req)); in __add_vrf()
361 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info)); in __add_vrf()
362 req.nh.nlmsg_type = RTM_NEWLINK; in __add_vrf()
363 req.nh.nlmsg_flags = flags; in __add_vrf()
364 req.nh.nlmsg_seq = seq; in __add_vrf()
365 req.info.ifi_family = AF_UNSPEC; in __add_vrf()
366 req.info.ifi_change = 0xFFFFFFFF; in __add_vrf()
367 req.info.ifi_index = ifindex; in __add_vrf()
369 if (rtattr_pack(&req.nh, sizeof(req), IFLA_IFNAME, name, strlen(name))) in __add_vrf()
373 if (rtattr_pack(&req.nh, sizeof(req), IFLA_NET_NS_FD, in __add_vrf()
377 link_info = rtattr_begin(&req.nh, sizeof(req), IFLA_LINKINFO); in __add_vrf()
381 if (rtattr_pack(&req.nh, sizeof(req), IFLA_INFO_KIND, vrf_type, sizeof(vrf_type))) in __add_vrf()
384 info_data = rtattr_begin(&req.nh, sizeof(req), IFLA_INFO_DATA); in __add_vrf()
388 if (rtattr_pack(&req.nh, sizeof(req), IFLA_VRF_TABLE, in __add_vrf()
392 rtattr_end(&req.nh, info_data); in __add_vrf()
393 rtattr_end(&req.nh, link_info); in __add_vrf()
395 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in __add_vrf()