Search in sources :

Example 1 with Uint64

use of org.opendaylight.yangtools.yang.common.Uint64 in project netvirt by opendaylight.

the class IngressAclServiceImpl method programCommitterDropFlow.

private void programCommitterDropFlow(List<FlowEntity> flowEntries, Uint64 dpId, int lportTag, int addOrRemove) {
    List<MatchInfoBase> matches = new ArrayList<>();
    List<InstructionInfo> instructions = AclServiceOFFlowBuilder.getDropInstructionInfo();
    Uint64 metaData = Uint64.fromLongBits(MetaDataUtil.METADATA_MASK_ACL_DROP.longValue() & (AclConstants.METADATA_DROP_FLAG.longValue() << 2));
    Uint64 metaDataMask = Uint64.fromLongBits(MetaDataUtil.METADATA_MASK_ACL_DROP.longValue() & (AclConstants.METADATA_DROP_FLAG.longValue() << 2));
    matches.add(new NxMatchRegister(NxmNxReg6.class, MetaDataUtil.getLportTagForReg6(lportTag).longValue(), MetaDataUtil.getLportTagMaskForReg6()));
    matches.add(new MatchMetadata(metaData, metaDataMask));
    String flowName = "Ingress_" + dpId + "_" + lportTag + "_Drop";
    addFlowEntryToList(flowEntries, dpId, getAclCommitterTable(), flowName, AclConstants.CT_STATE_TRACKED_INVALID_PRIORITY, 0, 0, AclServiceUtils.getDropFlowCookie(lportTag), matches, instructions, addOrRemove);
}
Also used : MatchMetadata(org.opendaylight.genius.mdsalutil.matches.MatchMetadata) InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) NxmNxReg6(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6) ArrayList(java.util.ArrayList) NxMatchRegister(org.opendaylight.genius.mdsalutil.nxmatches.NxMatchRegister) MatchInfoBase(org.opendaylight.genius.mdsalutil.MatchInfoBase) Uint64(org.opendaylight.yangtools.yang.common.Uint64)

Example 2 with Uint64

use of org.opendaylight.yangtools.yang.common.Uint64 in project netvirt by opendaylight.

the class IngressAclServiceImpl method programAntiSpoofingRules.

@Override
protected void programAntiSpoofingRules(List<FlowEntity> flowEntries, AclInterface port, List<AllowedAddressPairs> allowedAddresses, Action action, int addOrRemove) {
    LOG.info("{} programAntiSpoofingRules for port {}, AAPs={}, action={}, addOrRemove={}", this.directionString, port.getInterfaceId(), allowedAddresses, action, addOrRemove);
    Uint64 dpid = Uint64.valueOf(port.getDpId());
    int lportTag = port.getLPortTag();
    if (action == Action.ADD || action == Action.REMOVE) {
        programCommitterDropFlow(flowEntries, dpid, lportTag, addOrRemove);
        ingressAclDhcpAllowServerTraffic(flowEntries, dpid, lportTag, addOrRemove);
        ingressAclDhcpv6AllowServerTraffic(flowEntries, dpid, lportTag, addOrRemove);
        ingressAclIcmpv6AllowedTraffic(flowEntries, port, InterfaceType.AccessPort, addOrRemove);
        programIcmpv6RARule(flowEntries, port, port.getSubnetInfo(), addOrRemove);
        programArpRule(flowEntries, dpid, lportTag, addOrRemove);
        programIpv4BroadcastRule(flowEntries, port, port.getSubnetInfo(), addOrRemove);
    }
}
Also used : Uint64(org.opendaylight.yangtools.yang.common.Uint64)

Example 3 with Uint64

use of org.opendaylight.yangtools.yang.common.Uint64 in project netvirt by opendaylight.

the class IngressAclServiceImpl method programIcmpv6RARule.

@Override
protected void programIcmpv6RARule(List<FlowEntity> flowEntries, AclInterface port, List<SubnetInfo> subnets, int addOrRemove) {
    if (!AclServiceUtils.isIpv6Subnet(subnets)) {
        return;
    }
    Uint64 dpid = Uint64.valueOf(port.getDpId());
    /* Allow ICMPv6 Router Advertisement packets from external routers as well as internal routers
         * if subnet is configured with IPv6 version
         * Allow ICMPv6 Router Advertisement packets if originating from any LinkLocal Address.
         */
    List<InstructionInfo> instructions = getDispatcherTableResubmitInstructions();
    List<MatchInfoBase> matches = AclServiceUtils.buildIcmpV6Matches(AclConstants.ICMPV6_TYPE_RA, 0, port.getLPortTag(), serviceMode);
    matches.addAll(AclServiceUtils.buildIpMatches(new IpPrefixOrAddress(IpPrefixBuilder.getDefaultInstance(AclConstants.IPV6_LINK_LOCAL_PREFIX)), AclServiceManager.MatchCriteria.MATCH_SOURCE));
    String flowName = "Ingress_ICMPv6" + "_" + dpid + "_" + port.getLPortTag() + "_" + AclConstants.ICMPV6_TYPE_RA + "_LinkLocal_Permit_";
    addFlowEntryToList(flowEntries, dpid, getAclAntiSpoofingTable(), flowName, AclConstants.PROTO_IPV6_ALLOWED_PRIORITY, 0, 0, AclConstants.COOKIE_ACL_BASE, matches, instructions, addOrRemove);
}
Also used : InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) IpPrefixOrAddress(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.IpPrefixOrAddress) MatchInfoBase(org.opendaylight.genius.mdsalutil.MatchInfoBase) Uint64(org.opendaylight.yangtools.yang.common.Uint64)

Example 4 with Uint64

use of org.opendaylight.yangtools.yang.common.Uint64 in project netvirt by opendaylight.

the class AclNodeDefaultFlowsTxBuilder method addFlowToTx.

private void addFlowToTx(short tableId, String flowId, int priority, List<? extends MatchInfoBase> matches, List<InstructionInfo> instructions) {
    int idleTimeOut = 0;
    int hardTimeOut = 0;
    Uint64 cookie = AclConstants.COOKIE_ACL_BASE;
    FlowEntity flowEntity = MDSALUtil.buildFlowEntity(Uint64.valueOf(this.dpId.toString()), tableId, flowId, priority, flowId, idleTimeOut, hardTimeOut, cookie, matches, instructions);
    LOG.trace("Installing Acl default Flow:: DpnId: {}, flowId: {}, flowName: {}, tableId: {}", dpId.toString(), flowId, flowId, tableId);
    mdsalManager.addFlow(tx, flowEntity);
}
Also used : Uint64(org.opendaylight.yangtools.yang.common.Uint64) FlowEntity(org.opendaylight.genius.mdsalutil.FlowEntity)

Example 5 with Uint64

use of org.opendaylight.yangtools.yang.common.Uint64 in project netvirt by opendaylight.

the class ElanUtils method deleteMacFlows.

public void deleteMacFlows(ElanInstance elanInfo, InterfaceInfo interfaceInfo, String macAddress, boolean deleteSmac, TypedReadWriteTransaction<Configuration> flowTx) throws ExecutionException, InterruptedException {
    String elanInstanceName = elanInfo.getElanInstanceName();
    List<DpnInterfaces> remoteFEs = getInvolvedDpnsInElan(elanInstanceName);
    Uint64 srcdpId = interfaceInfo.getDpId();
    boolean isFlowsRemovedInSrcDpn = false;
    for (DpnInterfaces dpnInterface : remoteFEs) {
        Uint32 elanTag = elanInfo.getElanTag();
        Uint64 dstDpId = dpnInterface.getDpId();
        if (executeDeleteMacFlows(elanInfo, interfaceInfo, macAddress, deleteSmac, elanInstanceName, srcdpId, elanTag, dstDpId, flowTx)) {
            isFlowsRemovedInSrcDpn = true;
        }
        executeEtreeDeleteMacFlows(elanInfo, interfaceInfo, macAddress, deleteSmac, elanInstanceName, srcdpId, elanTag, dstDpId, flowTx);
    }
    if (!isFlowsRemovedInSrcDpn) {
        deleteSmacAndDmacFlows(elanInfo, interfaceInfo, macAddress, deleteSmac, flowTx);
    }
}
Also used : DpnInterfaces(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.dpn.interfaces.elan.dpn.interfaces.list.DpnInterfaces) ElanDpnInterfaces(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.ElanDpnInterfaces) Uint32(org.opendaylight.yangtools.yang.common.Uint32) Uint64(org.opendaylight.yangtools.yang.common.Uint64)

Aggregations

Uint64 (org.opendaylight.yangtools.yang.common.Uint64)306 ArrayList (java.util.ArrayList)119 Uint32 (org.opendaylight.yangtools.yang.common.Uint32)104 ExecutionException (java.util.concurrent.ExecutionException)86 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)66 DataBroker (org.opendaylight.mdsal.binding.api.DataBroker)65 ManagedNewTransactionRunner (org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner)64 ManagedNewTransactionRunnerImpl (org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl)64 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)64 Logger (org.slf4j.Logger)63 LoggerFactory (org.slf4j.LoggerFactory)63 Inject (javax.inject.Inject)59 Singleton (javax.inject.Singleton)59 List (java.util.List)58 LogicalDatastoreType (org.opendaylight.mdsal.common.api.LogicalDatastoreType)58 CONFIGURATION (org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION)54 Optional (java.util.Optional)49 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)48 Collections (java.util.Collections)48 InstructionInfo (org.opendaylight.genius.mdsalutil.InstructionInfo)48