Lines Matching defs:gateway
181 * @gateway: gateway to go via
190 rib_add_redirect(u_int fibnum, struct sockaddr *dst, struct sockaddr *gateway,
208 /* Get the best ifa for the given interface and gateway. */
209 if ((ifa = ifaof_ifpforaddr(gateway, ifp)) == NULL)
216 nhop_set_gw(nh, gateway, flags & RTF_GATEWAY);
239 .rti_info[RTAX_GATEWAY] = gateway,
270 const struct sockaddr *gateway, u_int fibnum)
287 ifa = ifa_ifwithaddr(gateway);
291 * or host, the gateway may still be on the
294 ifa = ifa_ifwithdstaddr(gateway, fibnum);
297 ifa = ifa_ifwithnet(gateway, 0, fibnum);
301 nh = rib_lookup(fibnum, gateway, NHR_NONE, 0);
304 * dismiss a gateway that is reachable only
394 * Calculates proper ifa/ifp for the cases when gateway AF is different
437 const struct sockaddr *dst, *gateway, *ifaaddr;
441 gateway = info->rti_info[RTAX_GATEWAY];
461 (gateway->sa_family != dst->sa_family))
473 * 2) gateway address
474 * Note: for interface routes link-level gateway address
476 * specifying RTF_GATEWAY. In this case, ignore gateway
477 * Note: gateway AF may be different from dst AF. In this case,
478 * ignore gateway
482 * try to lookup gateway or dst in the routing table to get ifa
487 gateway->sa_family == dst->sa_family)
488 sa = gateway;
494 if (info->rti_ifa == NULL && gateway != NULL)
495 info->rti_ifa = ifaof_ifpforaddr(gateway, info->rti_ifp);
496 } else if (dst != NULL && gateway != NULL)
497 info->rti_ifa = ifa_ifwithroute(flags, dst, gateway,