@Override public boolean equals(Object o) { if (this == o) { return true; } else if (!(o instanceof Route4FilterLineUpTo)) { return false; } Route4FilterLineUpTo rhs = (Route4FilterLineUpTo) o; return _prefix.equals(rhs._prefix) && _maxPrefixLength == rhs._maxPrefixLength; }
@Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof BgpAggregateIpv4Network)) { return false; } BgpAggregateIpv4Network rhs = (BgpAggregateIpv4Network) o; return _prefix.equals(rhs._prefix); }
@Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof OspfNetwork)) { return false; } OspfNetwork rhs = (OspfNetwork) o; return _prefix.equals(rhs._prefix) && _area == rhs._area; }
@Override public boolean equals(Object o) { if (this == o) { return true; } else if (!(o instanceof Route4FilterLineOrLonger)) { return false; } Route4FilterLineOrLonger rhs = (Route4FilterLineOrLonger) o; return _prefix.equals(rhs._prefix); }
@Override public boolean equals(Object o) { if (this == o) { return true; } else if (!(o instanceof Route4FilterLineExact)) { return false; } Route4FilterLineExact rhs = (Route4FilterLineExact) o; return _prefix.equals(rhs._prefix); }
@Override public boolean equals(Object o) { if (this == o) { return true; } else if (!(o instanceof Route4FilterLineLonger)) { return false; } Route4FilterLineLonger rhs = (Route4FilterLineLonger) o; return _prefix.equals(rhs._prefix); }
@Override public boolean equals(Object o) { if (this == o) { return true; } else if (!(o instanceof Route4FilterLineLengthRange)) { return false; } Route4FilterLineLengthRange rhs = (Route4FilterLineLengthRange) o; return _prefix.equals(rhs._prefix) && _minPrefixLength == rhs._minPrefixLength && _maxPrefixLength == rhs._maxPrefixLength; }
@Override protected boolean exprEquals(Object o) { return _prefix.equals(((PrefixIpSpace) o)._prefix); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } else if (!(obj instanceof PrefixRange)) { return false; } PrefixRange o = (PrefixRange) obj; return _prefix.equals(o._prefix) && _lengthRange.equals(o._lengthRange); }
@Override public boolean equals(Object o) { if (this == o) { return true; } else if (!(o instanceof Route4FilterLineAddressMask)) { return false; } Route4FilterLineAddressMask rhs = (Route4FilterLineAddressMask) o; return _prefix.equals(rhs._prefix) && _addressMask.equals(rhs._addressMask); }
@Override public IpSpace visitPrefixIpSpace(PrefixIpSpace prefixIpSpace) { if (prefixIpSpace.getPrefix().equals(Prefix.ZERO)) { return UniverseIpSpace.INSTANCE; } return prefixIpSpace; }
@Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (!(o instanceof RipRoute)) { return false; } RipRoute other = (RipRoute) o; return _network.equals(other._network) && _admin == other._admin && _metric == other._metric && _nextHopIp.equals(other._nextHopIp); }
@Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof StaticRoute)) { return false; } StaticRoute rhs = (StaticRoute) o; boolean res = _prefix.equals(rhs._prefix); if (_nextHopIp != null) { res = res && _nextHopIp.equals(rhs._nextHopIp); } else { res = res && rhs._nextHopIp == null; } if (_nextHopInterface != null) { return res && _nextHopInterface.equals(rhs._nextHopInterface); } else { return res && rhs._nextHopInterface == null; } }
public final Set<R> getRoutes(Prefix p) { // Collect routes that match the prefix return getRoutes().stream() .filter(r -> r.getNetwork().equals(p)) .collect(ImmutableSet.toImmutableSet()); }
return false; if (!_network.equals(other._network)) { return false;
@Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof ConnectedRoute)) { return false; } ConnectedRoute rhs = (ConnectedRoute) o; return _network.equals(rhs._network) && _admin == rhs._admin && getNonRouting() == rhs.getNonRouting() && getNonForwarding() == rhs.getNonForwarding() && _nextHopInterface.equals(rhs._nextHopInterface); }
@Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof LocalRoute)) { return false; } LocalRoute rhs = (LocalRoute) o; return _network.equals(rhs._network) && _admin == rhs._admin && getNonRouting() == rhs.getNonRouting() && getNonForwarding() == rhs.getNonForwarding() && _nextHopInterface.equals(rhs._nextHopInterface) && _sourcePrefixLength == rhs._sourcePrefixLength; }
/** * Check if a static route with next hop IP can be activated. If this method returns True, an * attempt should be made to merge it into the RIB. If it returns false, an attempt should be made * to remove it from the RIB. * * @param route a {@link StaticRoute} to check * @param rib the RIB to use for establishing routabilitity to next hop IP */ public static boolean shouldActivateNextHopIpRoute( @Nonnull StaticRoute route, @Nonnull GenericRib<AbstractRoute> rib) { Set<AbstractRoute> matchingRoutes = rib.longestPrefixMatch(route.getNextHopIp()); if (matchingRoutes.isEmpty()) { // Cannot activate, next hop ip is unreachable return false; } boolean shouldActivate = false; for (AbstractRoute routeToNextHop : matchingRoutes) { if (!routeToNextHop.getNetwork().equals(route.getNetwork()) || route.equals(routeToNextHop)) { // Next hop has to be reachable through a route with a different prefix shouldActivate = true; break; } } return shouldActivate; } }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof IsisRoute)) { return false; } IsisRoute rhs = (IsisRoute) o; return _admin == rhs._admin && _area.equals(rhs._area) && _attach == rhs._attach && _down == rhs._down && _level == rhs._level && _metric == rhs._metric && _network.equals(rhs._network) && _nextHopIp.equals(rhs._nextHopIp) && getNonForwarding() == rhs.getNonForwarding() && getNonRouting() == rhs.getNonRouting() && _overload == rhs._overload && _protocol == rhs._protocol && _systemId.equals(rhs._systemId); }