Class IngressAclServiceImpl
- java.lang.Object
-
- org.opendaylight.netvirt.aclservice.AbstractAclServiceImpl
-
- org.opendaylight.netvirt.aclservice.IngressAclServiceImpl
-
- All Implemented Interfaces:
AclServiceListener
public class IngressAclServiceImpl extends AbstractAclServiceImpl
Provides the implementation for ingress (w.r.t VM) ACL service.Note: Table names used are w.r.t switch. Hence, switch ingress is VM egress and vice versa.
-
-
Field Summary
-
Fields inherited from class org.opendaylight.netvirt.aclservice.AbstractAclServiceImpl
aclDataUtil, aclInterfaceCache, aclServiceUtils, direction, directionString, jobCoordinator, mdsalManager, serviceMode, txRunner
-
-
Constructor Summary
Constructors Constructor Description IngressAclServiceImpl(org.opendaylight.mdsal.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
allowDhcpClientTraffic(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, int lportTag, int addOrRemove)
Add rule to ensure only DHCP client traffic is allowed.protected void
allowDhcpv6ClientTraffic(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, int lportTag, int addOrRemove)
Add rule to ensure only DHCPv6 client traffic is allowed.protected void
allowIcmpTrafficToDhcpServer(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, java.util.List<AllowedAddressPairs> allowedAddresses, int addOrRemove)
Add rules to allow ICMP traffic for DHCP server.void
bindService(AclInterface aclInterface)
Bind service.protected void
dropTrafficToDhcpServer(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, int lportTag, int addOrRemove)
Add rule to drop BUM traffic to DHCP Server.protected short
getAclCommitterTable()
protected short
getAclConntrackSenderTable()
protected short
getAclFilterCumDispatcherTable()
protected short
getAclForExistingTrafficTable()
protected short
getAclRemoteAclTable()
protected short
getAclRuleBasedFilterTable()
protected void
ingressAclDhcpAllowServerTraffic(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, int lportTag, int addOrRemove)
Add rule to ensure only DHCP server traffic from the specified mac is allowed.protected void
ingressAclDhcpv6AllowServerTraffic(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, int lportTag, int addOrRemove)
Add rule to ensure only DHCPv6 server traffic from the specified mac is allowed.protected boolean
isValidDirection(java.lang.Class<? extends DirectionBase> direction)
protected void
processDhcpServiceUpdate(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, java.util.List<AllowedAddressPairs> allowedAddresses, int addOrRemove)
Programs DHCP service flows.protected void
programAntiSpoofingRules(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, java.util.List<AllowedAddressPairs> allowedAddresses, AclServiceManager.Action action, int addOrRemove)
Programs the anti-spoofing rules.protected void
programArpRule(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, int lportTag, int addOrRemove)
Adds the rule to allow arp packets.protected void
programBroadcastRules(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, AclServiceManager.Action action, int addOrRemove)
Programs broadcast rules.protected void
programDhcpService(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, AclServiceManager.Action action, int addOrRemove)
Programs DHCP Service flows.protected void
programGotoClassifierTableRules(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, java.util.List<AllowedAddressPairs> aaps, int lportTag, int addOrRemove)
protected void
programIcmpv6RARule(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, java.util.List<SubnetInfo> subnets, int addOrRemove)
protected void
programRemoteAclTableFlow(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, java.lang.Integer aclTag, AllowedAddressPairs aap, int addOrRemove)
protected void
programSubnetBroadcastRules(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, java.util.List<SubnetInfo> subnetInfoList, int addOrRemove)
Programs broadcast rules.protected void
unbindService(AclInterface aclInterface)
Unbind service.-
Methods inherited from class org.opendaylight.netvirt.aclservice.AbstractAclServiceImpl
addFlowEntryToList, applyAce, applyAcl, bindAcl, collectDpns, getDispatcherTableResubmitInstructions, getDispatcherTableResubmitInstructions, getElanIdFromAclInterface, getRemoteAclTags, handleRemoteAclUpdate, programAceRule, programAceSpecificFlows, programAclCommitRuleForConntrack, programAclCommitRuleForNonConntrack, programAclCommitRules, programAclDispatcherTable, programAclPortSpecificFixedRules, programAclRuleMissDropRule, programAclRules, programConntrackInvalidDropRule, programConntrackRecircRule, programConntrackRecircRules, programFirstRemoteAclEntryInDispatcherTable, programFlows, programForAceNotHavingRemoteAclId, programLastRemoteAclEntryInDispatcherTable, programPortSpecificDropRules, removeAce, removeAcl, unbindAcl, updateAcl, updateRemoteAcl
-
-
-
-
Constructor Detail
-
IngressAclServiceImpl
public IngressAclServiceImpl(org.opendaylight.mdsal.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.- Parameters:
dataBroker
- the data broker instance.mdsalManager
- the mdsal manager.aclDataUtil
- the acl data util.aclServiceUtils
- the acl service util.jobCoordinator
- the job coordinatoraclInterfaceCache
- the acl interface cache
-
-
Method Detail
-
bindService
public void bindService(AclInterface aclInterface)
Bind service.- Specified by:
bindService
in classAbstractAclServiceImpl
- Parameters:
aclInterface
- the acl interface
-
unbindService
protected void unbindService(AclInterface aclInterface)
Unbind service.- Specified by:
unbindService
in classAbstractAclServiceImpl
- Parameters:
aclInterface
- the acl interface
-
programDhcpService
protected void programDhcpService(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, AclServiceManager.Action action, int addOrRemove)
Programs DHCP Service flows.- Specified by:
programDhcpService
in classAbstractAclServiceImpl
- Parameters:
flowEntries
- the flow entriesport
- the acl interfaceaction
- add/modify/remove actionaddOrRemove
- addorRemove
-
processDhcpServiceUpdate
protected void processDhcpServiceUpdate(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, java.util.List<AllowedAddressPairs> allowedAddresses, int addOrRemove)
Programs DHCP service flows.- Specified by:
processDhcpServiceUpdate
in classAbstractAclServiceImpl
- Parameters:
flowEntries
- the flow entriesport
- the acl interfaceallowedAddresses
- the allowed addressesaddOrRemove
- addorRemove
-
programAntiSpoofingRules
protected void programAntiSpoofingRules(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, java.util.List<AllowedAddressPairs> allowedAddresses, AclServiceManager.Action action, int addOrRemove)
Description copied from class:AbstractAclServiceImpl
Programs the anti-spoofing rules.- Specified by:
programAntiSpoofingRules
in classAbstractAclServiceImpl
- Parameters:
flowEntries
- the flow entriesport
- the acl interfaceallowedAddresses
- the allowed addressesaction
- add/modify/remove actionaddOrRemove
- addorRemove
-
programGotoClassifierTableRules
protected void programGotoClassifierTableRules(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, java.util.List<AllowedAddressPairs> aaps, int lportTag, int addOrRemove)
- Specified by:
programGotoClassifierTableRules
in classAbstractAclServiceImpl
-
programRemoteAclTableFlow
protected void programRemoteAclTableFlow(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, java.lang.Integer aclTag, AllowedAddressPairs aap, int addOrRemove)
- Specified by:
programRemoteAclTableFlow
in classAbstractAclServiceImpl
-
ingressAclDhcpAllowServerTraffic
protected void ingressAclDhcpAllowServerTraffic(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, int lportTag, int addOrRemove)
Add rule to ensure only DHCP server traffic from the specified mac is allowed.- Parameters:
flowEntries
- the flow entriesdpId
- the dpidlportTag
- the lport tagaddOrRemove
- is write or delete
-
ingressAclDhcpv6AllowServerTraffic
protected void ingressAclDhcpv6AllowServerTraffic(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, int lportTag, int addOrRemove)
Add rule to ensure only DHCPv6 server traffic from the specified mac is allowed.- Parameters:
flowEntries
- the flow entriesdpId
- the dpidlportTag
- the lport tagaddOrRemove
- is write or delete
-
programIcmpv6RARule
protected void programIcmpv6RARule(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, java.util.List<SubnetInfo> subnets, int addOrRemove)
- Specified by:
programIcmpv6RARule
in classAbstractAclServiceImpl
-
programArpRule
protected void programArpRule(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, int lportTag, int addOrRemove)
Adds the rule to allow arp packets.- Parameters:
flowEntries
- the flow entriesdpId
- the dpIdlportTag
- the lport tagaddOrRemove
- whether to add or remove the flow
-
programBroadcastRules
protected void programBroadcastRules(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, AclServiceManager.Action action, int addOrRemove)
Programs broadcast rules.- Specified by:
programBroadcastRules
in classAbstractAclServiceImpl
- Parameters:
flowEntries
- the flow entriesport
- the Acl Interface portaddOrRemove
- whether to delete or add flow
-
programSubnetBroadcastRules
protected void programSubnetBroadcastRules(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, java.util.List<SubnetInfo> subnetInfoList, int addOrRemove)
Programs broadcast rules.- Specified by:
programSubnetBroadcastRules
in classAbstractAclServiceImpl
- Parameters:
flowEntries
- the flow entriesport
- the Acl Interface portsubnetInfoList
- the port subnet info listaddOrRemove
- whether to delete or add flow
-
allowDhcpClientTraffic
protected void allowDhcpClientTraffic(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, int lportTag, int addOrRemove)
Add rule to ensure only DHCP client traffic is allowed.- Parameters:
flowEntries
- the flow entriesdpId
- the dpidlportTag
- the lport tagaddOrRemove
- is write or delete
-
allowDhcpv6ClientTraffic
protected void allowDhcpv6ClientTraffic(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, int lportTag, int addOrRemove)
Add rule to ensure only DHCPv6 client traffic is allowed.- Parameters:
flowEntries
- the flow entriesdpId
- the dpidlportTag
- the lport tagaddOrRemove
- is write or delete
-
allowIcmpTrafficToDhcpServer
protected void allowIcmpTrafficToDhcpServer(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, AclInterface port, java.util.List<AllowedAddressPairs> allowedAddresses, int addOrRemove)
Add rules to allow ICMP traffic for DHCP server.- Parameters:
flowEntries
- the flow entriesport
- the Acl Interface portallowedAddresses
- the allowed addressesaddOrRemove
- the lport tag
-
dropTrafficToDhcpServer
protected void dropTrafficToDhcpServer(java.util.List<org.opendaylight.genius.mdsalutil.FlowEntity> flowEntries, org.opendaylight.yangtools.yang.common.Uint64 dpId, int lportTag, int addOrRemove)
Add rule to drop BUM traffic to DHCP Server.- Parameters:
flowEntries
- the flow entriesdpId
- the dpidlportTag
- the lport tagaddOrRemove
- is write or delete
-
isValidDirection
protected boolean isValidDirection(java.lang.Class<? extends DirectionBase> direction)
- Specified by:
isValidDirection
in classAbstractAclServiceImpl
-
getAclConntrackSenderTable
protected short getAclConntrackSenderTable()
- Specified by:
getAclConntrackSenderTable
in classAbstractAclServiceImpl
-
getAclForExistingTrafficTable
protected short getAclForExistingTrafficTable()
- Specified by:
getAclForExistingTrafficTable
in classAbstractAclServiceImpl
-
getAclFilterCumDispatcherTable
protected short getAclFilterCumDispatcherTable()
- Specified by:
getAclFilterCumDispatcherTable
in classAbstractAclServiceImpl
-
getAclRuleBasedFilterTable
protected short getAclRuleBasedFilterTable()
- Specified by:
getAclRuleBasedFilterTable
in classAbstractAclServiceImpl
-
getAclRemoteAclTable
protected short getAclRemoteAclTable()
- Specified by:
getAclRemoteAclTable
in classAbstractAclServiceImpl
-
getAclCommitterTable
protected short getAclCommitterTable()
- Specified by:
getAclCommitterTable
in classAbstractAclServiceImpl
-
-