@Override public boolean equals(Object o) { if (this == o) { return true; } if (this instanceof OpenstackSecurityGroupRule) { OpenstackSecurityGroupRule that = (OpenstackSecurityGroupRule) o; return this.direction.equals(that.direction) && this.ethertype.equals(that.ethertype) && this.id.equals(that.id) && this.portRangeMax == that.portRangeMax && this.portRangeMin == that.portRangeMin && this.protocol.equals(that.protocol) && this.remoteGroupId.equals(that.remoteGroupId) && this.secuityGroupId.equals(that.secuityGroupId) && this.remoteIpPrefix.equals(that.remoteIpPrefix) && this.tenantId.equals(that.tenantId); } return false; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (this instanceof OpenstackSecurityGroupRule) { OpenstackSecurityGroupRule that = (OpenstackSecurityGroupRule) o; return this.direction.equals(that.direction) && this.ethertype.equals(that.ethertype) && this.id.equals(that.id) && this.portRangeMax == that.portRangeMax && this.portRangeMin == that.portRangeMin && this.protocol.equals(that.protocol) && this.remoteGroupId.equals(that.remoteGroupId) && this.secuityGroupId.equals(that.secuityGroupId) && this.remoteIpPrefix.equals(that.remoteIpPrefix) && this.tenantId.equals(that.tenantId); } return false; }
ForwardingObjective.Builder buildFlowObjective(DeviceId id, OpenstackSecurityGroupRule sgRule, Ip4Address vmIp, IpPrefix remoteIp) { if (remoteIp != null && remoteIp.equals(IpPrefix.valueOf(vmIp, 32))) { return null; } TrafficSelector.Builder sBuilder = DefaultTrafficSelector.builder(); TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder(); buildMatchs(sBuilder, sgRule, vmIp, remoteIp); ForwardingObjective.Builder foBuilder = DefaultForwardingObjective.builder() .withSelector(sBuilder.build()) .withTreatment(tBuilder.build()) .withPriority(ACL_RULE_PRIORITY) .withFlag(ForwardingObjective.Flag.SPECIFIC) .fromApp(appId); return foBuilder; }