@Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof InterfaceAddress)) { return false; } InterfaceAddress rhs = (InterfaceAddress) o; return _ip.equals(rhs._ip) && _networkBits == rhs._networkBits; }
@Override protected boolean exprEquals(Object o) { return _ip.equals(((IpIpSpace) o)._ip); }
@Override public boolean containsIp(Ip ip, Map<String, IpSpace> namedIpSpaces) { return _ip.equals(ip); }
@Override public boolean equals(@Nullable Object o) { if (o == this) { return true; } else if (!(o instanceof Prefix)) { return false; } Prefix rhs = (Prefix) o; return _ip.equals(rhs._ip) && _prefixLength == rhs._prefixLength; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof OspfNode)) { return false; } OspfNode rhs = (OspfNode) o; return _node.equals(rhs._node) && _interfaceName.equals(rhs._interfaceName) && _localIp.equals(rhs._localIp); }
@Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof VxlanNode)) { return false; } VxlanNode rhs = (VxlanNode) obj; return _hostname.equals(rhs._hostname) && _sourceAddress.equals(rhs._sourceAddress) && _vlan == rhs._vlan && _vrf.equals(rhs._vrf); }
@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); }
private static boolean bgpConfigPassesSanityChecks( BgpPeerConfig config, String hostname, Map<Ip, Set<String>> ipOwners) { /* * Do these checks as a short-circuit to avoid extra reachability checks when building * BGP topology. * Only keep invalid neighbors that don't have local IPs if specifically requested to. * Note: we use Ip.AUTO to denote the listening end of a dynamic peering. */ Ip localAddress = config.getLocalIp(); return (localAddress != null && ipOwners.containsKey(localAddress) && ipOwners.get(localAddress).contains(hostname)) || Ip.AUTO.equals(localAddress); }
@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); }
@Nullable private static Transformation sessionTransformation(Flow inputFlow, Flow currentFlow) { ImmutableList.Builder<TransformationStep> transformationStepsBuilder = ImmutableList.builder(); Ip origDstIp = inputFlow.getDstIp(); if (!origDstIp.equals(currentFlow.getDstIp())) { transformationStepsBuilder.add(assignSourceIp(origDstIp, origDstIp)); } Ip origSrcIp = inputFlow.getSrcIp(); if (!origSrcIp.equals(currentFlow.getSrcIp())) { transformationStepsBuilder.add(TransformationStep.assignDestinationIp(origSrcIp, origSrcIp)); } List<TransformationStep> transformationSteps = transformationStepsBuilder.build(); return transformationSteps.isEmpty() ? null : always().apply(transformationSteps).build(); }
@JsonValue @Override public String toString() { if (_second.equals(Ip.ZERO)) { return _first.toString(); } else if (isPrefix()) { return toPrefix().toString(); } else { return _first + ":" + _second; } } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof PermittedByNamedIpSpace)) { return false; } PermittedByNamedIpSpace rhs = (PermittedByNamedIpSpace) obj; return getDescription().equals(rhs.getDescription()) && getIp().equals(rhs.getIp()) && getIpDescription().equals(rhs.getIpDescription()) && _name.equals(rhs._name); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DefaultDeniedByAclIpSpace)) { return false; } DefaultDeniedByAclIpSpace rhs = (DefaultDeniedByAclIpSpace) obj; return getDescription().equals(rhs.getDescription()) && getIp().equals(rhs.getIp()) && getIpDescription().equals(rhs.getIpDescription()) && _name.equals(rhs._name); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DeniedByNamedIpSpace)) { return false; } DeniedByNamedIpSpace rhs = (DeniedByNamedIpSpace) obj; return getDescription().equals(rhs.getDescription()) && getIp().equals(rhs.getIp()) && getIpDescription().equals(rhs.getIpDescription()) && _name.equals(rhs._name); }
@Override public boolean equals(Object o) { if (o == this) { return true; } else if (!(o instanceof OspfInterAreaRoute)) { return false; } OspfInterAreaRoute other = (OspfInterAreaRoute) o; return Objects.equals(_network, other._network) && _admin == other._admin && getNonRouting() == other.getNonRouting() && getNonForwarding() == other.getNonForwarding() && _area == other._area && _metric == other._metric && _nextHopIp.equals(other._nextHopIp); }
/** Returns {@code true} if any {@link Ip IP address} is owned by both devices. */ private static boolean haveIpInCommon(Interface i1, Interface i2) { for (InterfaceAddress ia : i1.getAllAddresses()) { for (InterfaceAddress ia2 : i2.getAllAddresses()) { if (ia.getIp().equals(ia2.getIp())) { return true; } } } return false; }
private Boolean set(TransformationType type, IpField ipField, Ip oldValue, Ip newValue) { if (oldValue.equals(newValue)) { getFlowDiffs(type); return false; } else { set(ipField, newValue); getFlowDiffs(type).add(flowDiff(ipField, oldValue, newValue)); return true; } }
private static EraseAndSet assignIpFromPool(BDDInteger var, Ip poolStart, Ip poolEnd) { BDD erase = Arrays.stream(var.getBitvec()).reduce(var.getFactory().one(), BDD::and); BDD setValue = poolStart.equals(poolEnd) ? var.value(poolStart.asLong()) : var.geq(poolStart.asLong()).and(var.leq(poolEnd.asLong())); return new EraseAndSet(erase, setValue); }