@Override public boolean containsIp(Ip ip, Map<String, IpSpace> namedIpSpaces) { return _prefix.containsIp(ip); }
public boolean containsPrefix(Prefix prefix) { return containsIp(prefix._ip) && _prefixLength <= prefix._prefixLength; }
@Nullable private Prefix getLongestPrefixMatch(Ip address) { if (_prefix != null && _prefix.containsIp(address)) { return _prefix; } else { return null; } }
public boolean canConnect(@Nonnull Ip address) { return _peerPrefix != null && _peerPrefix.containsIp(address); }
BgpActivePeerConfig n = ns.get(i); Interface iface = ge.getStart(); if (ip != null && iface.getAddress().getPrefix().containsIp(ip)) { _ebgpNeighbors.put(ge, n);
private @Nullable Interface getInterfaceByTunnelAddresses(Ip sourceAddress, Prefix destPrefix) { for (Interface iface : _interfaces.values()) { Tunnel tunnel = iface.getTunnel(); if (tunnel != null && tunnel.getSourceAddress() != null && tunnel.getSourceAddress().equals(sourceAddress) && tunnel.getDestination() != null && destPrefix.containsIp(tunnel.getDestination())) { /* * We found a tunnel interface with the required parameters. Now return the external * interface with this address. */ return _interfaces.values().stream() .filter( i -> i.getAllAddresses().stream().anyMatch(p -> p.getIp().equals(sourceAddress))) .findFirst() .orElse(null); } } return null; }
if (!_prefix.containsIp(address)) { return ImmutableSet.of();
&& remotePrefix.containsIp(candidateLocalIp)) {
vrf.getInterfaces().values().stream() .flatMap(i -> i.getAllAddresses().stream()) .filter(ia -> ia != null && ia.getPrefix().containsIp(prefix.getStartIp())) .map(InterfaceAddress::getIp) .findFirst();
.flatMap(Collection::stream) .filter( iface -> iface.getAllAddresses().stream().anyMatch(ia -> p.containsIp(ia.getIp()))) .forEach(candidateInterfaces::add);
if (!subnet.containsIp(first)) { _w.addWarning( ctx, String.format("Subnet of NAT pool %s does not contain first pool IP", name)); if (!subnet.containsIp(last)) { _w.addWarning( ctx,
if (!localPrimary.getPrefix().containsIp(neighborPrimary.getIp()) || !neighborPrimary.getPrefix().containsIp(localPrimary.getIp()) || localPrimary.getIp().equals(neighborPrimary.getIp())) { continue;
for (org.batfish.datamodel.Interface iface : vrf.getInterfaces().values()) { for (InterfaceAddress interfaceAddress : iface.getAllAddresses()) { if (interfaceAddress.getPrefix().containsIp(neighborAddress)) { Ip ifaceAddress = interfaceAddress.getIp(); updateSource = ifaceAddress;
if (!ifaceSubnet.containsIp(ip)) { warnings.pedantic( String.format(
new TreeSet<>(networkInterface.getIpAddressAssociations().keySet()); Ip lowestIp = networkInterfaceIps.toArray(new Ip[] {})[0]; if (!subnet.getCidrBlock().containsIp(lowestIp)) { throw new BatfishException( "Ip of network interface specified in static route not in containing subnet");