2 * Copyright (c) 2016 HPE, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.netvirt.aclservice;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.math.BigInteger;
12 import java.util.ArrayList;
13 import java.util.Collections;
14 import java.util.List;
17 import java.util.stream.Collectors;
18 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
19 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
20 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
21 import org.opendaylight.genius.datastoreutils.DataStoreJobCoordinator;
22 import org.opendaylight.genius.mdsalutil.ActionInfo;
23 import org.opendaylight.genius.mdsalutil.InstructionInfo;
24 import org.opendaylight.genius.mdsalutil.MDSALUtil;
25 import org.opendaylight.genius.mdsalutil.MatchInfoBase;
26 import org.opendaylight.genius.mdsalutil.MetaDataUtil;
27 import org.opendaylight.genius.mdsalutil.NwConstants;
28 import org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable;
29 import org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata;
30 import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
31 import org.opendaylight.genius.mdsalutil.matches.MatchArpSha;
32 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetType;
33 import org.opendaylight.genius.utils.ServiceIndex;
34 import org.opendaylight.netvirt.aclservice.api.AclServiceManager.Action;
35 import org.opendaylight.netvirt.aclservice.api.utils.AclInterface;
36 import org.opendaylight.netvirt.aclservice.utils.AclConstants;
37 import org.opendaylight.netvirt.aclservice.utils.AclDataUtil;
38 import org.opendaylight.netvirt.aclservice.utils.AclServiceOFFlowBuilder;
39 import org.opendaylight.netvirt.aclservice.utils.AclServiceUtils;
40 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.Acl;
41 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.AccessListEntries;
42 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace;
43 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.ace.Matches;
44 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.ace.actions.PacketHandling;
45 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.ace.matches.AceType;
46 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.ace.matches.ace.type.AceIp;
47 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
48 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
49 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
50 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeEgress;
51 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeIngress;
52 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices;
53 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.DirectionEgress;
54 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.SecurityRuleAttr;
55 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.interfaces._interface.AllowedAddressPairs;
56 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
57 import org.slf4j.Logger;
58 import org.slf4j.LoggerFactory;
61 * Provides abstract implementation for egress (w.r.t VM) ACL service.
64 * Note: Table names used are w.r.t switch. Hence, switch ingress is VM egress
67 public abstract class AbstractEgressAclServiceImpl extends AbstractAclServiceImpl {
69 private static final Logger LOG = LoggerFactory.getLogger(AbstractEgressAclServiceImpl.class);
72 * Initialize the member variables.
74 * @param dataBroker the data broker instance.
75 * @param mdsalManager the mdsal manager instance.
78 * @param aclServiceUtils
79 * the acl service util.
81 public AbstractEgressAclServiceImpl(DataBroker dataBroker, IMdsalApiManager mdsalManager, AclDataUtil aclDataUtil,
82 AclServiceUtils aclServiceUtils) {
83 // Service mode is w.rt. switch
84 super(ServiceModeIngress.class, dataBroker, mdsalManager, aclDataUtil, aclServiceUtils);
90 * @param interfaceName the interface name
93 public void bindService(String interfaceName, Long vpnId) {
94 int instructionKey = 0;
95 List<Instruction> instructions = new ArrayList<>();
97 instructions.add(MDSALUtil.buildAndGetWriteMetadaInstruction(MetaDataUtil.getVpnIdMetadata(vpnId),
98 MetaDataUtil.METADATA_MASK_VRFID, ++instructionKey));
100 Long elanTag = AclServiceUtils.getElanIdFromInterface(interfaceName, dataBroker);
101 instructions.add(MDSALUtil.buildAndGetWriteMetadaInstruction(MetaDataUtil.getElanTagMetadata(elanTag),
102 MetaDataUtil.METADATA_MASK_SERVICE, ++instructionKey));
104 instructions.add(MDSALUtil.buildAndGetGotoTableInstruction(NwConstants.INGRESS_ACL_TABLE, ++instructionKey));
105 short serviceIndex = ServiceIndex.getIndex(NwConstants.ACL_SERVICE_NAME, NwConstants.ACL_SERVICE_INDEX);
106 int flowPriority = AclConstants.EGRESS_ACL_DEFAULT_FLOW_PRIORITY;
107 BoundServices serviceInfo =
108 AclServiceUtils.getBoundServices(String.format("%s.%s.%s", "acl", "egressacl", interfaceName),
109 serviceIndex, flowPriority, AclConstants.COOKIE_ACL_BASE, instructions);
110 InstanceIdentifier<BoundServices> path =
111 AclServiceUtils.buildServiceId(interfaceName, serviceIndex, ServiceModeIngress.class);
113 DataStoreJobCoordinator dataStoreCoordinator = DataStoreJobCoordinator.getInstance();
114 dataStoreCoordinator.enqueueJob(interfaceName,
116 WriteTransaction writeTxn = dataBroker.newWriteOnlyTransaction();
117 writeTxn.put(LogicalDatastoreType.CONFIGURATION, path, serviceInfo, true);
119 List<ListenableFuture<Void>> futures = new ArrayList<>();
120 futures.add(writeTxn.submit());
128 * @param interfaceName the interface name
131 protected void unbindService(String interfaceName) {
132 InstanceIdentifier<BoundServices> path =
133 AclServiceUtils.buildServiceId(interfaceName,
134 ServiceIndex.getIndex(NwConstants.ACL_SERVICE_NAME, NwConstants.ACL_SERVICE_INDEX),
135 ServiceModeIngress.class);
137 DataStoreJobCoordinator dataStoreCoordinator = DataStoreJobCoordinator.getInstance();
138 dataStoreCoordinator.enqueueJob(interfaceName,
140 WriteTransaction writeTxn = dataBroker.newWriteOnlyTransaction();
141 writeTxn.delete(LogicalDatastoreType.CONFIGURATION, path);
143 List<ListenableFuture<Void>> futures = new ArrayList<>();
144 futures.add(writeTxn.submit());
150 protected void programGeneralFixedRules(BigInteger dpid, String dhcpMacAddress,
151 List<AllowedAddressPairs> allowedAddresses, int lportTag, Action action, int addOrRemove) {
152 LOG.info("programFixedRules : adding default rules.");
154 if (action == Action.ADD || action == Action.REMOVE) {
155 egressAclDhcpAllowClientTraffic(dpid, dhcpMacAddress, lportTag, addOrRemove);
156 egressAclDhcpv6AllowClientTraffic(dpid, dhcpMacAddress, lportTag, addOrRemove);
157 egressAclDhcpDropServerTraffic(dpid, dhcpMacAddress, lportTag, addOrRemove);
158 egressAclDhcpv6DropServerTraffic(dpid, dhcpMacAddress, lportTag, addOrRemove);
159 egressAclIcmpv6DropRouterAdvts(dpid, lportTag, addOrRemove);
160 egressAclIcmpv6AllowedList(dpid, lportTag, addOrRemove);
162 programArpRule(dpid, allowedAddresses, lportTag, addOrRemove);
167 protected void updateArpForAllowedAddressPairs(BigInteger dpId, int lportTag, List<AllowedAddressPairs> deletedAAP,
168 List<AllowedAddressPairs> addedAAP) {
169 Set<MacAddress> deletedAAPmacs =
170 deletedAAP.stream().map(aap -> aap.getMacAddress()).collect(Collectors.toSet());
171 Set<MacAddress> addedAAPmacs = addedAAP.stream().map(aap -> aap.getMacAddress()).collect(Collectors.toSet());
173 // Remove common macs to avoid delete and add of ARP flows having same MAC.
174 deletedAAPmacs.removeAll(addedAAPmacs);
176 programArpRule(dpId, deletedAAPmacs, lportTag, NwConstants.DEL_FLOW);
177 programArpRule(dpId, addedAAPmacs, lportTag, NwConstants.ADD_FLOW);
181 protected boolean programAclRules(List<Uuid> aclUuidList, BigInteger dpId, int lportTag, int addOrRemove, String
183 LOG.trace("Applying custom rules DpId {}, lportTag {}", dpId, lportTag);
184 if (aclUuidList == null || dpId == null) {
185 LOG.warn("one of the egress acl parameters can not be null. sg {}, dpId {}",
189 for (Uuid sgUuid :aclUuidList) {
190 Acl acl = AclServiceUtils.getAcl(dataBroker, sgUuid.getValue());
192 LOG.warn("The ACL is empty");
195 AccessListEntries accessListEntries = acl.getAccessListEntries();
196 List<Ace> aceList = accessListEntries.getAce();
197 for (Ace ace: aceList) {
198 programAceRule(dpId, lportTag, addOrRemove, acl.getAclName(), ace, portId, null);
205 protected void programAceRule(BigInteger dpId, int lportTag, int addOrRemove, String aclName, Ace ace,
206 String portId, List<AllowedAddressPairs> syncAllowedAddresses) {
207 SecurityRuleAttr aceAttr = AclServiceUtils.getAccesssListAttributes(ace);
208 if (!aceAttr.getDirection().equals(DirectionEgress.class)) {
211 Matches matches = ace.getMatches();
212 AceType aceType = matches.getAceType();
213 Map<String,List<MatchInfoBase>> flowMap = null;
214 if (aceType instanceof AceIp) {
215 flowMap = AclServiceOFFlowBuilder.programIpFlow(matches);
216 if (aceAttr.getRemoteGroupId() != null) {
217 flowMap = aclServiceUtils.getFlowForRemoteAcl(aceAttr.getRemoteGroupId(), portId, flowMap, false);
218 } else if (syncAllowedAddresses != null) {
219 flowMap = AclServiceUtils.getFlowForAllowedAddresses(syncAllowedAddresses, flowMap, false);
222 if (null == flowMap) {
223 LOG.error("Failed to apply ACL {} lportTag {}", ace.getKey(), lportTag);
226 for (String flowName : flowMap.keySet()) {
227 syncSpecificAclFlow(dpId, lportTag, addOrRemove, ace, portId, flowMap, flowName);
232 protected void writeCurrentAclForRemoteAcls(Uuid acl, int addOrRemove, Long elanTag, AllowedAddressPairs ip,
233 BigInteger aclId, Long vpnId) {
234 List<MatchInfoBase> flowMatches = new ArrayList<>();
235 flowMatches.addAll(AclServiceUtils.buildIpAndDstServiceMatch(elanTag, ip, dataBroker, vpnId));
237 List<InstructionInfo> instructions = new ArrayList<>();
239 InstructionWriteMetadata writeMetatdata =
240 new InstructionWriteMetadata(AclServiceUtils.getAclIdMetadata(aclId),
241 MetaDataUtil.METADATA_MASK_REMOTE_ACL_ID);
242 instructions.add(writeMetatdata);
243 instructions.add(new InstructionGotoTable(getEgressAclFilterTable()));
245 Long serviceTag = vpnId != null ? vpnId : elanTag;
246 String flowNameAdded = "Acl_Filter_Egress_" + new String(ip.getIpAddress().getValue()) + "_" + serviceTag;
248 Map<String, Set<AclInterface>> mapAclWithPortSet = aclDataUtil.getAllRemoteAclInterfaces();
249 Set<BigInteger> dpns = collectDpns(mapAclWithPortSet);
250 for (BigInteger dpId : dpns) {
251 LOG.debug("writing rule for ip {} and rlanId {} in egress acl remote table {}", getIpPrefixOrAddress(ip),
252 elanTag, getEgressAclRemoteAclTable());
253 syncFlow(dpId, getEgressAclRemoteAclTable(), flowNameAdded, AclConstants.NO_PRIORITY, "ACL", 0, 0,
254 AclConstants.COOKIE_ACL_BASE, flowMatches, instructions, addOrRemove);
258 protected short getEgressAclFilterTable() {
259 return NwConstants.INGRESS_ACL_FILTER_TABLE;
262 protected short getEgressAclRemoteAclTable() {
263 return NwConstants.INGRESS_ACL_REMOTE_ACL_TABLE;
267 protected void writeRemoteAclForCurrentAclForInterface(BigInteger dpId, int addOrRemove, AclInterface inter,
268 BigInteger aclId, Long elanTag, Long vpnId) {
269 for (AllowedAddressPairs ip : inter.getAllowedAddressPairs()) {
270 if (!AclServiceUtils.isNotIpv4AllNetwork(ip)) {
273 List<MatchInfoBase> flowMatches = new ArrayList<>();
274 flowMatches.addAll(AclServiceUtils.buildIpAndDstServiceMatch(elanTag, ip, dataBroker, vpnId));
276 List<InstructionInfo> instructions = new ArrayList<>();
278 InstructionWriteMetadata writeMetatdata =
279 new InstructionWriteMetadata(AclServiceUtils.getAclIdMetadata(aclId),
280 MetaDataUtil.METADATA_MASK_REMOTE_ACL_ID);
281 instructions.add(writeMetatdata);
282 instructions.add(new InstructionGotoTable(getEgressAclFilterTable()));
284 Long serviceTag = vpnId != null ? vpnId : elanTag;
285 String flowNameAdded =
286 "Acl_Filter_Egress_" + new String(ip.getIpAddress().getValue()) + "_" + serviceTag;
288 LOG.debug("writing rule for ip {} and elanId {} in egress acl remote table {}",
289 getIpPrefixOrAddress(ip), elanTag, getEgressAclRemoteAclTable());
290 syncFlow(dpId, getEgressAclRemoteAclTable(), flowNameAdded, AclConstants.NO_PRIORITY, "ACL", 0,
291 0, AclConstants.COOKIE_ACL_BASE, flowMatches, instructions, addOrRemove);
295 protected abstract String syncSpecificAclFlow(BigInteger dpId, int lportTag, int addOrRemove, Ace ace,
296 String portId, Map<String, List<MatchInfoBase>> flowMap, String flowName);
299 * Anti-spoofing rule to block the Ipv4 DHCP server traffic from the port.
301 * @param dpId the dpId
302 * @param dhcpMacAddress the Dhcp mac address
303 * @param lportTag the lport tag
304 * @param addOrRemove add/remove the flow.
306 protected void egressAclDhcpDropServerTraffic(BigInteger dpId, String dhcpMacAddress, int lportTag,
308 List<MatchInfoBase> matches = AclServiceUtils.buildDhcpMatches(AclConstants.DHCP_SERVER_PORT_IPV4,
309 AclConstants.DHCP_CLIENT_PORT_IPV4, lportTag, ServiceModeEgress.class);
311 String flowName = "Egress_DHCP_Server_v4" + dpId + "_" + lportTag + "_" + dhcpMacAddress + "_Drop_";
312 syncFlow(dpId, NwConstants.INGRESS_ACL_TABLE, flowName,
313 AclConstants.PROTO_DHCP_CLIENT_TRAFFIC_MATCH_PRIORITY, "ACL", 0,
314 0, AclConstants.COOKIE_ACL_BASE, matches, Collections.emptyList(), addOrRemove);
318 * Anti-spoofing rule to block the Ipv6 DHCP server traffic from the port.
320 * @param dpId the dpId
321 * @param dhcpMacAddress the Dhcp mac address
322 * @param lportTag the lport tag
323 * @param addOrRemove add/remove the flow.
325 protected void egressAclDhcpv6DropServerTraffic(BigInteger dpId, String dhcpMacAddress, int lportTag,
327 List<MatchInfoBase> matches = AclServiceUtils.buildDhcpV6Matches(AclConstants.DHCP_SERVER_PORT_IPV6,
328 AclConstants.DHCP_CLIENT_PORT_IPV6, lportTag, ServiceModeEgress.class);
330 String flowName = "Egress_DHCP_Server_v6" + "_" + dpId + "_" + lportTag + "_" + dhcpMacAddress + "_Drop_";
331 syncFlow(dpId, NwConstants.INGRESS_ACL_TABLE, flowName,
332 AclConstants.PROTO_DHCP_CLIENT_TRAFFIC_MATCH_PRIORITY, "ACL", 0,
333 0, AclConstants.COOKIE_ACL_BASE, matches, Collections.emptyList(), addOrRemove);
337 * Anti-spoofing rule to block the Ipv6 Router Advts from the VM port.
339 * @param dpId the dpId
340 * @param lportTag the lport tag
341 * @param addOrRemove add/remove the flow.
343 private void egressAclIcmpv6DropRouterAdvts(BigInteger dpId, int lportTag, int addOrRemove) {
344 List<MatchInfoBase> matches = AclServiceUtils.buildIcmpV6Matches(AclConstants.ICMPV6_TYPE_RA, 0, lportTag,
345 ServiceModeEgress.class);
347 String flowName = "Egress_ICMPv6" + "_" + dpId + "_" + lportTag + "_" + AclConstants.ICMPV6_TYPE_RA + "_Drop_";
348 syncFlow(dpId, NwConstants.INGRESS_ACL_TABLE, flowName, AclConstants.PROTO_IPV6_DROP_PRIORITY, "ACL", 0,
349 0, AclConstants.COOKIE_ACL_BASE, matches, Collections.emptyList(), addOrRemove);
353 * Add rule to allow certain ICMPv6 traffic from VM ports.
355 * @param dpId the dpId
356 * @param lportTag the lport tag
357 * @param addOrRemove add/remove the flow.
359 private void egressAclIcmpv6AllowedList(BigInteger dpId, int lportTag, int addOrRemove) {
360 List<ActionInfo> actionsInfos = new ArrayList<>();
361 List<InstructionInfo> instructions = getDispatcherTableResubmitInstructions(actionsInfos);
363 for (Integer icmpv6Type: AclConstants.allowedIcmpv6NdList()) {
364 List<MatchInfoBase> matches = AclServiceUtils.buildIcmpV6Matches(icmpv6Type, 0, lportTag,
365 ServiceModeEgress.class);
366 String flowName = "Egress_ICMPv6" + "_" + dpId + "_" + lportTag + "_" + icmpv6Type + "_Permit_";
367 syncFlow(dpId, NwConstants.INGRESS_ACL_TABLE, flowName, AclConstants.PROTO_IPV6_ALLOWED_PRIORITY,
368 "ACL", 0, 0, AclConstants.COOKIE_ACL_BASE, matches, instructions, addOrRemove);
373 * Add rule to ensure only DHCP server traffic from the specified mac is
376 * @param dpId the dpid
377 * @param dhcpMacAddress the DHCP server mac address
378 * @param lportTag the lport tag
379 * @param addOrRemove whether to add or remove the flow
381 private void egressAclDhcpAllowClientTraffic(BigInteger dpId, String dhcpMacAddress, int lportTag,
383 final List<MatchInfoBase> matches = AclServiceUtils.buildDhcpMatches(AclConstants.DHCP_CLIENT_PORT_IPV4,
384 AclConstants.DHCP_SERVER_PORT_IPV4, lportTag, ServiceModeEgress.class);
386 List<ActionInfo> actionsInfos = new ArrayList<>();
387 List<InstructionInfo> instructions = getDispatcherTableResubmitInstructions(actionsInfos);
389 String flowName = "Egress_DHCP_Client_v4" + dpId + "_" + lportTag + "_" + dhcpMacAddress + "_Permit_";
390 syncFlow(dpId, NwConstants.INGRESS_ACL_TABLE, flowName, AclConstants.PROTO_DHCP_CLIENT_TRAFFIC_MATCH_PRIORITY,
391 "ACL", 0, 0, AclConstants.COOKIE_ACL_BASE, matches, instructions, addOrRemove);
395 * Add rule to ensure only DHCPv6 server traffic from the specified mac is
398 * @param dpId the dpid
399 * @param dhcpMacAddress the DHCP server mac address
400 * @param lportTag the lport tag
401 * @param addOrRemove whether to add or remove the flow
403 private void egressAclDhcpv6AllowClientTraffic(BigInteger dpId, String dhcpMacAddress, int lportTag,
405 final List<MatchInfoBase> matches = AclServiceUtils.buildDhcpV6Matches(AclConstants.DHCP_CLIENT_PORT_IPV6,
406 AclConstants.DHCP_SERVER_PORT_IPV6, lportTag, ServiceModeEgress.class);
408 List<ActionInfo> actionsInfos = new ArrayList<>();
409 List<InstructionInfo> instructions = getDispatcherTableResubmitInstructions(actionsInfos);
411 String flowName = "Egress_DHCP_Client_v6" + "_" + dpId + "_" + lportTag + "_" + dhcpMacAddress + "_Permit_";
412 syncFlow(dpId, NwConstants.INGRESS_ACL_TABLE, flowName, AclConstants.PROTO_DHCP_CLIENT_TRAFFIC_MATCH_PRIORITY,
413 "ACL", 0, 0, AclConstants.COOKIE_ACL_BASE, matches, instructions, addOrRemove);
419 * @param dpId the dp id
420 * @param allowedAddresses the allowed addresses
421 * @param lportTag the lport tag
422 * @param addOrRemove whether to add or remove the flow
424 protected void programArpRule(BigInteger dpId, List<AllowedAddressPairs> allowedAddresses, int lportTag,
426 // Collecting macs as a set to avoid duplicate
427 Set<MacAddress> macs = allowedAddresses.stream().map(aap -> aap.getMacAddress()).collect(Collectors.toSet());
428 programArpRule(dpId, macs, lportTag, addOrRemove);
432 * Adds the rule to allow arp packets.
434 * @param dpId the dpId
435 * @param macs the set of MACs
436 * @param lportTag the lport tag
437 * @param addOrRemove whether to add or remove the flow
439 protected void programArpRule(BigInteger dpId, Set<MacAddress> macs, int lportTag, int addOrRemove) {
440 for (MacAddress mac : macs) {
441 List<MatchInfoBase> matches = new ArrayList<>();
442 matches.add(MatchEthernetType.ARP);
443 matches.add(new MatchArpSha(mac));
444 matches.add(buildLPortTagMatch(lportTag));
446 List<InstructionInfo> instructions = getDispatcherTableResubmitInstructions(new ArrayList<>());
448 String flowName = "Egress_ARP_" + dpId + "_" + lportTag + "_" + mac.getValue();
449 syncFlow(dpId, NwConstants.INGRESS_ACL_TABLE, flowName,
450 AclConstants.PROTO_ARP_TRAFFIC_MATCH_PRIORITY, "ACL", 0, 0,
451 AclConstants.COOKIE_ACL_BASE, matches, instructions, addOrRemove);
455 protected MatchInfoBase buildLPortTagMatch(int lportTag) {
456 return AclServiceUtils.buildLPortTagMatch(lportTag, ServiceModeEgress.class);
459 protected int getEgressSpecificAclFlowPriority(BigInteger dpId, int addOrRemove, String flowName,
460 PacketHandling packetHandling) {
462 if (addOrRemove == NwConstants.DEL_FLOW) {
463 priority = aclServiceUtils.releaseAndRemoveFlowPriorityFromCache(dpId, NwConstants.INGRESS_ACL_FILTER_TABLE,
464 flowName, packetHandling);
466 priority = aclServiceUtils.allocateAndSaveFlowPriorityInCache(dpId, NwConstants.INGRESS_ACL_FILTER_TABLE,
467 flowName, packetHandling);