if (deletedSubnets != null && !deletedSubnets.isEmpty()) {
programIcmpv6RARule(deleteFlowEntries, portAfter, deletedSubnets, NwConstants.DEL_FLOW);
+ programSubnetBroadcastRules(deleteFlowEntries, portAfter, deletedSubnets, NwConstants.DEL_FLOW);
}
if (addedSubnets != null && !addedSubnets.isEmpty()) {
programIcmpv6RARule(addFlowEntries, portAfter, addedSubnets, NwConstants.ADD_FLOW);
+ programSubnetBroadcastRules(addFlowEntries, portAfter, addedSubnets, NwConstants.ADD_FLOW);
}
}
*/
protected abstract void programBroadcastRules(List<FlowEntity> flowEntries, AclInterface port, int addOrRemove);
+ /**
+ * Programs broadcast rules.
+ *
+ * @param flowEntries the flow entries
+ * @param port the Acl Interface port
+ * @param subnetInfoList the port subnet info list
+ * @param addOrRemove whether to delete or add flow
+ */
+ protected abstract void programSubnetBroadcastRules(List<FlowEntity> flowEntries, AclInterface port,
+ List<SubnetInfo> subnetInfoList, int addOrRemove);
+
protected abstract void programIcmpv6RARule(List<FlowEntity> flowEntries, AclInterface port,
List<SubnetInfo> subnets, int addOrRemove);
AclServiceUtils.excludeMulticastAAPs(port.getAllowedAddressPairs()), addOrRemove);
}
+ /**
+ * Programs broadcast rules.
+ *
+ * @param flowEntries the flow entries
+ * @param port the Acl Interface port
+ * @param subnetInfoList the port subnet info list
+ * @param addOrRemove whether to delete or add flow
+ */
+ protected void programSubnetBroadcastRules(List<FlowEntity> flowEntries, AclInterface port,
+ List<SubnetInfo> subnetInfoList, int addOrRemove) {
+ // No action required on egress.
+ }
+
/**
* Programs Non-IP broadcast rules.
*
programIcmpv6RARule(flowEntries, port, port.getSubnetInfo(), addOrRemove);
programArpRule(flowEntries, dpid, lportTag, addOrRemove);
- programIpv4BroadcastRule(flowEntries, port, addOrRemove);
+ programIpv4BroadcastRule(flowEntries, port, port.getSubnetInfo(), addOrRemove);
}
}
*/
@Override
protected void programBroadcastRules(List<FlowEntity> flowEntries, AclInterface port, int addOrRemove) {
- programIpv4BroadcastRule(flowEntries, port, addOrRemove);
+ programIpv4BroadcastRule(flowEntries, port, port.getSubnetInfo(), addOrRemove);
+ }
+
+ /**
+ * Programs broadcast rules.
+ *
+ * @param flowEntries the flow entries
+ * @param port the Acl Interface port
+ * @param subnetInfoList the port subnet info list
+ * @param addOrRemove whether to delete or add flow
+ */
+ protected void programSubnetBroadcastRules(List<FlowEntity> flowEntries, AclInterface port,
+ List<SubnetInfo> subnetInfoList, int addOrRemove) {
+ programIpv4BroadcastRule(flowEntries, port, subnetInfoList, addOrRemove);
}
/**
*
* @param flowEntries the flow entries
* @param port the Acl Interface port
+ * @param subnetInfoList Port subnet list
* @param addOrRemove whether to delete or add flow
*/
- private void programIpv4BroadcastRule(List<FlowEntity> flowEntries, AclInterface port, int addOrRemove) {
+ private void programIpv4BroadcastRule(List<FlowEntity> flowEntries, AclInterface port,
+ List<SubnetInfo> subnetInfoList, int addOrRemove) {
BigInteger dpId = port.getDpId();
int lportTag = port.getLPortTag();
MatchInfoBase lportMatchInfo = AclServiceUtils.buildLPortTagMatch(lportTag, serviceMode);
- List<SubnetInfo> subnetInfoList = port.getSubnetInfo();
if (subnetInfoList != null) {
List<String> broadcastAddresses = AclServiceUtils.getIpBroadcastAddresses(subnetInfoList);
for (String broadcastAddress : broadcastAddresses) {