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

Java FlowId类代码示例

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

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



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

示例1: buildLPortDispFromScfToL3VpnFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的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


示例2: removeTunnelTableEntry

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
private void removeTunnelTableEntry(BigInteger dpId, long label, WriteTransaction tx) {
    FlowEntity flowEntity;
    LOG.debug("remove terminatingServiceActions called with DpnId = {} and label = {}", dpId, label);
    List<MatchInfo> mkMatches = new ArrayList<>();
    // Matching metadata
    mkMatches.add(new MatchTunnelId(BigInteger.valueOf(label)));
    flowEntity = MDSALUtil.buildFlowEntity(dpId,
        NwConstants.INTERNAL_TUNNEL_TABLE,
        getTableMissFlowRef(dpId, NwConstants.INTERNAL_TUNNEL_TABLE, (int) label),
        5, String.format("%s:%d", "TST Flow Entry ", label), 0, 0,
        COOKIE_TUNNEL.add(BigInteger.valueOf(label)), mkMatches, null);
    Node nodeDpn = FibUtil.buildDpnNode(flowEntity.getDpnId());
    FlowKey flowKey = new FlowKey(new FlowId(flowEntity.getFlowId()));
    InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
        .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
        .child(Table.class, new TableKey(flowEntity.getTableId())).child(Flow.class, flowKey).build();

    tx.delete(LogicalDatastoreType.CONFIGURATION, flowInstanceId);
    LOG.debug("Terminating service Entry for dpID {} : label : {} removed successfully", dpId, label);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:21,代码来源:VrfEntryListener.java


示例3: createFlowBuilder

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
public static FlowBuilder createFlowBuilder(final short table, final int priority, final BigInteger cookieValue,
                                            final String flowName, final String flowIdStr, MatchBuilder match,
                                            InstructionsBuilder isb) {
    FlowBuilder flow = new FlowBuilder();
    flow.setId(new FlowId(flowIdStr));
    flow.setKey(new FlowKey(new FlowId(flowIdStr)));
    flow.setTableId(table);
    flow.setFlowName(flowName);
    flow.setCookie(new FlowCookie(cookieValue));
    flow.setCookieMask(new FlowCookie(cookieValue));
    flow.setContainerName(null);
    flow.setStrict(false);
    flow.setMatch(match.build());
    flow.setInstructions(isb.build());
    flow.setPriority(priority);
    flow.setHardTimeout(0);
    flow.setIdleTimeout(0);
    flow.setFlags(new FlowModFlags(false, false, false, false, false));
    if (null == flow.isBarrier()) {
        flow.setBarrier(Boolean.FALSE);
    }

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


示例4: createFlowOnTable

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
public static Flow createFlowOnTable(Match match, int priority, short tableId, BigInteger cookie,
        boolean isCreateFlowIdFromMatch, Integer timeout) {
    FlowBuilder fb = new FlowBuilder();
    if (match != null) {
        fb.setMatch(match);
    }
    FlowId flowId = createFlowId();
    fb.setTableId(tableId);
    fb.setIdleTimeout(0).setHardTimeout(0);
    fb.setId(flowId);
    if (timeout != null) {
        fb.setHardTimeout(timeout);
    }
    if (cookie != null) {
        fb.setCookie(new FlowCookie(cookie));
    }

    fb.setPriority(priority);
    Flow flow = fb.build();
    return flow;
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:22,代码来源:CountersServiceUtils.java


示例5: createArpReplyToControllerFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
protected FlowBuilder createArpReplyToControllerFlow() {
    final FlowBuilder arpFlow = new FlowBuilder()
            .setPriority(OFRendererConstants.ARP_REPLY_TO_CONTROLLER_FLOW_PRIORITY)
            .setIdleTimeout(0)
            .setHardTimeout(0)
            .setCookie(new FlowCookie(BigInteger.valueOf(flowCookie.incrementAndGet())))
            .setFlags(new FlowModFlags(false, false, false, false, false));
    final EthernetMatch ethernetMatch = FlowUtils.createEthernetMatch();
    /** NOTE:
     * Setting layer 3 match seems to be messing with the flow ID
     * check for possible bug on openflow plugin side.
     * Use following code for specific ARP REQUEST or REPLY packet capture
     * ArpMatch arpMatch = FlowUtils.createArpMatch();
     */
    final Match match = new MatchBuilder().setEthernetMatch(ethernetMatch).build();//.setLayer3Match(arpMatch).build();
    arpFlow.setMatch(match);
    final Instructions instructions = createOutputInstructions(OutputPortValues.CONTROLLER, OutputPortValues.NORMAL);
    arpFlow.setInstructions(instructions);
    final String flowName = createFlowName();
    arpFlow.setFlowName(flowName);
    final FlowId flowId = new FlowId(flowName);
    arpFlow.setId(flowId);
    arpFlow.setKey(new FlowKey(flowId));
    return arpFlow;
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:26,代码来源:ArpFlowManager.java


示例6: createFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
public FlowBuilder createFlow(final Dataflow dataFlow) throws DataflowCreationException {
    FlowBuilder flowBuilder = new FlowBuilder();
    try {
        final FlowModFlags flowModFlags = new FlowModFlags(false, false, false, false, false);
        final FlowId flowId = new FlowId(dataFlow.getId().toString());
        final FlowKey flowKey = new FlowKey(flowId);
        final MeterId meterId = new MeterId(dataFlow.getMeterId().longValue());

        flowBuilder.setFlowName("NIC_METER" + meterId.getValue());
        flowBuilder.setId(new FlowId(Long.toString(flowBuilder.hashCode())));
        flowBuilder.setMatch(createMatch(dataFlow.getSourceIpAddress()));
        flowBuilder.setInstructions(createInstruction(meterId));
        flowBuilder.setPriority(OFRendererConstants.DEFAULT_PRIORITY);
        flowBuilder.setCookie(new FlowCookie(BigInteger.valueOf(flowCookieInc.getAndIncrement())));
        flowBuilder.setBufferId(OFP_NO_BUFFER);
        flowBuilder.setHardTimeout((int) dataFlow.getTimeout());
        flowBuilder.setIdleTimeout((int) dataFlow.getTimeout());
        flowBuilder.setFlags(flowModFlags);
        flowBuilder.setKey(flowKey);
    } catch (Exception e) {
        throw new DataflowCreationException(e.getMessage());
    }

    return flowBuilder;
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:26,代码来源:OFRuleWithMeterManager.java


示例7: pushFlowsByMacAddress

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
private void pushFlowsByMacAddress(final MacAddress srcMacAddress, final MacAddress dstMacAddress,
                                   final NodeId nodeId, final FlowAction flowAction) {
    final MatchBuilder matchBuilder = MatchUtils.createEthMatch(new MatchBuilder(), srcMacAddress, dstMacAddress);
    final String flowIdStr = srcMacAddress.getValue() + "_" + dstMacAddress.getValue();
    final FlowBuilder flowBuilder = createFlowBuilder(matchBuilder, new FlowId(flowIdStr));

    // TODO: Extend for other actions
    if (action instanceof Allow) {
        // Set allow action
        Instructions buildedInstructions = createOutputInstructions(OutputPortValues.NORMAL);
        flowBuilder.setInstructions(buildedInstructions);

    } else {
        String actionClass = action.getClass().getName();
        LOG.error("Invalid action: {}", actionClass);
    }
        writeDataTransaction(nodeId, flowBuilder, flowAction);
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:19,代码来源:IntentFlowManager.java


示例8: createFlowBuilder

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
private FlowBuilder createFlowBuilder(final MatchBuilder matchBuilder, final FlowId flowId) {
    final Match match = matchBuilder.build();
    final FlowKey key = new FlowKey(flowId);
    final FlowBuilder flowBuilder = new FlowBuilder();
    final BigInteger cookieId = new BigInteger("20", RADIX);

    flowBuilder.setId(flowId);
    flowBuilder.setKey(key);
    flowBuilder.setFlowName(flowName);
    flowBuilder.setCookie(new FlowCookie(cookieId));
    flowBuilder.setCookieMask(new FlowCookie(cookieId));
    flowBuilder.setContainerName(null);
    flowBuilder.setStrict(false);
    flowBuilder.setMatch(match);
    flowBuilder.setFlags(new FlowModFlags(false, false, false, false, false));
    flowBuilder.setBarrier(true);
    flowBuilder.setPriority(OFRendererConstants.DEFAULT_PRIORITY);
    flowBuilder.setHardTimeout(OFRendererConstants.DEFAULT_HARD_TIMEOUT);
    flowBuilder.setIdleTimeout(OFRendererConstants.DEFAULT_IDLE_TIMEOUT);

    return flowBuilder;
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:23,代码来源:IntentFlowManager.java


示例9: createLldpReplyToControllerFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
private FlowBuilder createLldpReplyToControllerFlow() {
    FlowBuilder lldpFlow = new FlowBuilder().setFlowName(createFlowName())
            .setIdleTimeout(0)
            .setHardTimeout(0)
            .setCookie(new FlowCookie(BigInteger.valueOf(flowCookie.incrementAndGet())))
            .setFlags(new FlowModFlags(false, false, false, false, false))
            .setPriority(OFRendererConstants.LLDP_REPLY_TO_CONTROLLER_FLOW_PRIORITY);

    EthernetMatchBuilder ethernetMatchBuilder = new EthernetMatchBuilder()
            .setEthernetType(new EthernetTypeBuilder()
            .setType(new EtherType(Long.valueOf(OFRendererConstants.LLDP_ETHER_TYPE))).build());
    Match match = new MatchBuilder().setEthernetMatch(ethernetMatchBuilder.build()).build();

    lldpFlow.setMatch(match);
    Instructions instructions = createOutputInstructions(OutputPortValues.CONTROLLER);
    lldpFlow.setInstructions(instructions);
    FlowId flowId = new FlowId(createFlowName());
    lldpFlow.setId(flowId);
    lldpFlow.setKey(new FlowKey(flowId));
    return lldpFlow;
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:22,代码来源:LldpFlowManager.java


示例10: removeTap

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
private void removeTap(Tap tap) {
    NodeId nodeId = tap.getNode();
    String tapId = tap.getId();
    String flowIdStr = "Tap_" + tapId + "SrcPort_"; // TODO: Concat srcNodeConnector to each flow;
    FlowId flowId = new FlowId(flowIdStr);
    FlowBuilder flowBuilder = new FlowBuilder()
            .setKey(new FlowKey(flowId))
            .setId(flowId)
            .setTableId((short)0);
    InstanceIdentifier<Flow> flowIID = InstanceIdentifier.builder(Nodes.class)
            .child(Node.class, new NodeKey(nodeId))
            .augmentation(FlowCapableNode.class)
            .child(Table.class, new TableKey(flowBuilder.getTableId()))
            .child(Flow.class, flowBuilder.getKey())
            .build();
    GenericTransactionUtils.writeData(dataBroker, LogicalDatastoreType.CONFIGURATION, flowIID, flowBuilder.build(), false);
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:18,代码来源:TutorialTapProvider.java


示例11: removeFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
private void removeFlow(BigInteger dpnId, String ifName, Interface ifState) {
    if (ifState == null) {
        LOG.trace("Could not find the ifState for interface {}", ifName);
        return;
    }
    Integer ifIndex = ifState.getIfIndex();

    mdsalUtils.removeFlow(dpnId, NwConstants.QOS_DSCP_TABLE,
            new FlowId(getQosFlowId(NwConstants.QOS_DSCP_TABLE, dpnId, ifIndex)));
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:11,代码来源:QosNeutronUtils.java


示例12: getFlowRef

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
public static FlowRef getFlowRef(BigInteger dpId, Flow flow) {
    FlowKey flowKey = new FlowKey(new FlowId(flow.getId()));
    Node nodeDpn = buildInventoryDpnNode(dpId);
    InstanceIdentifier<Flow> flowInstanceId =
            InstanceIdentifier.builder(Nodes.class)
            .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
            .child(Table.class, new TableKey(flow.getTableId()))
            .child(Flow.class, flowKey)
            .build();
    return new FlowRef(flowInstanceId);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:12,代码来源:NaptEventHandler.java


示例13: remove

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
@Override
protected void remove(InstanceIdentifier<Node> identifier, Node del) {
    BigInteger dpnId = getDpnIdFromNodeId(del.getNodeId());
    if (dpnId == null) {
        return;
    }

    LOG.debug("Removing L3VPN to ELAN default Fallback flow in LPortDispatcher table from Dpn {}",
              del.getNodeId());

    Flow flowToRemove = new FlowBuilder().setFlowName(L3_TO_L2_DEFAULT_FLOW_REF)
            .setId(new FlowId(L3_TO_L2_DEFAULT_FLOW_REF))
            .setTableId(NwConstants.LPORT_DISPATCHER_TABLE).build();
    mdsalMgr.removeFlow(dpnId, flowToRemove);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:16,代码来源:VpnToElanFallbackNodeListener.java


示例14: removeVpnPseudoPortFlows

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
/**
 * Removes all Flows in LFIB and LPortDispatcher that are related to this VpnPseudoLPort.
 *
 * @param vpnInstanceName vpn Instance name
 * @param vpnPseudoLportTag vpnPseudoLPort tag
 */
public void removeVpnPseudoPortFlows(String vpnInstanceName, int vpnPseudoLportTag) {
    // At VpnPseudoPort removal time the current Vpn footprint could not be enough, so let's try to
    // remove all possible entries in all DPNs.
    // TODO: Study how this could be enhanced. It could be done at ServiceChain removal, but that
    // could imply check all ServiceChains ending in all DPNs in Vpn footprint to decide that if the entries
    // can be removed, and that sounds even costlier than this.

    String rd = VpnServiceChainUtils.getVpnRd(dataBroker, vpnInstanceName);
    List<VrfEntry> vrfEntries = null;
    if (rd != null) {
        vrfEntries = VpnServiceChainUtils.getAllVrfEntries(dataBroker, rd);
    }
    boolean cleanLFib = vrfEntries != null && !vrfEntries.isEmpty();

    List<BigInteger> operativeDPNs = NWUtil.getOperativeDPNs(dataBroker);
    for (BigInteger dpnId : operativeDPNs) {
        if (cleanLFib) {
            VpnServiceChainUtils.programLFibEntriesForSCF(mdsalManager, dpnId, vrfEntries, vpnPseudoLportTag,
                                                          NwConstants.DEL_FLOW);
        }

        String vpnToScfflowRef = VpnServiceChainUtils.getL3VpnToScfLportDispatcherFlowRef(vpnPseudoLportTag);
        Flow vpnToScfFlow = new FlowBuilder().setTableId(NwConstants.LPORT_DISPATCHER_TABLE)
                                             .setId(new FlowId(vpnToScfflowRef)).build();
        mdsalManager.removeFlow(dpnId, vpnToScfFlow);
        String scfToVpnFlowRef = VpnServiceChainUtils.getScfToL3VpnLportDispatcherFlowRef(vpnPseudoLportTag);
        Flow scfToVpnFlow = new FlowBuilder().setTableId(NwConstants.LPORT_DISPATCHER_TABLE)
                                             .setId(new FlowId(scfToVpnFlowRef)).build();
        mdsalManager.removeFlow(dpnId, scfToVpnFlow);
    }

    if (rd != null) {
        RemoveVpnPseudoPortDataJob removeVpnPseudoPortDataTask = new RemoveVpnPseudoPortDataJob(dataBroker, rd);
        jobCoordinator.enqueueJob(removeVpnPseudoPortDataTask.getDsJobCoordinatorKey(),
                removeVpnPseudoPortDataTask);
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:44,代码来源:VPNServiceChainHandler.java


示例15: createTerminatingServiceActions

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
public void createTerminatingServiceActions(BigInteger destDpId, int label, List<ActionInfo> actionsInfos,
                                            WriteTransaction tx) {
    List<MatchInfo> mkMatches = new ArrayList<>();

    LOG.debug("create terminatingServiceAction on DpnId = {} and serviceId = {} and actions = {}",
        destDpId, label, actionsInfos);

    // Matching metadata
    // FIXME vxlan vni bit set is not working properly with OVS.need to revisit
    mkMatches.add(new MatchTunnelId(BigInteger.valueOf(label)));

    List<InstructionInfo> mkInstructions = new ArrayList<>();
    mkInstructions.add(new InstructionApplyActions(actionsInfos));

    FlowEntity terminatingServiceTableFlowEntity =
        MDSALUtil.buildFlowEntity(destDpId, NwConstants.INTERNAL_TUNNEL_TABLE,
        getTableMissFlowRef(destDpId, NwConstants.INTERNAL_TUNNEL_TABLE, label), 5,
            String.format("%s:%d", "TST Flow Entry ", label),
        0, 0, COOKIE_TUNNEL.add(BigInteger.valueOf(label)), mkMatches, mkInstructions);

    FlowKey flowKey = new FlowKey(new FlowId(terminatingServiceTableFlowEntity.getFlowId()));

    FlowBuilder flowbld = terminatingServiceTableFlowEntity.getFlowBuilder();

    Node nodeDpn = FibUtil.buildDpnNode(terminatingServiceTableFlowEntity.getDpnId());
    InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
        .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
        .child(Table.class, new TableKey(terminatingServiceTableFlowEntity.getTableId()))
        .child(Flow.class, flowKey).build();
    tx.put(LogicalDatastoreType.CONFIGURATION, flowInstanceId, flowbld.build(),
            WriteTransaction.CREATE_MISSING_PARENTS);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:33,代码来源:VrfEntryListener.java


示例16: makeLFibTableEntry

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
private void makeLFibTableEntry(BigInteger dpId, long label, List<InstructionInfo> instructions, int priority,
                                int addOrRemove, WriteTransaction tx) {
    Boolean wrTxPresent = true;
    if (tx == null) {
        wrTxPresent = false;
        tx = dataBroker.newWriteOnlyTransaction();
    }

    List<MatchInfo> matches = new ArrayList<>();
    matches.add(MatchEthernetType.MPLS_UNICAST);
    matches.add(new MatchMplsLabel(label));

    // Install the flow entry in L3_LFIB_TABLE
    String flowRef = FibUtil.getFlowRef(dpId, NwConstants.L3_LFIB_TABLE, label, priority);

    FlowEntity flowEntity;
    flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.L3_LFIB_TABLE, flowRef, priority, flowRef, 0, 0,
        NwConstants.COOKIE_VM_LFIB_TABLE, matches, instructions);
    Flow flow = flowEntity.getFlowBuilder().build();
    String flowId = flowEntity.getFlowId();
    FlowKey flowKey = new FlowKey(new FlowId(flowId));
    Node nodeDpn = FibUtil.buildDpnNode(dpId);
    InstanceIdentifier<Flow> flowInstanceId = InstanceIdentifier.builder(Nodes.class)
        .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class)
        .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flowKey).build();

    if (addOrRemove == NwConstants.ADD_FLOW) {
        tx.put(LogicalDatastoreType.CONFIGURATION, flowInstanceId, flow, WriteTransaction.CREATE_MISSING_PARENTS);
    } else {
        tx.delete(LogicalDatastoreType.CONFIGURATION, flowInstanceId);
    }
    if (!wrTxPresent) {
        tx.submit();
    }

    LOG.debug("LFIB Entry for dpID {} : label : {} instructions {} : key {} {} successfully",
        dpId, label, instructions, flowKey, NwConstants.ADD_FLOW == addOrRemove ? "ADDED" : "REMOVED");
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:39,代码来源:VrfEntryListener.java


示例17: removeVpnLinkEndpointFlows

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
@SuppressWarnings("checkstyle:IllegalCatch")
private void removeVpnLinkEndpointFlows(InterVpnLink del, String vpnUuid, String rd, List<BigInteger> dpns,
                                        int otherEndpointLportTag, String otherEndpointIpAddr,
                                        List<VrfEntry> vrfEntries, final boolean isVpnFirstEndPoint) {

    String interVpnLinkName = del.getName();
    LOG.debug("Removing endpoint flows for vpn {}.  InterVpnLink={}.  OtherEndpointLportTag={}",
        vpnUuid, interVpnLinkName, otherEndpointLportTag);
    if (dpns == null) {
        LOG.debug("VPN {} endpoint is not instantiated in any DPN for InterVpnLink {}",
            vpnUuid, interVpnLinkName);
        return;
    }

    for (BigInteger dpnId : dpns) {
        try {
            // Removing flow from LportDispatcher table
            String flowRef = InterVpnLinkUtil.getLportDispatcherFlowRef(interVpnLinkName, otherEndpointLportTag);
            FlowKey flowKey = new FlowKey(new FlowId(flowRef));
            Flow flow = new FlowBuilder().setKey(flowKey).setId(new FlowId(flowRef))
                .setTableId(NwConstants.LPORT_DISPATCHER_TABLE).setFlowName(flowRef)
                .build();
            mdsalManager.removeFlow(dpnId, flow);

            // Also remove the 'fake' iface from the VpnToDpn map
            InterVpnLinkUtil.removeIVpnLinkIfaceFromVpnFootprint(vpnFootprintService, vpnUuid, rd, dpnId);

        } catch (Exception e) {
            // Whatever happens it should not stop it from trying to remove as much as possible
            LOG.warn("Error while removing InterVpnLink {} Endpoint flows on dpn {}. Reason: ",
                interVpnLinkName, dpnId, e);
        }
    }
    // Removing flow from FIB and LFIB tables
    LOG.trace("Removing flow in FIB and LFIB tables for vpn {} interVpnLink {} otherEndpointIpAddr {}",
        vpnUuid, interVpnLinkName, otherEndpointIpAddr);
    cleanUpInterVPNRoutes(interVpnLinkName, vrfEntries, isVpnFirstEndPoint);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:39,代码来源:InterVpnLinkListener.java


示例18: getFlowIid

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
public static InstanceIdentifier<Flow> getFlowIid(Flow flow, BigInteger dpnId) {
    FlowKey flowKey = new FlowKey(new FlowId(flow.getId()));
    org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId =
            new org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId("openflow:" + dpnId);
    org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node nodeDpn =
            new NodeBuilder().setId(nodeId).setKey(new NodeKey(nodeId)).build();
    return InstanceIdentifier.builder(Nodes.class)
            .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
                    nodeDpn.getKey()).augmentation(FlowCapableNode.class)
            .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flowKey).build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:12,代码来源:ElanUtils.java


示例19: removeTheDropFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
private void removeTheDropFlow(long elanTag, BigInteger dpId, String extDeviceNodeId, String macToRemove) {
    String flowId =
            ElanUtils.getKnownDynamicmacFlowRef(NwConstants.ELAN_DMAC_TABLE, dpId, extDeviceNodeId, macToRemove,
                    elanTag, true);
    Flow flowToRemove = new FlowBuilder().setId(new FlowId(flowId)).setTableId(NwConstants.ELAN_DMAC_TABLE).build();
    ResourceBatchingManager.getInstance().delete(
            ResourceBatchingManager.ShardResource.CONFIG_TOPOLOGY, ElanUtils.getFlowIid(flowToRemove, dpId));
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:9,代码来源:ElanDmacUtils.java


示例20: removeFlowThatSendsThePacketOnAnExternalTunnel

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId; //导入依赖的package包/类
private void removeFlowThatSendsThePacketOnAnExternalTunnel(long elanTag, BigInteger dpId,
        String extDeviceNodeId, String macToRemove) {
    String flowId =
            ElanUtils.getKnownDynamicmacFlowRef(NwConstants.ELAN_DMAC_TABLE, dpId, extDeviceNodeId, macToRemove,
                    elanTag, false);
    Flow flowToRemove = new FlowBuilder().setId(new FlowId(flowId)).setTableId(NwConstants.ELAN_DMAC_TABLE).build();
    ResourceBatchingManager.getInstance().delete(
            ResourceBatchingManager.ShardResource.CONFIG_TOPOLOGY, ElanUtils.getFlowIid(flowToRemove, dpId));
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:10,代码来源:ElanDmacUtils.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java PackageRelationship类代码示例发布时间:2022-05-23
下一篇:
Java Frustrum类代码示例发布时间: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