• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Instruction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction的典型用法代码示例。如果您正苦于以下问题:Java Instruction类的具体用法?Java Instruction怎么用?Java Instruction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Instruction类属于org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list包,在下文中一共展示了Instruction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createFibTableCustomInstructions

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
private List<Instruction> createFibTableCustomInstructions(short tableId, String routerName,
        String externalIp) {
    List<Instruction> fibTableCustomInstructions = new ArrayList<>();
    Routers router = NatUtil.getRoutersFromConfigDS(dataBroker, routerName);
    long externalSubnetVpnId = NatUtil.getExternalSubnetVpnIdForRouterExternalIp(dataBroker,
            externalIp, router);
    int instructionIndex = 0;
    if (externalSubnetVpnId != NatConstants.INVALID_ID) {
        BigInteger subnetIdMetaData = MetaDataUtil.getVpnIdMetadata(externalSubnetVpnId);
        fibTableCustomInstructions.add(new InstructionWriteMetadata(subnetIdMetaData,
                MetaDataUtil.METADATA_MASK_VRFID).buildInstruction(instructionIndex));
        instructionIndex++;
    }

    fibTableCustomInstructions.add(new InstructionGotoTable(tableId).buildInstruction(instructionIndex));
    return fibTableCustomInstructions;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:18,代码来源:ExternalRoutersListener.java


示例2: makeLFibTableEntry

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
private void makeLFibTableEntry(BigInteger dpId, long serviceId, short tableId, WriteTransaction writeFlowInvTx) {
    List<MatchInfo> matches = new ArrayList<>();
    matches.add(MatchEthernetType.MPLS_UNICAST);
    matches.add(new MatchMplsLabel(serviceId));

    List<Instruction> instructions = new ArrayList<>();
    List<ActionInfo> actionsInfos = new ArrayList<>();
    actionsInfos.add(new ActionPopMpls());
    Instruction writeInstruction = new InstructionApplyActions(actionsInfos).buildInstruction(0);
    instructions.add(writeInstruction);
    instructions.add(new InstructionGotoTable(tableId).buildInstruction(1));

    // Install the flow entry in L3_LFIB_TABLE
    String flowRef = getFlowRef(dpId, NwConstants.L3_LFIB_TABLE, serviceId, "");

    Flow flowEntity = MDSALUtil.buildFlowNew(NwConstants.L3_LFIB_TABLE, flowRef,
        10, flowRef, 0, 0,
        COOKIE_VM_LFIB_TABLE, matches, instructions);

    mdsalManager.addFlowToTx(dpId, flowEntity, writeFlowInvTx);

    LOG.debug("makeLFibTableEntry : LFIB Entry for dpID {} : label : {} modified successfully", dpId, serviceId);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:24,代码来源:ExternalRoutersListener.java


示例3: makeTunnelTableEntry

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
private void makeTunnelTableEntry(BigInteger dpnId, long serviceId, long l3Vni,
         List<Instruction> customInstructions, WriteTransaction writeFlowInvTx, ProviderTypes extNwProvType) {
    List<MatchInfo> mkMatches = new ArrayList<>();

    LOG.debug("makeTunnelTableEntry : DpnId = {} and serviceId = {} and actions = {}",
        dpnId, serviceId, customInstructions);

    if (NatUtil.isOpenStackVniSemanticsEnforcedForGreAndVxlan(elanManager, extNwProvType)) {
        mkMatches.add(new MatchTunnelId(BigInteger.valueOf(l3Vni)));
    } else {
        mkMatches.add(new MatchTunnelId(BigInteger.valueOf(serviceId)));
    }

    Flow terminatingServiceTableFlowEntity = MDSALUtil.buildFlowNew(NwConstants.INTERNAL_TUNNEL_TABLE,
        getFlowRef(dpnId, NwConstants.INTERNAL_TUNNEL_TABLE, serviceId, ""), 5,
        String.format("%s:%d", "TST Flow Entry ", serviceId),
        0, 0, COOKIE_TUNNEL.add(BigInteger.valueOf(serviceId)), mkMatches, customInstructions);

    mdsalManager.addFlowToTx(dpnId, terminatingServiceTableFlowEntity, writeFlowInvTx);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:21,代码来源:ExternalRoutersListener.java


示例4: makeL3GwMacTableEntry

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
static void makeL3GwMacTableEntry(final BigInteger dpnId, final long vpnId, String macAddress,
                                  List<Instruction> customInstructions, IMdsalApiManager mdsalManager,
                                  WriteTransaction writeFlowTx) {
    List<MatchInfo> matchInfo = new ArrayList<>();
    matchInfo.add(new MatchMetadata(MetaDataUtil.getVpnIdMetadata(vpnId), MetaDataUtil.METADATA_MASK_VRFID));
    matchInfo.add(new MatchEthernetDestination(new MacAddress(macAddress)));
    LOG.debug("makeL3GwMacTableEntry : Create flow table {} -> table {} for External Vpn Id = {} "
            + "and MacAddress = {} on DpnId = {}",
            NwConstants.L3_GW_MAC_TABLE, NwConstants.INBOUND_NAPT_TABLE, vpnId, macAddress, dpnId);
    // Install the flow entry in L3_GW_MAC_TABLE
    String flowRef = NatUtil.getFlowRef(dpnId, NwConstants.L3_GW_MAC_TABLE, vpnId, macAddress);
    Flow l3GwMacTableFlowEntity = MDSALUtil.buildFlowNew(NwConstants.L3_GW_MAC_TABLE,
            flowRef, 21, flowRef, 0, 0, NwConstants.COOKIE_L3_GW_MAC_TABLE, matchInfo, customInstructions);

    mdsalManager.addFlowToTx(dpnId, l3GwMacTableFlowEntity, writeFlowTx);
    LOG.debug("makeL3GwMacTableEntry : Successfully created flow entity {} on DPN = {}",
            l3GwMacTableFlowEntity, dpnId);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:NatEvpnUtil.java


示例5: makePreDnatToSnatTableEntry

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
public static void makePreDnatToSnatTableEntry(IMdsalApiManager mdsalManager, BigInteger naptDpnId,
        short tableId, WriteTransaction writeFlowTx) {
    LOG.debug("makePreDnatToSnatTableEntry : Create Pre-DNAT table {} --> table {} flow on NAPT DpnId {} ",
            NwConstants.PDNAT_TABLE, tableId, naptDpnId);

    List<Instruction> preDnatToSnatInstructions = new ArrayList<>();
    preDnatToSnatInstructions.add(new InstructionGotoTable(tableId).buildInstruction(0));
    List<MatchInfo> matches = new ArrayList<>();
    matches.add(MatchEthernetType.IPV4);
    String flowRef = getFlowRefPreDnatToSnat(naptDpnId, NwConstants.PDNAT_TABLE, "PreDNATToSNAT");
    Flow preDnatToSnatTableFlowEntity = MDSALUtil.buildFlowNew(NwConstants.PDNAT_TABLE,flowRef,
            5, flowRef, 0, 0,  NwConstants.COOKIE_DNAT_TABLE,
            matches, preDnatToSnatInstructions);

    mdsalManager.addFlowToTx(naptDpnId, preDnatToSnatTableFlowEntity, writeFlowTx);
    LOG.debug("makePreDnatToSnatTableEntry : Successfully installed Pre-DNAT flow {} on NAPT DpnId {} ",
            preDnatToSnatTableFlowEntity,  naptDpnId);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:NatUtil.java


示例6: makeTunnelTableEntry

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
private void makeTunnelTableEntry(String vpnName, BigInteger dpnId, long serviceId,
        List<Instruction> customInstructions, WriteTransaction writeFlowInvTx, ProviderTypes provType) {
    List<MatchInfo> mkMatches = new ArrayList<>();

    LOG.info("makeTunnelTableEntry on DpnId = {} and serviceId = {}", dpnId, serviceId);
    int flowPriority = 5;
    // Increased the 36->25 flow priority. If SNAT is also configured on the same
    // DPN, then the traffic will be hijacked to DNAT and if there are no DNAT match,
    // then handled back to using using flow 25->44(which will be installed as part of SNAT)
    if (NatUtil.isOpenStackVniSemanticsEnforcedForGreAndVxlan(elanService, provType)) {
        mkMatches.add(new MatchTunnelId(NatOverVxlanUtil.getInternetVpnVni(idManager, vpnName, serviceId)));
        flowPriority = 6;
    } else {
        mkMatches.add(new MatchTunnelId(BigInteger.valueOf(serviceId)));
    }

    Flow terminatingServiceTableFlowEntity = MDSALUtil.buildFlowNew(NwConstants.INTERNAL_TUNNEL_TABLE,
        getFlowRef(dpnId, NwConstants.INTERNAL_TUNNEL_TABLE, serviceId, ""), flowPriority,
        String.format("%s:%d", "TST Flow Entry ", serviceId),
        0, 0, COOKIE_TUNNEL.add(BigInteger.valueOf(serviceId)), mkMatches, customInstructions);

    mdsalManager.addFlowToTx(dpnId, terminatingServiceTableFlowEntity, writeFlowInvTx);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:24,代码来源:VpnFloatingIpHandler.java


示例7: makeLFibTableEntry

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
private void makeLFibTableEntry(BigInteger dpId, long serviceId, String floatingIpPortMacAddress, short tableId,
                                WriteTransaction writeFlowInvTx) {
    List<MatchInfo> matches = new ArrayList<>();
    matches.add(MatchEthernetType.MPLS_UNICAST);
    matches.add(new MatchMplsLabel(serviceId));

    List<Instruction> instructions = new ArrayList<>();
    List<ActionInfo> actionsInfos = new ArrayList<>();
    actionsInfos.add(new ActionPopMpls());
    actionsInfos.add(new ActionSetFieldEthernetDestination(new MacAddress(floatingIpPortMacAddress)));
    Instruction writeInstruction = new InstructionApplyActions(actionsInfos).buildInstruction(0);
    instructions.add(writeInstruction);
    instructions.add(new InstructionGotoTable(tableId).buildInstruction(1));

    // Install the flow entry in L3_LFIB_TABLE
    String flowRef = getFlowRef(dpId, NwConstants.L3_LFIB_TABLE, serviceId, "");

    Flow flowEntity = MDSALUtil.buildFlowNew(NwConstants.L3_LFIB_TABLE, flowRef,
        10, flowRef, 0, 0,
        NwConstants.COOKIE_VM_LFIB_TABLE, matches, instructions);

    mdsalManager.addFlowToTx(dpId, flowEntity, writeFlowInvTx);

    LOG.debug("makeLFibTableEntry : LFIB Entry for dpID {} : label : {} modified successfully {}", dpId, serviceId);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:26,代码来源:VpnFloatingIpHandler.java


示例8: buildLPortDispFromScfToL3VpnFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
/**
 * Build the flow that must be inserted when there is a ScHop whose
 * egressPort is a VPN Pseudo Port. In that case, packets must be moved
 * from the SCF to VPN Pipeline.
 * <p>
 * Flow matches:  VpnPseudo port lPortTag + SI=L3VPN
 * Actions: Write vrfTag in Metadata + goto FIB Table
 * </p>
 * @param vpnId Dataplane identifier of the VPN, the Vrf Tag.
 * @param dpId The DPN where the flow must be installed/removed
 * @param lportTag Dataplane identifier for the VpnPseudoPort
 * @param addOrRemove States if it must build a Flow to be created or
 *     removed
 *
 * @return the Flow object
 */
public static Flow buildLPortDispFromScfToL3VpnFlow(Long vpnId, BigInteger dpId, Integer lportTag,
                                                    int addOrRemove) {
    LOG.info("buildLPortDispFlowForScf vpnId={} dpId={} lportTag={} addOrRemove={} ",
             vpnId, dpId, lportTag, addOrRemove);
    List<MatchInfo> matches = buildMatchOnLportTagAndSI(lportTag,
                                                        ServiceIndex.getIndex(NwConstants.L3VPN_SERVICE_NAME,
                                                                              NwConstants.L3VPN_SERVICE_INDEX));
    List<Instruction> instructions = buildSetVrfTagAndGotoFibInstructions(vpnId.intValue());

    String flowRef = getScfToL3VpnLportDispatcherFlowRef(lportTag);

    Flow result;
    if (addOrRemove == NwConstants.ADD_FLOW) {
        result = MDSALUtil.buildFlowNew(NwConstants.LPORT_DISPATCHER_TABLE, flowRef,
                                        CloudServiceChainConstants.DEFAULT_SCF_FLOW_PRIORITY, flowRef,
                                        0, 0, VpnServiceChainUtils.getCookieL3(vpnId.intValue()),
                                        matches, instructions);

    } else {
        result = new FlowBuilder().setTableId(NwConstants.LPORT_DISPATCHER_TABLE)
                                  .setId(new FlowId(flowRef))
                                  .build();
    }
    return result;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:42,代码来源:VpnServiceChainUtils.java


示例9: bindScfOnVpnInterface

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
public void bindScfOnVpnInterface(String ifName, int scfTag) {
    LOG.debug("bind SCF tag {} on iface {}", scfTag, ifName);
    if (isServiceBoundOnInterface(NwConstants.SCF_SERVICE_INDEX, ifName)) {
        LOG.info("SCF is already bound on Interface {} for Ingress. Binding aborted", ifName);
        return;
    }
    Action loadReg2Action = new ActionRegLoad(1, NxmNxReg2.class, 0, 31, scfTag).buildAction();
    List<Instruction> instructions =
        Arrays.asList(MDSALUtil.buildApplyActionsInstruction(Collections.singletonList(loadReg2Action)),
                      MDSALUtil.buildAndGetGotoTableInstruction(NwConstants.SCF_DOWN_SUB_FILTER_TCP_BASED_TABLE,
                                                                1 /*instructionKey, not sure why it is needed*/));
    BoundServices boundServices =
        InterfaceServiceUtil.getBoundServices(ifName, NwConstants.SCF_SERVICE_INDEX,
                                              CloudServiceChainConstants.DEFAULT_SCF_FLOW_PRIORITY,
                                              CloudServiceChainConstants.COOKIE_SCF_BASE,
                                              instructions);
    interfaceManager.bindService(ifName, ServiceModeIngress.class, boundServices);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:VPNServiceChainHandler.java


示例10: createFibEntry

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
/**
 * To install FIB routes on specified dpn with given instructions.
 */
@Override
public Future<RpcResult<Void>> createFibEntry(CreateFibEntryInput input) {

    BigInteger dpnId = input.getSourceDpid();
    String vpnName = input.getVpnName();
    long vpnId = getVpnId(dataBroker, vpnName);
    String vpnRd = getVpnRd(dataBroker, vpnName);
    String ipAddress = input.getIpAddress();
    LOG.info("Create custom FIB entry - {} on dpn {} for VPN {} ", ipAddress, dpnId, vpnName);
    List<Instruction> instructions = input.getInstruction();
    LOG.info("ADD: Adding Custom Fib Entry rd {} prefix {} label {}", vpnRd, ipAddress, input.getServiceId());
    makeLocalFibEntry(vpnId, dpnId, ipAddress, instructions);
    IpAddresses.IpAddressSource ipAddressSource = IpAddresses.IpAddressSource
            .forValue(input.getIpAddressSource().getIntValue());
    vpnFootprintService.updateVpnToDpnMapping(dpnId, vpnName, vpnRd, null /* interfaceName*/,
            new ImmutablePair<>(ipAddressSource, ipAddress), true /*add*/);
    LOG.info("ADD: Added Custom Fib Entry rd {} prefix {} label {}", vpnRd, ipAddress, input.getServiceId());
    return Futures.immediateFuture(RpcResultBuilder.<Void>success().build());
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:23,代码来源:FibRpcServiceImpl.java


示例11: wrapActionsIntoApplyActionsInstruction

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
public static InstructionsBuilder wrapActionsIntoApplyActionsInstruction(List<Action> theActions) {
    // Create an Apply Action
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(theActions);

    // Wrap our Apply Action in an Instruction
    InstructionBuilder ib = new InstructionBuilder();
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
    ib.setOrder(0);
    ib.setKey(new InstructionKey(0));

    // Put our Instruction in a list of Instructions
    List<Instruction> instructions = new ArrayList<>();
    instructions.add(ib.build());
    return new InstructionsBuilder().setInstruction(instructions);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:OpenFlow13Utils.java


示例12: getBoundServicesForVpnInterface

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
static BoundServices getBoundServicesForVpnInterface(DataBroker broker, String vpnName, String interfaceName) {
    List<Instruction> instructions = new ArrayList<>();
    int instructionKey = 0;
    final long vpnId = VpnUtil.getVpnId(broker, vpnName);
    List<Action> actions = Collections.singletonList(
            new ActionRegLoad(0, VpnConstants.VPN_REG_ID, 0, VpnConstants.VPN_ID_LENGTH, vpnId).buildAction());
    instructions.add(MDSALUtil.buildApplyActionsInstruction(actions, ++instructionKey));
    instructions.add(
            MDSALUtil.buildAndGetWriteMetadaInstruction(MetaDataUtil.getVpnIdMetadata(vpnId),
                    MetaDataUtil.METADATA_MASK_VRFID, ++instructionKey));
    instructions.add(MDSALUtil.buildAndGetGotoTableInstruction(NwConstants.L3_GW_MAC_TABLE,
            ++instructionKey));
    BoundServices serviceInfo = InterfaceUtils.getBoundServices(
            String.format("%s.%s.%s", "vpn", vpnName, interfaceName),
            ServiceIndex.getIndex(NwConstants.L3VPN_SERVICE_NAME, NwConstants.L3VPN_SERVICE_INDEX),
            VpnConstants.DEFAULT_FLOW_PRIORITY, NwConstants.COOKIE_VM_INGRESS_TABLE, instructions);
    return serviceInfo;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:VpnUtil.java


示例13: addArpResponderFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
public void addArpResponderFlow(BigInteger dpnId, String ingressInterfaceName, String ipAddress, String macAddress,
        int lportTag, List<Instruction> instructions) {
    LOG.info("Installing the ARP responder flow on DPN {} for Interface {} with MAC {} & IP {}", dpnId,
            ingressInterfaceName, macAddress, ipAddress);
    ElanInterface elanIface = getElanInterfaceByElanInterfaceName(broker, ingressInterfaceName);
    ElanInstance elanInstance = getElanInstanceByName(broker, elanIface.getElanInstanceName());
    if (elanInstance == null) {
        LOG.debug("addArpResponderFlow: elanInstance is null, Failed to install arp responder flow for Interface {}"
                  + " with MAC {} & IP {}", dpnId,
            ingressInterfaceName, macAddress, ipAddress);
        return;
    }
    String flowId = ArpResponderUtil.getFlowId(lportTag, ipAddress);
    ArpResponderUtil.installFlow(mdsalManager, dpnId, flowId, flowId, NwConstants.DEFAULT_ARP_FLOW_PRIORITY,
            ArpResponderUtil.generateCookie(lportTag, ipAddress),
            ArpResponderUtil.getMatchCriteria(lportTag, elanInstance, ipAddress), instructions);
    LOG.info("Installed the ARP Responder flow for Interface {}", ingressInterfaceName);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:ElanUtils.java


示例14: buildDmacFlowForExternalRemoteMac

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
/**
 * Builds a Flow to be programmed in a DPN's DMAC table. This method must be
 * used when the MAC is located in an External Device (TOR). The flow
 * matches on the specified MAC and 1) sends the packet over the CSS-TOR
 * tunnel if SHFlag is not set, or 2) drops it if SHFlag is set (what means
 * the packet came from an external tunnel)
 *
 * @param dpId
 *            DPN whose DMAC table is going to be modified
 * @param extDeviceNodeId
 *            Hwvtep node where the mac is attached to
 * @param elanTag
 *            ElanId to which the MAC is being added to
 * @param vni
 *            the vni
 * @param dstMacAddress
 *            The mac address to be programmed
 * @param displayName
 *            the display name
 * @return the flow
 * @throws ElanException in case of issues creating the flow objects
 */
@SuppressWarnings("checkstyle:IllegalCatch")
public Flow buildDmacFlowForExternalRemoteMac(BigInteger dpId, String extDeviceNodeId, long elanTag,
        Long vni, String dstMacAddress, String displayName) throws ElanException {
    List<MatchInfo> mkMatches =
            ElanUtils.buildMatchesForElanTagShFlagAndDstMac(elanTag, /* shFlag */ false, dstMacAddress);
    List<Instruction> mkInstructions = new ArrayList<>();
    try {
        List<Action> actions =
                elanItmUtils.getExternalTunnelItmEgressAction(dpId, new NodeId(extDeviceNodeId), vni);
        mkInstructions.add(MDSALUtil.buildApplyActionsInstruction(actions));
    } catch (Exception e) {
        LOG.error("Could not get Egress Actions for DpId=" + dpId + ", externalNode=" + extDeviceNodeId, e);
    }

    return MDSALUtil.buildFlowNew(NwConstants.ELAN_DMAC_TABLE,
            ElanUtils.getKnownDynamicmacFlowRef(NwConstants.ELAN_DMAC_TABLE, dpId, extDeviceNodeId, dstMacAddress,
                    elanTag, false),
            20, /* prio */
            displayName, 0, /* idleTimeout */
            0, /* hardTimeout */
            ElanConstants.COOKIE_ELAN_KNOWN_DMAC.add(BigInteger.valueOf(elanTag)), mkMatches, mkInstructions);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:45,代码来源:ElanDmacUtils.java


示例15: bindElanServiceToExternalTunnel

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
public void bindElanServiceToExternalTunnel(String elanName, String interfaceName) {
    WriteTransaction tx = broker.newWriteOnlyTransaction();
    int instructionKey = 0;
    LOG.trace("Binding external interface {} elan {}", interfaceName, elanName);
    List<Instruction> instructions = new ArrayList<>();
    instructions.add(MDSALUtil.buildAndGetGotoTableInstruction(
            NwConstants.L2VNI_EXTERNAL_TUNNEL_DEMUX_TABLE, ++instructionKey));
    short elanServiceIndex = ServiceIndex.getIndex(NwConstants.ELAN_SERVICE_NAME, NwConstants.ELAN_SERVICE_INDEX);
    BoundServices serviceInfo = ElanUtils.getBoundServices(
            ElanUtils.getElanServiceName(elanName, interfaceName), elanServiceIndex,
            NwConstants.ELAN_SERVICE_INDEX, NwConstants.COOKIE_ELAN_INGRESS_TABLE, instructions);
    InstanceIdentifier<BoundServices> bindServiceId = ElanUtils.buildServiceId(interfaceName, elanServiceIndex);
    Optional<BoundServices> existingElanService = elanUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
            bindServiceId);
    if (!existingElanService.isPresent()) {
        tx.put(LogicalDatastoreType.CONFIGURATION, bindServiceId, serviceInfo, true);
        tx.submit();
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:EvpnUtils.java


示例16: evpnBuildDmacFlowForExternalRemoteMac

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
public Flow evpnBuildDmacFlowForExternalRemoteMac(EvpnDmacFlow evpnDmacFlow) {
    List<MatchInfo> mkMatches = ElanUtils.buildMatchesForElanTagShFlagAndDstMac(evpnDmacFlow.getElanTag(), false,
            evpnDmacFlow.getDstMacAddress());
    List<Instruction> mkInstructions = new ArrayList<>();
    List<Action> actions = elanItmUtils.getExternalTunnelItmEgressAction(evpnDmacFlow.getDpId(),
            evpnDmacFlow.getNexthopIP(), evpnDmacFlow.getVni());
    mkInstructions.add(MDSALUtil.buildApplyActionsInstruction(actions));
    Flow flow = MDSALUtil.buildFlowNew(NwConstants.ELAN_DMAC_TABLE,
            ElanUtils.getKnownDynamicmacFlowRef(NwConstants.ELAN_DMAC_TABLE, evpnDmacFlow.getDpId(),
                    evpnDmacFlow.getNexthopIP(), evpnDmacFlow.getDstMacAddress(), evpnDmacFlow.getElanTag(), false),
            20, evpnDmacFlow.getElanName(), 0, 0,
            ElanConstants.COOKIE_ELAN_KNOWN_DMAC.add(BigInteger.valueOf(evpnDmacFlow.getElanTag())), mkMatches,
            mkInstructions);

    return flow;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:ElanEvpnFlowUtils.java


示例17: createInstruction

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
private Instructions createInstruction(final MeterId meterId) {
    MeterBuilder meterBuilder = new MeterBuilder();
    meterBuilder.setMeterId(meterId);

    Instruction instruction = new InstructionBuilder()
            .setOrder(0)
            .setInstruction(new MeterCaseBuilder()
                    .setMeter(meterBuilder.build()).build()).build();

    List<Instruction> instructions = new ArrayList<>();
    instructions.add(instruction);

    InstructionsBuilder instructionsBuilder = new InstructionsBuilder();
    instructionsBuilder.setInstruction(instructions);
    return instructionsBuilder.build();
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:17,代码来源:OFRuleWithMeterManager.java


示例18: createOutputInstructions

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
/**
 * Creates a set of Instruction based on the port values
 * received.
 * @param portValues Represents ports (example LOCAL, CONTROLLER, etc) {@link OutputPortValues}}
 * @return OpenFlow Flow Instructions
 */
protected Instructions createOutputInstructions(OutputPortValues... portValues) {
    List<Action> actionList = Lists.newArrayList();
    int order = 0;
    for (OutputPortValues outputPort : portValues) {
        if (outputPort.equals(OutputPortValues.NORMAL)) {
            actionList.add(FlowUtils.createOutputNormal(order));
            order++;
        }
        if (outputPort.equals(OutputPortValues.CONTROLLER)) {
            actionList.add(FlowUtils.createSendToControllerAction(order));
            order++;
        }
    }
    ApplyActions applyOutputActions = new ApplyActionsBuilder().setAction(actionList).build();
    Instruction outputInstruction = new InstructionBuilder().setOrder(0)
            .setInstruction(new ApplyActionsCaseBuilder().setApplyActions(applyOutputActions).build()).build();
    Instructions instructions = new InstructionsBuilder().setInstruction(ImmutableList.of(outputInstruction))
            .build();
    return instructions;
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:27,代码来源:AbstractFlowManager.java


示例19: bindService

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
/**
 * Bind service.
 *
 * @param aclInterface the acl interface
 */
@Override
public void bindService(AclInterface aclInterface) {
    String interfaceName = aclInterface.getInterfaceId();
    jobCoordinator.enqueueJob(interfaceName,
        () -> {
            int instructionKey = 0;
            List<Instruction> instructions = new ArrayList<>();
            Long vpnId = aclInterface.getVpnId();
            if (vpnId != null) {
                instructions.add(MDSALUtil.buildAndGetWriteMetadaInstruction(MetaDataUtil.getVpnIdMetadata(vpnId),
                    MetaDataUtil.METADATA_MASK_VRFID, ++instructionKey));
                LOG.debug("Binding ACL service for interface {} with vpnId {}", interfaceName, vpnId);
            } else {
                Long elanTag = aclInterface.getElanId();
                instructions.add(
                        MDSALUtil.buildAndGetWriteMetadaInstruction(MetaDataUtil.getElanTagMetadata(elanTag),
                        MetaDataUtil.METADATA_MASK_SERVICE, ++instructionKey));
                LOG.debug("Binding ACL service for interface {} with ElanTag {}", interfaceName, elanTag);
            }
            instructions.add(MDSALUtil.buildAndGetGotoTableInstruction(AclConstants
                    .EGRESS_ACL_DUMMY_TABLE, ++instructionKey));
            int flowPriority = AclConstants.INGRESS_ACL_DEFAULT_FLOW_PRIORITY;
            short serviceIndex = ServiceIndex.getIndex(NwConstants.EGRESS_ACL_SERVICE_NAME,
                    NwConstants.EGRESS_ACL_SERVICE_INDEX);
            BoundServices serviceInfo = AclServiceUtils.getBoundServices(
                    String.format("%s.%s.%s", "acl", "ingressacl", interfaceName), serviceIndex, flowPriority,
                    AclConstants.COOKIE_ACL_BASE, instructions);
            InstanceIdentifier<BoundServices> path = AclServiceUtils.buildServiceId(interfaceName,
                    ServiceIndex.getIndex(NwConstants.EGRESS_ACL_SERVICE_NAME,
                    NwConstants.EGRESS_ACL_SERVICE_INDEX), ServiceModeEgress.class);

            WriteTransaction writeTxn = dataBroker.newWriteOnlyTransaction();
            writeTxn.put(LogicalDatastoreType.CONFIGURATION, path, serviceInfo,
                    WriteTransaction.CREATE_MISSING_PARENTS);

            return Collections.singletonList(writeTxn.submit());
        });
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:44,代码来源:StatefulIngressAclServiceImpl.java


示例20: bindService

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; //导入依赖的package包/类
/**
 * Bind service.
 *
 * @param aclInterface the acl interface
 */
@Override
public void bindService(AclInterface aclInterface) {
    String interfaceName = aclInterface.getInterfaceId();
    jobCoordinator.enqueueJob(interfaceName,
        () -> {
            int instructionKey = 0;
            List<Instruction> instructions = new ArrayList<>();
            Long vpnId = aclInterface.getVpnId();
            if (vpnId != null) {
                instructions.add(MDSALUtil.buildAndGetWriteMetadaInstruction(MetaDataUtil.getVpnIdMetadata(vpnId),
                    MetaDataUtil.METADATA_MASK_VRFID, ++instructionKey));
                LOG.debug("Binding ACL service for interface {} with vpnId {}", interfaceName, vpnId);
            } else {
                Long elanTag = aclInterface.getElanId();
                instructions.add(
                    MDSALUtil.buildAndGetWriteMetadaInstruction(MetaDataUtil.getElanTagMetadata(elanTag),
                    MetaDataUtil.METADATA_MASK_SERVICE, ++instructionKey));
                LOG.debug("Binding ACL service for interface {} with ElanTag {}", interfaceName, elanTag);
            }
            instructions.add(
                    MDSALUtil.buildAndGetGotoTableInstruction(NwConstants.INGRESS_ACL_TABLE, ++instructionKey));
            short serviceIndex = ServiceIndex.getIndex(NwConstants.ACL_SERVICE_NAME,
                    NwConstants.ACL_SERVICE_INDEX);
            int flowPriority = AclConstants.EGRESS_ACL_DEFAULT_FLOW_PRIORITY;
            BoundServices serviceInfo = AclServiceUtils.getBoundServices(
                    String.format("%s.%s.%s", "acl", "egressacl", interfaceName), serviceIndex, flowPriority,
                    AclConstants.COOKIE_ACL_BASE, instructions);
            InstanceIdentifier<BoundServices> path =
                AclServiceUtils.buildServiceId(interfaceName, serviceIndex, ServiceModeIngress.class);


            WriteTransaction writeTxn = dataBroker.newWriteOnlyTransaction();
            writeTxn.put(LogicalDatastoreType.CONFIGURATION, path, serviceInfo,
                    WriteTransaction.CREATE_MISSING_PARENTS);

            return Collections.singletonList(writeTxn.submit());
        });
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:44,代码来源:AbstractEgressAclServiceImpl.java



注:本文中的org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NodeConnector类代码示例发布时间:2022-05-23
下一篇:
Java Logger类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap