Lines Matching refs:gateway

40  *     implied by the gateway IP address.
41 * <li>a gateway {@link InetAddress} indicating the next hop to use. If this is {@code null} it
45 * Either the destination or the gateway may be {@code null}, but not both. If the
46 * destination and gateway are both specified, they must be of the same address family
56 * The gateway address for this route.
88 * If destination is null, then gateway must be specified and the
90 * if the gateway is an instance of {@link Inet4Address}, or the IPv6 default
91 * route <code>::/0</code> if gateway is an instance of
94 * destination and gateway may not both be null.
97 * @param gateway the IP address to route packets through
102 public RouteInfo(IpPrefix destination, InetAddress gateway, String iface, int type) {
109 // a gateway is specified. This is a bit too complicated to do at the moment
114 // - Even when the gateway is null, we store a non-null gateway here.
123 if (gateway != null) {
124 if (gateway instanceof Inet4Address) {
130 // no destination, no gateway. invalid.
131 throw new IllegalArgumentException("Invalid arguments passed in: " + gateway + "," +
135 // TODO: set mGateway to null if there is no gateway. This is more correct, saves space, and
138 if (gateway == null) {
140 gateway = Inet4Address.ANY;
142 gateway = Inet6Address.ANY;
145 mHasGateway = (!gateway.isAnyLocalAddress());
148 (gateway instanceof Inet4Address == false)) ||
150 (gateway instanceof Inet6Address == false))) {
154 mGateway = gateway; // InetAddress objects are immutable.
163 public RouteInfo(IpPrefix destination, InetAddress gateway, String iface) {
164 this(destination, gateway, iface, RTN_UNICAST);
170 public RouteInfo(LinkAddress destination, InetAddress gateway, String iface) {
173 gateway, iface);
179 * If destination is null, then gateway must be specified and the
181 * if the gateway is an instance of {@link Inet4Address}, or the IPv6 default
182 * route <code>::/0</code> if gateway is an instance of {@link Inet6Address}.
184 * Destination and gateway may not both be null.
187 * @param gateway the {@link InetAddress} to route packets through
191 public RouteInfo(IpPrefix destination, InetAddress gateway) {
192 this(destination, gateway, null);
200 public RouteInfo(LinkAddress destination, InetAddress gateway) {
201 this(destination, gateway, null);
207 * @param gateway the {@link InetAddress} to route packets through
211 public RouteInfo(InetAddress gateway) {
212 this((IpPrefix) null, gateway, null);
251 public static RouteInfo makeHostRoute(InetAddress host, InetAddress gateway, String iface) {
255 return new RouteInfo(new IpPrefix(host, 32), gateway, iface);
257 return new RouteInfo(new IpPrefix(host, 128), gateway, iface);
286 * Retrieves the gateway or next hop {@link InetAddress} for this route.
288 * @return {@link InetAddress} specifying the gateway or next hop. This may be
355 * @return {@code true} if a gateway is specified
480 InetAddress gateway = null;
483 gateway = InetAddress.getByAddress(addr);
489 return new RouteInfo(dest, gateway, iface, type);