public abstract class AbstractAclServiceImpl extends Object implements AclServiceListener
Modifier and Type | Field and Description |
---|---|
protected AclDataUtil |
aclDataUtil |
protected AclInterfaceCache |
aclInterfaceCache |
protected AclServiceUtils |
aclServiceUtils |
protected org.opendaylight.controller.md.sal.binding.api.DataBroker |
dataBroker |
protected Class<? extends DirectionBase> |
direction |
protected String |
directionString |
protected org.opendaylight.infrautils.jobcoordinator.JobCoordinator |
jobCoordinator |
protected org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager |
mdsalManager |
protected Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> |
serviceMode |
protected org.opendaylight.genius.infra.ManagedNewTransactionRunner |
txRunner |
Constructor and Description |
---|
AbstractAclServiceImpl(Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode,
org.opendaylight.controller.md.sal.binding.api.DataBroker dataBroker,
org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager mdsalManager,
AclDataUtil aclDataUtil,
AclServiceUtils aclServiceUtils,
org.opendaylight.infrautils.jobcoordinator.JobCoordinator jobCoordinator,
AclInterfaceCache aclInterfaceCache)
Initialize the member variables.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addFlowEntryToList(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
BigInteger dpId,
short tableId,
String flowId,
int priority,
int idleTimeOut,
int hardTimeOut,
BigInteger cookie,
List<? extends org.opendaylight.genius.mdsalutil.MatchInfoBase> matches,
List<org.opendaylight.genius.mdsalutil.InstructionInfo> instructions,
int addOrRemove)
Add Flow to list.
|
boolean |
applyAce(AclInterface port,
String aclName,
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace ace) |
boolean |
applyAcl(AclInterface port) |
boolean |
bindAcl(AclInterface port) |
abstract void |
bindService(AclInterface aclInterface)
Bind service.
|
protected Set<BigInteger> |
collectDpns(Map<String,Set<AclInterface>> mapAclWithPortSet) |
protected abstract short |
getAclAntiSpoofingTable() |
protected abstract short |
getAclCommitterTable() |
protected abstract short |
getAclConntrackClassifierTable() |
protected abstract short |
getAclConntrackSenderTable() |
protected abstract short |
getAclFilterCumDispatcherTable() |
protected abstract short |
getAclForExistingTrafficTable() |
protected abstract short |
getAclRemoteAclTable() |
protected abstract short |
getAclRuleBasedFilterTable() |
protected List<org.opendaylight.genius.mdsalutil.InstructionInfo> |
getDispatcherTableResubmitInstructions() |
protected List<org.opendaylight.genius.mdsalutil.InstructionInfo> |
getDispatcherTableResubmitInstructions(List<org.opendaylight.genius.mdsalutil.ActionInfo> actionsInfos)
Gets the dispatcher table resubmit instructions based on ingress/egress service mode w.r.t switch.
|
protected Long |
getElanIdFromAclInterface(String elanInterfaceName) |
protected String |
getOperAsString(int flowOper) |
protected SortedSet<Integer> |
getRemoteAclTags(AclInterface port) |
protected void |
handleRemoteAclUpdate(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.Acl aclBefore,
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.Acl aclAfter,
Collection<AclInterface> portsBefore) |
protected abstract boolean |
isValidDirection(Class<? extends DirectionBase> direction) |
protected void |
programAceRule(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
AclInterface port,
String aclName,
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace ace,
int addOrRemove)
Programs the ace specific rule.
|
protected void |
programAceSpecificFlows(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
AclInterface port,
String aclName,
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace ace,
Map<String,List<org.opendaylight.genius.mdsalutil.MatchInfoBase>> flowMap,
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid remoteAclId,
int addOrRemove) |
protected void |
programAclCommitRuleForConntrack(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
BigInteger dpId,
int lportTag,
String portId,
org.opendaylight.genius.mdsalutil.matches.MatchEthernetType matchEtherType,
int addOrRemove)
Program acl commit rule for conntrack.
|
protected void |
programAclCommitRuleForNonConntrack(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
BigInteger dpId,
int lportTag,
int addOrRemove)
Program acl commit rule for non conntrack.
|
protected void |
programAclCommitRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
BigInteger dpId,
int lportTag,
String portId,
int addOrRemove)
Program acl commit rules.
|
protected void |
programAclDispatcherTable(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
AclInterface port,
int addOrRemove) |
protected void |
programAclPortSpecificFixedRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
BigInteger dpId,
List<AllowedAddressPairs> allowedAddresses,
int lportTag,
String portId,
AclServiceManager.Action action,
int write)
Programs the port specific fixed rules.
|
protected void |
programAclRuleMissDropRule(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
BigInteger dpId,
int lportTag,
int addOrRemove)
Program ACL rule miss drop rule for a port.
|
protected boolean |
programAclRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
AclInterface port,
List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> aclUuidList,
int addOrRemove)
Programs the acl custom rules.
|
protected abstract void |
programAntiSpoofingRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
AclInterface port,
List<AllowedAddressPairs> allowedAddresses,
AclServiceManager.Action action,
int addOrRemove)
Programs the anti-spoofing rules.
|
protected abstract void |
programBroadcastRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
AclInterface port,
int addOrRemove)
Programs broadcast rules.
|
protected void |
programConntrackInvalidDropRule(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
BigInteger dpId,
int lportTag,
int addOrRemove)
Adds the rule to drop the conntrack invalid packets .
|
protected void |
programConntrackRecircRule(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
BigInteger dpId,
int lportTag,
String portId,
org.opendaylight.genius.mdsalutil.matches.MatchEthernetType matchEtherType,
int addOrRemove) |
protected void |
programConntrackRecircRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
BigInteger dpId,
List<AllowedAddressPairs> aaps,
int lportTag,
String portId,
int addOrRemove)
Adds the rule to send the packet to the netfilter to check whether it is a known packet.
|
protected void |
programFirstRemoteAclEntryInDispatcherTable(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
AclInterface port,
Integer firstRemoteAclTag,
int addOrRemove) |
protected void |
programFlows(String jobName,
List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
int addOrRemove) |
protected void |
programForAceNotHavingRemoteAclId(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
AclInterface port,
String aclName,
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace ace,
Map<String,List<org.opendaylight.genius.mdsalutil.MatchInfoBase>> flowMap,
int addOrRemove) |
protected abstract void |
programGotoClassifierTableRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
BigInteger dpId,
List<AllowedAddressPairs> aaps,
int lportTag,
int addOrRemove) |
protected abstract void |
programIcmpv6RARule(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
AclInterface port,
List<SubnetInfo> subnets,
int addOrRemove) |
protected void |
programLastRemoteAclEntryInDispatcherTable(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
AclInterface port,
Integer lastRemoteAclTag,
int addOrRemove) |
protected void |
programPortSpecificDropRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
BigInteger dpId,
int lportTag,
int addOrRemove)
Adds the rules to drop the unknown/invalid packets .
|
protected abstract void |
programRemoteAclTableFlow(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries,
BigInteger dpId,
Integer aclTag,
AllowedAddressPairs aap,
int addOrRemove) |
boolean |
removeAce(AclInterface port,
String aclName,
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace ace) |
boolean |
removeAcl(AclInterface port) |
boolean |
unbindAcl(AclInterface port) |
protected abstract void |
unbindService(AclInterface aclInterface)
Unbind service.
|
boolean |
updateAcl(AclInterface portBefore,
AclInterface portAfter) |
void |
updateRemoteAcl(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.Acl aclBefore,
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.Acl aclAfter,
Collection<AclInterface> portsBefore) |
protected final org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager mdsalManager
protected final org.opendaylight.controller.md.sal.binding.api.DataBroker dataBroker
protected final org.opendaylight.genius.infra.ManagedNewTransactionRunner txRunner
protected final Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode
protected final AclDataUtil aclDataUtil
protected final AclServiceUtils aclServiceUtils
protected final org.opendaylight.infrautils.jobcoordinator.JobCoordinator jobCoordinator
protected final AclInterfaceCache aclInterfaceCache
protected final Class<? extends DirectionBase> direction
protected final String directionString
public AbstractAclServiceImpl(Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode, org.opendaylight.controller.md.sal.binding.api.DataBroker dataBroker, org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager mdsalManager, AclDataUtil aclDataUtil, AclServiceUtils aclServiceUtils, org.opendaylight.infrautils.jobcoordinator.JobCoordinator jobCoordinator, AclInterfaceCache aclInterfaceCache)
serviceMode
- the service modedataBroker
- the data broker instance.mdsalManager
- the mdsal manager instance.aclDataUtil
- the acl data util.aclServiceUtils
- the acl service util.jobCoordinator
- the job coordinatoraclInterfaceCache
- the acl interface cachepublic boolean applyAcl(AclInterface port)
applyAcl
in interface AclServiceListener
public boolean bindAcl(AclInterface port)
bindAcl
in interface AclServiceListener
public boolean unbindAcl(AclInterface port)
unbindAcl
in interface AclServiceListener
public boolean updateAcl(AclInterface portBefore, AclInterface portAfter)
updateAcl
in interface AclServiceListener
protected SortedSet<Integer> getRemoteAclTags(AclInterface port)
protected void programAclDispatcherTable(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, int addOrRemove)
protected void programFirstRemoteAclEntryInDispatcherTable(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, Integer firstRemoteAclTag, int addOrRemove)
protected void programLastRemoteAclEntryInDispatcherTable(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, Integer lastRemoteAclTag, int addOrRemove)
protected boolean programAclRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> aclUuidList, int addOrRemove)
flowEntries
- the flow entriesport
- acl interfaceaclUuidList
- the list of acl uuid to be appliedaddOrRemove
- whether to delete or add flowprotected void programAceRule(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, String aclName, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace ace, int addOrRemove)
flowEntries
- flow entriesport
- acl interfaceaclName
- the acl nameace
- rule to be programaddOrRemove
- whether to delete or add flowprotected void programForAceNotHavingRemoteAclId(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, String aclName, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace ace, Map<String,List<org.opendaylight.genius.mdsalutil.MatchInfoBase>> flowMap, int addOrRemove)
protected void programAceSpecificFlows(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, String aclName, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace ace, Map<String,List<org.opendaylight.genius.mdsalutil.MatchInfoBase>> flowMap, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid remoteAclId, int addOrRemove)
public boolean removeAcl(AclInterface port)
removeAcl
in interface AclServiceListener
public boolean applyAce(AclInterface port, String aclName, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace ace)
applyAce
in interface AclServiceListener
public boolean removeAce(AclInterface port, String aclName, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace ace)
removeAce
in interface AclServiceListener
public void updateRemoteAcl(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.Acl aclBefore, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.Acl aclAfter, Collection<AclInterface> portsBefore)
updateRemoteAcl
in interface AclServiceListener
public abstract void bindService(AclInterface aclInterface)
aclInterface
- the acl interfaceprotected abstract void unbindService(AclInterface aclInterface)
aclInterface
- the acl interfaceprotected abstract void programAntiSpoofingRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, List<AllowedAddressPairs> allowedAddresses, AclServiceManager.Action action, int addOrRemove)
flowEntries
- the flow entriesport
- the acl interfaceallowedAddresses
- the allowed addressesaction
- add/modify/remove actionaddOrRemove
- addorRemoveprotected abstract void programBroadcastRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, int addOrRemove)
flowEntries
- the flow entriesport
- the Acl Interface portaddOrRemove
- whether to delete or add flowprotected abstract void programIcmpv6RARule(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, List<SubnetInfo> subnets, int addOrRemove)
protected void addFlowEntryToList(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, BigInteger dpId, short tableId, String flowId, int priority, int idleTimeOut, int hardTimeOut, BigInteger cookie, List<? extends org.opendaylight.genius.mdsalutil.MatchInfoBase> matches, List<org.opendaylight.genius.mdsalutil.InstructionInfo> instructions, int addOrRemove)
dpId
- the dpIdtableId
- the tableIdflowId
- the flowIdpriority
- the priorityidleTimeOut
- the idle timeouthardTimeOut
- the hard timeoutcookie
- the cookiematches
- the list of matches to be writtedinstructions
- the list of instruction to be written.addOrRemove
- add or remove the entries.protected void programFlows(String jobName, List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, int addOrRemove)
protected List<org.opendaylight.genius.mdsalutil.InstructionInfo> getDispatcherTableResubmitInstructions()
protected List<org.opendaylight.genius.mdsalutil.InstructionInfo> getDispatcherTableResubmitInstructions(List<org.opendaylight.genius.mdsalutil.ActionInfo> actionsInfos)
actionsInfos
- the actions infosprotected void handleRemoteAclUpdate(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.Acl aclBefore, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.Acl aclAfter, Collection<AclInterface> portsBefore)
protected abstract void programRemoteAclTableFlow(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, BigInteger dpId, Integer aclTag, AllowedAddressPairs aap, int addOrRemove)
protected String getOperAsString(int flowOper)
protected Set<BigInteger> collectDpns(Map<String,Set<AclInterface>> mapAclWithPortSet)
protected void programAclPortSpecificFixedRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, BigInteger dpId, List<AllowedAddressPairs> allowedAddresses, int lportTag, String portId, AclServiceManager.Action action, int write)
flowEntries
- the flow entriesdpId
- the dp idallowedAddresses
- the allowed addresseslportTag
- the lport tagportId
- the portIdaction
- the actionwrite
- whether to add or remove the flow.protected abstract void programGotoClassifierTableRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, BigInteger dpId, List<AllowedAddressPairs> aaps, int lportTag, int addOrRemove)
protected void programConntrackRecircRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, BigInteger dpId, List<AllowedAddressPairs> aaps, int lportTag, String portId, int addOrRemove)
flowEntries
- the flow entriesdpId
- the dpIdaaps
- the allowed address pairslportTag
- the lport tagportId
- the portIdaddOrRemove
- whether to add or remove the flowprotected void programConntrackRecircRule(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, BigInteger dpId, int lportTag, String portId, org.opendaylight.genius.mdsalutil.matches.MatchEthernetType matchEtherType, int addOrRemove)
protected void programPortSpecificDropRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, BigInteger dpId, int lportTag, int addOrRemove)
flowEntries
- the flow entriesdpId
- the dpIdlportTag
- the lport tagaddOrRemove
- whether to add or remove the flowprotected void programConntrackInvalidDropRule(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, BigInteger dpId, int lportTag, int addOrRemove)
flowEntries
- the flow entriesdpId
- the dpIdlportTag
- the lport tagaddOrRemove
- whether to add or remove the flowprotected void programAclRuleMissDropRule(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, BigInteger dpId, int lportTag, int addOrRemove)
flowEntries
- the flow entriesdpId
- the dp idlportTag
- the lport tagaddOrRemove
- the add or removeprotected void programAclCommitRules(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, BigInteger dpId, int lportTag, String portId, int addOrRemove)
flowEntries
- the flow entriesdpId
- the dp idlportTag
- the lport tagportId
- the port idaddOrRemove
- the add or removeprotected void programAclCommitRuleForConntrack(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, BigInteger dpId, int lportTag, String portId, org.opendaylight.genius.mdsalutil.matches.MatchEthernetType matchEtherType, int addOrRemove)
flowEntries
- the flow entriesdpId
- the dp idlportTag
- the lport tagportId
- the port idmatchEtherType
- the match ether typeaddOrRemove
- the add or removeprotected void programAclCommitRuleForNonConntrack(List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, BigInteger dpId, int lportTag, int addOrRemove)
flowEntries
- the flow entriesdpId
- the dp idlportTag
- the lport tagaddOrRemove
- the add or removeprotected abstract boolean isValidDirection(Class<? extends DirectionBase> direction)
protected abstract short getAclAntiSpoofingTable()
protected abstract short getAclConntrackClassifierTable()
protected abstract short getAclConntrackSenderTable()
protected abstract short getAclForExistingTrafficTable()
protected abstract short getAclFilterCumDispatcherTable()
protected abstract short getAclRuleBasedFilterTable()
protected abstract short getAclRemoteAclTable()
protected abstract short getAclCommitterTable()
Copyright © 2019 OpenDaylight. All rights reserved.