use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.AccessListEntries in project netvirt by opendaylight.
the class AbstractAclServiceImpl method programAclRules.
/**
* Programs the acl custom rules.
*
* @param port acl interface
* @param aclUuidList the list of acl uuid to be applied
* @param addOrRemove whether to delete or add flow
* @return program succeeded
*/
protected boolean programAclRules(AclInterface port, List<Uuid> aclUuidList, int addOrRemove) {
BigInteger dpId = port.getDpId();
LOG.debug("Applying custom rules on DpId {}, lportTag {}", dpId, port.getLPortTag());
if (aclUuidList == null || dpId == null) {
LOG.warn("{} ACL parameters can not be null. dpId={}, aclUuidList={}", this.directionString, dpId, aclUuidList);
return false;
}
for (Uuid aclUuid : aclUuidList) {
Acl acl = this.aclDataUtil.getAcl(aclUuid.getValue());
if (null == acl) {
LOG.warn("The ACL {} not found in cache", aclUuid.getValue());
continue;
}
AccessListEntries accessListEntries = acl.getAccessListEntries();
List<Ace> aceList = accessListEntries.getAce();
for (Ace ace : aceList) {
programAceRule(port, aclUuid.getValue(), ace, addOrRemove);
}
}
return true;
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.AccessListEntries in project netvirt by opendaylight.
the class AclServiceUtils method getRemoteAclIdsByDirection.
public static Set<Uuid> getRemoteAclIdsByDirection(Acl acl, Class<? extends DirectionBase> direction) {
Set<Uuid> remoteAclIds = new HashSet<>();
AccessListEntries accessListEntries = acl.getAccessListEntries();
if (accessListEntries != null && accessListEntries.getAce() != null) {
for (Ace ace : accessListEntries.getAce()) {
SecurityRuleAttr aceAttr = AclServiceUtils.getAccesssListAttributes(ace);
if (aceAttr.getDirection().equals(direction) && doesAceHaveRemoteGroupId(aceAttr)) {
remoteAclIds.add(aceAttr.getRemoteGroupId());
}
}
}
return remoteAclIds;
}
Aggregations