import org.opendaylight.genius.mdsalutil.MatchInfoBase;
import org.opendaylight.genius.mdsalutil.NwConstants;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
+import org.opendaylight.genius.utils.ServiceIndex;
import org.opendaylight.netvirt.aclservice.api.AclServiceManager.Action;
import org.opendaylight.netvirt.aclservice.utils.AclConstants;
+import org.opendaylight.netvirt.aclservice.utils.AclDataUtil;
import org.opendaylight.netvirt.aclservice.utils.AclServiceOFFlowBuilder;
import org.opendaylight.netvirt.aclservice.utils.AclServiceUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.Acl;
* @param dataBroker the data broker instance.
* @param mdsalManager the mdsal manager.
*/
- public AbstractIngressAclServiceImpl(DataBroker dataBroker, IMdsalApiManager mdsalManager) {
+ public AbstractIngressAclServiceImpl(DataBroker dataBroker, IMdsalApiManager mdsalManager, AclDataUtil aclDataUtil,
+ AclServiceUtils aclServiceUtils) {
// Service mode is w.rt. switch
- super(ServiceModeEgress.class, dataBroker, mdsalManager);
+ super(ServiceModeEgress.class, dataBroker, mdsalManager, aclDataUtil, aclServiceUtils);
}
/**
List<Instruction> instructions = new ArrayList<>();
instructions.add(MDSALUtil.buildAndGetGotoTableInstruction(NwConstants.EGRESS_ACL_TABLE, ++instructionKey));
BoundServices serviceInfo = AclServiceUtils.getBoundServices(
- String.format("%s.%s.%s", "vpn", "ingressacl", interfaceName), NwConstants.EGRESS_ACL_SERVICE_INDEX,
+ String.format("%s.%s.%s", "vpn", "ingressacl", interfaceName),
+ ServiceIndex.getIndex(NwConstants.EGRESS_ACL_SERVICE_NAME, NwConstants.EGRESS_ACL_SERVICE_INDEX),
flowPriority, AclConstants.COOKIE_ACL_BASE, instructions);
InstanceIdentifier<BoundServices> path = AclServiceUtils.buildServiceId(interfaceName,
- NwConstants.EGRESS_ACL_SERVICE_INDEX, ServiceModeEgress.class);
+ ServiceIndex.getIndex(NwConstants.EGRESS_ACL_SERVICE_NAME,
+ NwConstants.EGRESS_ACL_SERVICE_INDEX), ServiceModeEgress.class);
MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, path, serviceInfo);
}
@Override
protected void unbindService(String interfaceName) {
InstanceIdentifier<BoundServices> path = AclServiceUtils.buildServiceId(interfaceName,
- NwConstants.EGRESS_ACL_SERVICE_INDEX, ServiceModeEgress.class);
+ ServiceIndex.getIndex(NwConstants.EGRESS_ACL_SERVICE_NAME, NwConstants.EGRESS_ACL_SERVICE_INDEX),
+ ServiceModeEgress.class);
MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.CONFIGURATION, path);
}
@Override
protected void programGeneralFixedRules(BigInteger dpid, String dhcpMacAddress,
List<AllowedAddressPairs> allowedAddresses, int lportTag, Action action, int addOrRemove) {
- LOG.info("programFixedRules : adding default rules.");
+ LOG.info("programFixedRules : {} default rules.", action == Action.ADD ? "adding" : "removing");
if (action == Action.ADD || action == Action.REMOVE) {
ingressAclDhcpAllowServerTraffic(dpid, dhcpMacAddress, lportTag, addOrRemove,
if (syncAllowedAddresses != null) {
flowMap = AclServiceUtils.getFlowForAllowedAddresses(syncAllowedAddresses, flowMap, true);
} else if (aceAttr.getRemoteGroupId() != null) {
- flowMap = AclServiceUtils.getFlowForRemoteAcl(aceAttr.getRemoteGroupId(), portId, flowMap,
+ flowMap = aclServiceUtils.getFlowForRemoteAcl(aceAttr.getRemoteGroupId(), portId, flowMap,
true);
}
}