public SecurityRuleAttrBuilder(SecurityRuleAttr base) { this._direction = base.getDirection(); this._remoteGroupId = base.getRemoteGroupId(); }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (!(obj instanceof DataObject)) { return false; } if (!org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.SecurityRuleAttr.class.equals(((DataObject)obj).getImplementedInterface())) { return false; } org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.SecurityRuleAttr other = (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.SecurityRuleAttr)obj; if (!Objects.equals(_direction, other.getDirection())) { return false; } if (!Objects.equals(_remoteGroupId, other.getRemoteGroupId())) { return false; } return true; }
List<AllowedAddressPairs> syncAllowedAddresses) { SecurityRuleAttr aceAttr = AclServiceUtils.getAccesssListAttributes(ace); if (!aceAttr.getDirection().equals(DirectionIngress.class)) { return;
List<AllowedAddressPairs> syncAllowedAddresses) { SecurityRuleAttr aceAttr = AclServiceUtils.getAccesssListAttributes(ace); if (!aceAttr.getDirection().equals(DirectionEgress.class)) { return;
@Override protected void programAceRule(BigInteger dpId, int lportTag, int addOrRemove, Ace ace, String portId, List<AllowedAddressPairs> syncAllowedAddresses) { SecurityRuleAttr aceAttr = AclServiceUtils.getAccesssListAttributes(ace); if (!aceAttr.getDirection().equals(DirectionIngress.class)) { return; } Matches matches = ace.getMatches(); AceType aceType = matches.getAceType(); Map<String,List<MatchInfoBase>> flowMap = null; if (aceType instanceof AceIp) { flowMap = AclServiceOFFlowBuilder.programIpFlow(matches); if (syncAllowedAddresses != null) { flowMap = AclServiceUtils.getFlowForAllowedAddresses(syncAllowedAddresses, flowMap, true); } else if (aceAttr.getRemoteGroupId() != null) { flowMap = AclServiceUtils.getFlowForRemoteAcl(aceAttr.getRemoteGroupId(), portId, flowMap, true); } } if (null == flowMap) { LOG.error("Failed to apply ACL {} lportTag {}", ace.getKey(), lportTag); return; } for ( String flowName : flowMap.keySet()) { flowName = syncSpecificAclFlow(dpId, lportTag, addOrRemove, ace, portId, flowMap, flowName); } }
@Override protected void programAceRule(BigInteger dpId, int lportTag, int addOrRemove, Ace ace, String portId, List<AllowedAddressPairs> syncAllowedAddresses) { SecurityRuleAttr aceAttr = AclServiceUtils.getAccesssListAttributes(ace); if (!aceAttr.getDirection().equals(DirectionEgress.class)) { return; } Matches matches = ace.getMatches(); AceType aceType = matches.getAceType(); Map<String,List<MatchInfoBase>> flowMap = null; if (aceType instanceof AceIp) { flowMap = AclServiceOFFlowBuilder.programIpFlow(matches); if (syncAllowedAddresses != null) { flowMap = AclServiceUtils.getFlowForAllowedAddresses(syncAllowedAddresses, flowMap, false); } else if (aceAttr.getRemoteGroupId() != null) { flowMap = AclServiceUtils.getFlowForRemoteAcl(aceAttr.getRemoteGroupId(), portId, flowMap, false); } } if (null == flowMap) { LOG.error("Failed to apply ACL {} lportTag {}", ace.getKey(), lportTag); return; } //The flow map contains list of flows if port range is selected. for ( String flowName : flowMap.keySet()) { flowName = syncSpecificAclFlow(dpId, lportTag, addOrRemove, ace, portId, flowMap, flowName); } }