import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.datastoreutils.AsyncDataTreeChangeListenerBase;
import org.opendaylight.genius.mdsalutil.ActionInfo;
import org.opendaylight.genius.mdsalutil.ActionType;
import org.opendaylight.genius.mdsalutil.InstructionType;
import org.opendaylight.genius.mdsalutil.MDSALUtil;
import org.opendaylight.genius.mdsalutil.MatchInfo;
+import org.opendaylight.genius.mdsalutil.NwConstants;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
-import org.opendaylight.netvirt.aclservice.AclServiceUtils;
import org.opendaylight.netvirt.aclservice.utils.AclConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
private static final Logger LOG = LoggerFactory.getLogger(AclNodeListener.class);
/** The mdsal manager. */
- private IMdsalApiManager mdsalManager;
+ private final IMdsalApiManager mdsalManager;
+
+ /** The data broker. */
+ private final DataBroker dataBroker;
/**
* Instantiates a new acl node listener.
*
* @param mdsalManager the mdsal manager
*/
- public AclNodeListener(final IMdsalApiManager mdsalManager) {
+ public AclNodeListener(final IMdsalApiManager mdsalManager, DataBroker dataBroker) {
super(FlowCapableNode.class, AclNodeListener.class);
this.mdsalManager = mdsalManager;
+ this.dataBroker = dataBroker;
+ }
+
+ public void start() {
+ registerListener(LogicalDatastoreType.OPERATIONAL, dataBroker);
}
/*
actionsInfos.add(new ActionInfo(ActionType.drop_action, new String[] {}));
mkInstructions.add(new InstructionInfo(InstructionType.apply_actions, actionsInfos));
- FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, AclConstants.INGRESS_ACL_TABLE_ID,
- getTableMissFlowId(AclConstants.INGRESS_ACL_TABLE_ID), 0, "Ingress ACL Table Miss Flow", 0, 0,
- AclServiceUtils.COOKIE_ACL_BASE, mkMatches, mkInstructions);
+ FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.INGRESS_ACL_TABLE_ID,
+ getTableMissFlowId(NwConstants.INGRESS_ACL_TABLE_ID), 0, "Ingress ACL Table Miss Flow", 0, 0,
+ AclConstants.COOKIE_ACL_BASE, mkMatches, mkInstructions);
mdsalManager.installFlow(flowEntity);
- FlowEntity nextTblFlowEntity = MDSALUtil.buildFlowEntity(dpId, AclConstants.INGRESS_ACL_NEXT_TABLE_ID,
- getTableMissFlowId(AclConstants.INGRESS_ACL_NEXT_TABLE_ID), 0, "Ingress ACL Table Miss Flow", 0, 0,
- AclServiceUtils.COOKIE_ACL_BASE, mkMatches, mkInstructions);
+ FlowEntity nextTblFlowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.INGRESS_ACL_NEXT_TABLE_ID,
+ getTableMissFlowId(NwConstants.INGRESS_ACL_NEXT_TABLE_ID), 0, "Ingress ACL Filter Table Miss Flow",
+ 0, 0, AclConstants.COOKIE_ACL_BASE, mkMatches, mkInstructions);
mdsalManager.installFlow(nextTblFlowEntity);
LOG.debug("Added Ingress ACL Table Miss Flows for dpn {}", dpId);
actionsInfos.add(new ActionInfo(ActionType.drop_action, new String[] {}));
mkInstructions.add(new InstructionInfo(InstructionType.apply_actions, actionsInfos));
- FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, AclConstants.EGRESS_ACL_TABLE_ID,
- getTableMissFlowId(AclConstants.EGRESS_ACL_TABLE_ID), 0, "Egress ACL Table Miss Flow", 0, 0,
- AclServiceUtils.COOKIE_ACL_BASE, mkMatches, mkInstructions);
+ FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.EGRESS_ACL_TABLE_ID,
+ getTableMissFlowId(NwConstants.EGRESS_ACL_TABLE_ID), 0, "Egress ACL Table Miss Flow", 0, 0,
+ AclConstants.COOKIE_ACL_BASE, mkMatches, mkInstructions);
mdsalManager.installFlow(flowEntity);
- FlowEntity nextTblFlowEntity = MDSALUtil.buildFlowEntity(dpId, AclConstants.EGRESS_ACL_NEXT_TABLE_ID,
- getTableMissFlowId(AclConstants.EGRESS_ACL_NEXT_TABLE_ID), 0, "Egress ACL Table Miss Flow", 0, 0,
- AclServiceUtils.COOKIE_ACL_BASE, mkMatches, mkInstructions);
+ FlowEntity nextTblFlowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.EGRESS_ACL_NEXT_TABLE_ID,
+ getTableMissFlowId(NwConstants.EGRESS_ACL_NEXT_TABLE_ID), 0, "Egress ACL Table Miss Flow", 0, 0,
+ AclConstants.COOKIE_ACL_BASE, mkMatches, mkInstructions);
mdsalManager.installFlow(nextTblFlowEntity);
LOG.debug("Added Egress ACL Table Miss Flows for dpn {}", dpId);