Class AclServiceUtils


  • @Singleton
    public final class AclServiceUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      AclServiceUtils​(org.opendaylight.mdsal.binding.api.DataBroker dataBroker, AclDataUtil aclDataUtil, AclserviceConfig config, org.opendaylight.infrautils.jobcoordinator.JobCoordinator jobCoordinator)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static @NonNull java.util.List<Ace> aceList​(@NonNull Acl acl)  
      static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<AclPortsByIp> aclPortsByIpPath​(java.lang.String aclName)  
      void addAclPortsLookup​(AclInterface port, java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> aclList, java.util.List<AllowedAddressPairs> allowedAddresses)  
      void addAclPortsLookupForInterfaceUpdate​(AclInterface portBefore, AclInterface portAfter)  
      static org.opendaylight.genius.mdsalutil.MatchInfoBase buildAclConntrackClassifierTypeMatch​(AclConntrackClassifierType conntrackSupportedType)  
      static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildArpIpMatches​(IpPrefixOrAddress ipPrefixOrAddress)
      Builds the arp ip matches.
      static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildBroadcastIpV4Matches​(java.lang.String ipAddr)  
      static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildDhcpMatches​(int srcPort, int dstPort, int lportTag, java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)
      Returns the DHCP match.
      static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildDhcpV6Matches​(int srcPort, int dstPort, int lportTag, java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)
      Returns the DHCPv6 match.
      static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildIcmpV6Matches​(int icmpType, int icmpCode, int lportTag, java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)
      Returns the ICMPv6 match.
      static java.util.List<? extends org.opendaylight.genius.mdsalutil.MatchInfoBase> buildIpAndDstServiceMatch​(java.lang.Integer aclTag, AllowedAddressPairs aap)  
      static java.util.List<? extends org.opendaylight.genius.mdsalutil.MatchInfoBase> buildIpAndSrcServiceMatch​(java.lang.Integer aclTag, AllowedAddressPairs aap)  
      static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildIpMatches​(IpPrefixOrAddress ipPrefixOrAddress, AclServiceManager.MatchCriteria matchCriteria)
      Builds the ip matches.
      static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildIpProtocolMatches​(org.opendaylight.genius.mdsalutil.matches.MatchEthernetType etherType, org.opendaylight.genius.mdsalutil.packet.IPProtocols protocol)
      Builds the ip protocol matches.
      static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildL2BroadcastMatches()  
      static org.opendaylight.genius.mdsalutil.MatchInfoBase buildLPortTagMatch​(int lportTag, java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)
      Gets the lport tag match.
      static java.util.Collection<? extends org.opendaylight.genius.mdsalutil.MatchInfoBase> buildMatchesForLPortTagAndConntrackClassifierType​(int lportTag, AclConntrackClassifierType conntrackClassifierType, java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)  
      static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildMatchesForLPortTagAndRemoteAclTag​(java.lang.Integer lportTag, java.lang.Integer remoteAclTag, java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)  
      static org.opendaylight.genius.mdsalutil.MatchInfoBase buildRemoteAclTagMetadataMatch​(java.lang.Integer remoteAclTag)  
      static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices> buildServiceId​(java.lang.String interfaceName, short serviceIndex, java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)
      Builds the service id.
      static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface> buildStateInterfaceId​(java.lang.String interfaceName)
      Build the interface state.
      static java.util.List<org.opendaylight.genius.mdsalutil.InstructionInfo> createCtMarkInstructionForNewState​(java.lang.Short filterTable, java.lang.Long elanId)
      This method creates and returns the ct_mark instruction when a ACL rule removed from the instance.
      void deleteAcesFromConfigDS​(java.lang.String aclName, java.util.List<Ace> deletedAceRules)  
      void deleteAclPortsLookup​(AclInterface port, java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> aclList, java.util.List<AllowedAddressPairs> allowedAddresses)  
      void deleteAclPortsLookupForInterfaceUpdate​(AclInterface portBefore, AclInterface portAfter)  
      static boolean doesAceHaveRemoteGroupId​(SecurityRuleAttr aceAttr)
      Does ACE have remote group id.
      static boolean doesIpv4AddressExists​(java.util.List<AllowedAddressPairs> aaps)
      Does IPv4 address exists in the list of allowed address pair.
      static boolean doesIpv6AddressExists​(java.util.List<AllowedAddressPairs> aaps)
      Does IPv6 address exists in the list of allowed address pair.
      boolean doesRemoteAclIdExistsInAcls​(java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> aclIds, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid remoteAclId, java.lang.Class<? extends DirectionBase> direction)  
      static java.util.List<AllowedAddressPairs> excludeMulticastAAPs​(@Nullable java.util.List<AllowedAddressPairs> allowedAddresses)  
      static @Nullable SecurityRuleAttr getAccessListAttributes​(Ace ace)
      Retrieves the security rule attribute augmentation from the access list.
      java.lang.Integer getAceFlowPriority​(java.lang.String aclName)
      Gets the ace flow priority.
      static @NonNull java.util.List<Ace> getAceListFromAcl​(Acl acl)  
      static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<AclIpPrefixes> getAclIpPrefixesPath​(java.lang.String aclName, IpPrefixOrAddress ipPrefix)  
      static java.lang.Integer getAclTag​(Acl acl)
      Gets ACL tag from Acl.
      java.lang.Integer getAclTag​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid aclId)
      Gets the ACL tag from cache.
      static org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices getBoundServices​(java.lang.String serviceName, short servicePriority, int flowPriority, org.opendaylight.yangtools.yang.common.Uint64 cookie, java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> instructions)
      Gets the bound services.
      static java.lang.String getBroadcastAddressFromCidr​(java.lang.String cidr)  
      AclserviceConfig getConfig()  
      static @Nullable java.math.BigInteger getDpIdFromIterfaceState​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface interfaceState)  
      static org.opendaylight.yangtools.yang.common.Uint64 getDropFlowCookie​(int lport)  
      static @Nullable java.lang.Long getElanIdFromInterface​(java.lang.String elanInterfaceName, org.opendaylight.mdsal.binding.api.DataBroker broker)  
      static @Nullable ElanInstance getElanInstanceByName​(java.lang.String elanInstanceName, org.opendaylight.mdsal.binding.api.DataBroker broker)  
      static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<ElanInstance> getElanInstanceConfigurationDataPath​(java.lang.String elanInstanceName)  
      static @Nullable ElanInterface getElanInterfaceByElanInterfaceName​(java.lang.String elanInterfaceName, org.opendaylight.mdsal.binding.api.DataBroker broker)  
      static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<ElanInterface> getElanInterfaceConfigurationDataPathId​(java.lang.String interfaceName)  
      static java.lang.Integer getHardTimoutForApplyStatefulChangeOnExistingTraffic​(Ace ace, AclServiceUtils aclServiceUtils)
      Returns the hard timeout based on the protocol when a ACL rule removed from the instance.
      static java.util.Optional<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface> getInterface​(org.opendaylight.mdsal.binding.api.DataBroker broker, java.lang.String interfaceName)
      Retrieves the Interface from the datastore.
      static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface> getInterfaceIdentifier​(java.lang.String interfaceName)
      Builds the interface identifier.
      static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface getInterfaceStateFromOperDS​(org.opendaylight.mdsal.binding.api.DataBroker dataBroker, java.lang.String interfaceName)
      Retrieves the interface state.
      static java.util.List<java.lang.String> getIpBroadcastAddresses​(java.util.List<SubnetInfo> subnetInfoList)  
      static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<PortIds> getPortIdsPathInAclPortsLookup​(java.lang.String ruleName, IpPrefixOrAddress ipPrefix, java.lang.String portId)  
      static java.lang.String getRecoverServiceRegistryKey()  
      java.util.Set<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> getRemoteAclIdsByDirection​(@Nullable java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> aclIds, java.lang.Class<? extends DirectionBase> direction)  
      static java.util.Set<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> getRemoteAclIdsByDirection​(Acl acl, java.lang.Class<? extends DirectionBase> direction)  
      static org.opendaylight.yangtools.yang.common.Uint64 getRemoteAclTagMetadata​(java.math.BigInteger remoteAclTag)  
      java.util.SortedSet<java.lang.Integer> getRemoteAclTags​(@Nullable java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> aclIds, java.lang.Class<? extends DirectionBase> direction)  
      static java.util.List<SubnetInfo> getSubnetDiff​(java.util.List<SubnetInfo> subnetInfo1, java.util.List<SubnetInfo> subnetInfo2)
      Gets the subnet difference by performing (subnetInfo1 - subnetInfo2).
      static java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> getUpdatedAclList​(java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> updatedAclList, java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> currentAclList)  
      static java.util.List<AllowedAddressPairs> getUpdatedAllowedAddressPairs​(@Nullable java.util.List<AllowedAddressPairs> updatedAllowedAddressPairs, @Nullable java.util.List<AllowedAddressPairs> currentAllowedAddressPairs)  
      static org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata getWriteMetadataForAclClassifierType​(AclConntrackClassifierType conntrackClassifierType)  
      static org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata getWriteMetadataForDropFlag()  
      static org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata getWriteMetadataForRemoteAclTag​(java.lang.Integer remoteAclTag)  
      static boolean isIPv4Address​(AllowedAddressPairs aap)  
      static java.lang.Boolean isIpv6Subnet​(java.util.List<SubnetInfo> subnetInfoList)  
      static boolean isNotIpAllNetwork​(AllowedAddressPairs aap)  
      static boolean isNotIpv4AllNetwork​(AllowedAddressPairs aap)  
      protected static boolean isNotIpv6AllNetwork​(AllowedAddressPairs aap)  
      static boolean isOfInterest​(AclInterface aclInterface)
      Indicates whether the interface has port security enabled or interface is DHCP service port.
      static boolean isOfInterest​(InterfaceAcl aclInterface)
      Indicates whether the interface has port security enabled or interface is DHCP service port.
      static <T extends org.opendaylight.yangtools.yang.binding.DataObject>
      java.util.Optional<T>
      read​(org.opendaylight.mdsal.binding.api.DataBroker broker, org.opendaylight.mdsal.common.api.LogicalDatastoreType datastoreType, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
      Retrieves the object from the datastore.
      boolean skipDeleteInCaseOfOverlappingIP​(java.lang.String portId, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid remoteAclId, IpPrefixOrAddress ipPrefix, int addOrRemove)
      Skip delete in case of overlapping IP.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AclServiceUtils

        @Inject
        public AclServiceUtils​(org.opendaylight.mdsal.binding.api.DataBroker dataBroker,
                               AclDataUtil aclDataUtil,
                               AclserviceConfig config,
                               org.opendaylight.infrautils.jobcoordinator.JobCoordinator jobCoordinator)
    • Method Detail

      • getInterface

        public static java.util.Optional<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface> getInterface​(org.opendaylight.mdsal.binding.api.DataBroker broker,
                                                                                                                                                               java.lang.String interfaceName)
        Retrieves the Interface from the datastore.
        Parameters:
        broker - the data broker
        interfaceName - the interface name
        Returns:
        the interface.
      • getInterfaceIdentifier

        public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface> getInterfaceIdentifier​(java.lang.String interfaceName)
        Builds the interface identifier.
        Parameters:
        interfaceName - the interface name.
        Returns:
        the interface identifier.
      • read

        public static <T extends org.opendaylight.yangtools.yang.binding.DataObject> java.util.Optional<T> read​(org.opendaylight.mdsal.binding.api.DataBroker broker,
                                                                                                                org.opendaylight.mdsal.common.api.LogicalDatastoreType datastoreType,
                                                                                                                org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
        Retrieves the object from the datastore.
        Type Parameters:
        T - type of DataObject
        Parameters:
        broker - the data broker.
        datastoreType - the data store type.
        path - the wild card path.
        Returns:
        the required object.
      • getInterfaceStateFromOperDS

        public static @Nullable org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface getInterfaceStateFromOperDS​(org.opendaylight.mdsal.binding.api.DataBroker dataBroker,
                                                                                                                                                                          java.lang.String interfaceName)
        Retrieves the interface state.
        Parameters:
        dataBroker - the data broker.
        interfaceName - the interface name.
        Returns:
        the interface state.
      • buildStateInterfaceId

        public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface> buildStateInterfaceId​(java.lang.String interfaceName)
        Build the interface state.
        Parameters:
        interfaceName - the interface name.
        Returns:
        the interface state.
      • getAccessListAttributes

        public static @Nullable SecurityRuleAttr getAccessListAttributes​(Ace ace)
        Retrieves the security rule attribute augmentation from the access list.
        Parameters:
        ace - the access list entry
        Returns:
        the security rule attributes
      • buildDhcpMatches

        public static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildDhcpMatches​(int srcPort,
                                                                                                       int dstPort,
                                                                                                       int lportTag,
                                                                                                       java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)
        Returns the DHCP match.
        Parameters:
        srcPort - the source port.
        dstPort - the destination port.
        lportTag - the lport tag
        serviceMode - ingress or egress service
        Returns:
        list of matches.
      • buildDhcpV6Matches

        public static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildDhcpV6Matches​(int srcPort,
                                                                                                         int dstPort,
                                                                                                         int lportTag,
                                                                                                         java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)
        Returns the DHCPv6 match.
        Parameters:
        srcPort - the source port.
        dstPort - the destination port.
        lportTag - the lport tag
        serviceMode - ingress or egress
        Returns:
        list of matches.
      • buildIcmpV6Matches

        public static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildIcmpV6Matches​(int icmpType,
                                                                                                         int icmpCode,
                                                                                                         int lportTag,
                                                                                                         java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)
        Returns the ICMPv6 match.
        Parameters:
        icmpType - the icmpv6-type.
        icmpCode - the icmpv6-code.
        lportTag - the lport tag
        serviceMode - ingress or egress
        Returns:
        list of matches.
      • buildBroadcastIpV4Matches

        public static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildBroadcastIpV4Matches​(java.lang.String ipAddr)
      • buildL2BroadcastMatches

        public static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildL2BroadcastMatches()
      • buildServiceId

        public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices> buildServiceId​(java.lang.String interfaceName,
                                                                                                                                                                                                                                             short serviceIndex,
                                                                                                                                                                                                                                             java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)
        Builds the service id.
        Parameters:
        interfaceName - the interface name
        serviceIndex - the service index
        serviceMode - the service mode
        Returns:
        the instance identifier
      • getBoundServices

        public static org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices getBoundServices​(java.lang.String serviceName,
                                                                                                                                                                                   short servicePriority,
                                                                                                                                                                                   int flowPriority,
                                                                                                                                                                                   org.opendaylight.yangtools.yang.common.Uint64 cookie,
                                                                                                                                                                                   java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> instructions)
        Gets the bound services.
        Parameters:
        serviceName - the service name
        servicePriority - the service priority
        flowPriority - the flow priority
        cookie - the cookie
        instructions - the instructions
        Returns:
        the bound services
      • getUpdatedAclList

        public static java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> getUpdatedAclList​(java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> updatedAclList,
                                                                                                                                                java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> currentAclList)
      • getDpIdFromIterfaceState

        public static @Nullable java.math.BigInteger getDpIdFromIterfaceState​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface interfaceState)
      • getIpBroadcastAddresses

        public static java.util.List<java.lang.String> getIpBroadcastAddresses​(java.util.List<SubnetInfo> subnetInfoList)
      • getBroadcastAddressFromCidr

        public static java.lang.String getBroadcastAddressFromCidr​(java.lang.String cidr)
      • buildIpMatches

        public static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildIpMatches​(IpPrefixOrAddress ipPrefixOrAddress,
                                                                                                     AclServiceManager.MatchCriteria matchCriteria)
        Builds the ip matches.
        Parameters:
        ipPrefixOrAddress - the ip prefix or address
        matchCriteria - the source_ip or destination_ip used for the match
        Returns:
        the list
      • buildArpIpMatches

        public static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildArpIpMatches​(IpPrefixOrAddress ipPrefixOrAddress)
        Builds the arp ip matches.
        Parameters:
        ipPrefixOrAddress - the ip prefix or address
        Returns:
        the MatchInfoBase list
      • buildRemoteAclTagMetadataMatch

        public static org.opendaylight.genius.mdsalutil.MatchInfoBase buildRemoteAclTagMetadataMatch​(java.lang.Integer remoteAclTag)
      • getRemoteAclTagMetadata

        public static org.opendaylight.yangtools.yang.common.Uint64 getRemoteAclTagMetadata​(java.math.BigInteger remoteAclTag)
      • getDropFlowCookie

        public static org.opendaylight.yangtools.yang.common.Uint64 getDropFlowCookie​(int lport)
      • doesIpv4AddressExists

        public static boolean doesIpv4AddressExists​(java.util.List<AllowedAddressPairs> aaps)
        Does IPv4 address exists in the list of allowed address pair.
        Parameters:
        aaps - the allowed address pairs
        Returns:
        true, if successful
      • doesIpv6AddressExists

        public static boolean doesIpv6AddressExists​(java.util.List<AllowedAddressPairs> aaps)
        Does IPv6 address exists in the list of allowed address pair.
        Parameters:
        aaps - the allowed address pairs
        Returns:
        true, if successful
      • buildLPortTagMatch

        public static org.opendaylight.genius.mdsalutil.MatchInfoBase buildLPortTagMatch​(int lportTag,
                                                                                         java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)
        Gets the lport tag match. Ingress match is based on metadata and egress match is based on masked reg6
        Parameters:
        lportTag - the lport tag
        serviceMode - ingress or egress service mode
        Returns:
        the lport tag match
      • buildMatchesForLPortTagAndRemoteAclTag

        public static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildMatchesForLPortTagAndRemoteAclTag​(java.lang.Integer lportTag,
                                                                                                                             java.lang.Integer remoteAclTag,
                                                                                                                             java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)
      • buildMatchesForLPortTagAndConntrackClassifierType

        public static java.util.Collection<? extends org.opendaylight.genius.mdsalutil.MatchInfoBase> buildMatchesForLPortTagAndConntrackClassifierType​(int lportTag,
                                                                                                                                                        AclConntrackClassifierType conntrackClassifierType,
                                                                                                                                                        java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase> serviceMode)
      • getWriteMetadataForAclClassifierType

        public static org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata getWriteMetadataForAclClassifierType​(AclConntrackClassifierType conntrackClassifierType)
      • getWriteMetadataForDropFlag

        public static org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata getWriteMetadataForDropFlag()
      • getWriteMetadataForRemoteAclTag

        public static org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata getWriteMetadataForRemoteAclTag​(java.lang.Integer remoteAclTag)
      • buildAclConntrackClassifierTypeMatch

        public static org.opendaylight.genius.mdsalutil.MatchInfoBase buildAclConntrackClassifierTypeMatch​(AclConntrackClassifierType conntrackSupportedType)
      • isNotIpv6AllNetwork

        protected static boolean isNotIpv6AllNetwork​(AllowedAddressPairs aap)
      • getElanIdFromInterface

        public static @Nullable java.lang.Long getElanIdFromInterface​(java.lang.String elanInterfaceName,
                                                                      org.opendaylight.mdsal.binding.api.DataBroker broker)
      • getElanInterfaceByElanInterfaceName

        public static @Nullable ElanInterface getElanInterfaceByElanInterfaceName​(java.lang.String elanInterfaceName,
                                                                                  org.opendaylight.mdsal.binding.api.DataBroker broker)
      • getElanInterfaceConfigurationDataPathId

        public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<ElanInterface> getElanInterfaceConfigurationDataPathId​(java.lang.String interfaceName)
      • getElanInstanceByName

        public static @Nullable ElanInstance getElanInstanceByName​(java.lang.String elanInstanceName,
                                                                   org.opendaylight.mdsal.binding.api.DataBroker broker)
      • getElanInstanceConfigurationDataPath

        public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<ElanInstance> getElanInstanceConfigurationDataPath​(java.lang.String elanInstanceName)
      • deleteAcesFromConfigDS

        public void deleteAcesFromConfigDS​(java.lang.String aclName,
                                           java.util.List<Ace> deletedAceRules)
      • getAclTag

        public static java.lang.Integer getAclTag​(Acl acl)
        Gets ACL tag from Acl.
        Parameters:
        acl - Acl object
        Returns:
        the acl tag
      • getAclTag

        public java.lang.Integer getAclTag​(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid aclId)
        Gets the ACL tag from cache.
        Parameters:
        aclId - the acl id
        Returns:
        the acl tag
      • isOfInterest

        public static boolean isOfInterest​(AclInterface aclInterface)
        Indicates whether the interface has port security enabled or interface is DHCP service port.
        Parameters:
        aclInterface - the interface.
        Returns:
        true if port is security enabled or is a DHCP service port.
      • isOfInterest

        public static boolean isOfInterest​(InterfaceAcl aclInterface)
        Indicates whether the interface has port security enabled or interface is DHCP service port.
        Parameters:
        aclInterface - the interface.
        Returns:
        true if port is security enabled or is a DHCP service port.
      • buildIpAndSrcServiceMatch

        public static java.util.List<? extends org.opendaylight.genius.mdsalutil.MatchInfoBase> buildIpAndSrcServiceMatch​(java.lang.Integer aclTag,
                                                                                                                          AllowedAddressPairs aap)
      • buildIpAndDstServiceMatch

        public static java.util.List<? extends org.opendaylight.genius.mdsalutil.MatchInfoBase> buildIpAndDstServiceMatch​(java.lang.Integer aclTag,
                                                                                                                          AllowedAddressPairs aap)
      • aceList

        public static @NonNull java.util.List<Ace> aceList​(@NonNull Acl acl)
      • getAceListFromAcl

        public static @NonNull java.util.List<Ace> getAceListFromAcl​(Acl acl)
      • buildIpProtocolMatches

        public static java.util.List<org.opendaylight.genius.mdsalutil.MatchInfoBase> buildIpProtocolMatches​(org.opendaylight.genius.mdsalutil.matches.MatchEthernetType etherType,
                                                                                                             org.opendaylight.genius.mdsalutil.packet.IPProtocols protocol)
        Builds the ip protocol matches.
        Parameters:
        etherType - the ether type
        protocol - the protocol
        Returns:
        the list of matches.
      • doesAceHaveRemoteGroupId

        public static boolean doesAceHaveRemoteGroupId​(SecurityRuleAttr aceAttr)
        Does ACE have remote group id.
        Parameters:
        aceAttr - the ace attr
        Returns:
        true, if successful
      • getRemoteAclTags

        public java.util.SortedSet<java.lang.Integer> getRemoteAclTags​(@Nullable java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> aclIds,
                                                                       java.lang.Class<? extends DirectionBase> direction)
      • getRemoteAclIdsByDirection

        public java.util.Set<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> getRemoteAclIdsByDirection​(@Nullable java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> aclIds,
                                                                                                                                                 java.lang.Class<? extends DirectionBase> direction)
      • getRemoteAclIdsByDirection

        public static java.util.Set<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> getRemoteAclIdsByDirection​(Acl acl,
                                                                                                                                                        java.lang.Class<? extends DirectionBase> direction)
      • skipDeleteInCaseOfOverlappingIP

        public boolean skipDeleteInCaseOfOverlappingIP​(java.lang.String portId,
                                                       org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid remoteAclId,
                                                       IpPrefixOrAddress ipPrefix,
                                                       int addOrRemove)
        Skip delete in case of overlapping IP.

        When there are multiple ports (e.g., p1, p2, p3) having same AAP (e.g., 224.0.0.5) configured which are part of single SG, there would be single flow in remote ACL table. When one of these ports (say p1) is deleted, the single flow which is configured in remote ACL table shouldn't be deleted. It should be deleted only when there are no more references to it.

        Parameters:
        portId - the port id
        remoteAclId - the remote Acl Id
        ipPrefix - the ip prefix
        addOrRemove - the add or remove
        Returns:
        true, if successful
      • doesRemoteAclIdExistsInAcls

        public boolean doesRemoteAclIdExistsInAcls​(java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> aclIds,
                                                   org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid remoteAclId,
                                                   java.lang.Class<? extends DirectionBase> direction)
      • aclPortsByIpPath

        public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<AclPortsByIp> aclPortsByIpPath​(java.lang.String aclName)
      • getAclIpPrefixesPath

        public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<AclIpPrefixes> getAclIpPrefixesPath​(java.lang.String aclName,
                                                                                                                     IpPrefixOrAddress ipPrefix)
      • getPortIdsPathInAclPortsLookup

        public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<PortIds> getPortIdsPathInAclPortsLookup​(java.lang.String ruleName,
                                                                                                                         IpPrefixOrAddress ipPrefix,
                                                                                                                         java.lang.String portId)
      • addAclPortsLookupForInterfaceUpdate

        public void addAclPortsLookupForInterfaceUpdate​(AclInterface portBefore,
                                                        AclInterface portAfter)
      • deleteAclPortsLookupForInterfaceUpdate

        public void deleteAclPortsLookupForInterfaceUpdate​(AclInterface portBefore,
                                                           AclInterface portAfter)
      • addAclPortsLookup

        public void addAclPortsLookup​(AclInterface port,
                                      java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> aclList,
                                      java.util.List<AllowedAddressPairs> allowedAddresses)
      • deleteAclPortsLookup

        public void deleteAclPortsLookup​(AclInterface port,
                                         java.util.List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid> aclList,
                                         java.util.List<AllowedAddressPairs> allowedAddresses)
      • getAceFlowPriority

        public java.lang.Integer getAceFlowPriority​(java.lang.String aclName)
        Gets the ace flow priority.
        Parameters:
        aclName - the acl name
        Returns:
        the ace flow priority
      • getHardTimoutForApplyStatefulChangeOnExistingTraffic

        public static java.lang.Integer getHardTimoutForApplyStatefulChangeOnExistingTraffic​(Ace ace,
                                                                                             AclServiceUtils aclServiceUtils)
        Returns the hard timeout based on the protocol when a ACL rule removed from the instance. It will returns the timeout configured in the AclserviceConfig class.
        Parameters:
        ace - the ace
        aclServiceUtils - acl service utils
        Returns:
        the hard time out
      • createCtMarkInstructionForNewState

        public static java.util.List<org.opendaylight.genius.mdsalutil.InstructionInfo> createCtMarkInstructionForNewState​(java.lang.Short filterTable,
                                                                                                                           java.lang.Long elanId)
        This method creates and returns the ct_mark instruction when a ACL rule removed from the instance. This instruction will reset the ct_mark value and stops the existing traffics.
        Parameters:
        filterTable - the filterTable
        elanId - the Elan id
        Returns:
        list of instruction
      • getRecoverServiceRegistryKey

        public static java.lang.String getRecoverServiceRegistryKey()
      • isIpv6Subnet

        public static java.lang.Boolean isIpv6Subnet​(java.util.List<SubnetInfo> subnetInfoList)
      • getSubnetDiff

        public static java.util.List<SubnetInfo> getSubnetDiff​(java.util.List<SubnetInfo> subnetInfo1,
                                                               java.util.List<SubnetInfo> subnetInfo2)
        Gets the subnet difference by performing (subnetInfo1 - subnetInfo2).
        Parameters:
        subnetInfo1 - the subnet info 1
        subnetInfo2 - the subnet info 2
        Returns:
        the subnet diff