Lines Matching defs:gw
47 static struct ip_addr *dst, *gw, *rhost;
130 gw_len = save_item((void **)&gw, g_opt, save_ip);
177 struct sockaddr *dst, struct sockaddr *gw, int type)
181 if (gw)
182 tst_sock_addr(gw, sizeof(gw), gw_str, sizeof(gw_str));
184 tst_res(TINFO, "type: %s, iface: %d, dst: %s, gw: %s",
186 iface, dst_str, gw ? gw_str : "null");
190 static void rtnl_route(int iface, struct addrinfo *dst, struct addrinfo *gw,
219 rtm->rtm_scope = gw ? RT_SCOPE_UNIVERSE : RT_SCOPE_LINK;
232 if (gw) {
234 gw_in6 = ((struct sockaddr_in6 *)gw->ai_addr)->sin6_addr;
237 gw_ip = ((struct sockaddr_in *)gw->ai_addr)->sin_addr.s_addr;
244 brk_on_route_error("mnl_socket_open", iface, dst->ai_addr, gw ?
245 gw->ai_addr : NULL, type);
248 brk_on_route_error("mnl_socket_bind", iface, dst->ai_addr, gw ?
249 gw->ai_addr : NULL, type);
254 brk_on_route_error("mnl_socket_sendto", iface, dst->ai_addr, gw
255 ? gw->ai_addr : NULL, type);
260 gw ? gw->ai_addr : NULL, type);
264 brk_on_route_error("mnl_cb_run", iface, dst->ai_addr, gw ?
265 gw->ai_addr : NULL, type);
284 struct ip_addr *p_dst = dst, *p_gw = gw, *p_rhost = rhost;
288 rtnl_route(p_iface->index, p_dst->ip, gw ? p_gw->ip : NULL,
291 rtnl_route(p_iface->index, p_dst->ip, gw ? p_gw->ip : NULL,
294 if (gw)
295 p_gw = p_gw->next ?: gw;