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

Java Table类代码示例

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

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



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

示例1: removeTunnelTableEntry

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


示例2: removeTap

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


示例3: getFlowRef

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


示例4: createTerminatingServiceActions

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


示例5: makeLFibTableEntry

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


示例6: appendFlowForCreate

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
public void appendFlowForCreate(NodeId node, Flow flow, WriteTransaction tx) {
    NodeKey nodeKey = new NodeKey(node);
    InstanceIdentifier<Flow> iidFlow = InstanceIdentifier.builder(Nodes.class)
        .child(Node.class, nodeKey)
        .augmentation(FlowCapableNode.class)
        .child(Table.class, new TableKey(flow.getTableId()))
        .child(Flow.class, flow.getKey())
        .build();

    tx.put(LogicalDatastoreType.CONFIGURATION, iidFlow, flow, WriteTransaction.CREATE_MISSING_PARENTS);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:12,代码来源:OpenFlow13Provider.java


示例7: appendFlowForDelete

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
public void appendFlowForDelete(NodeId node, Flow flow, WriteTransaction tx) {
    NodeKey nodeKey = new NodeKey(node);
    InstanceIdentifier<Flow> iidFlow = InstanceIdentifier.builder(Nodes.class)
        .child(Node.class, nodeKey)
        .augmentation(FlowCapableNode.class)
        .child(Table.class, new TableKey(flow.getTableId()))
        .child(Flow.class, flow.getKey())
        .build();

    tx.delete(LogicalDatastoreType.CONFIGURATION, iidFlow);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:12,代码来源:OpenFlow13Provider.java


示例8: getFlowIid

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


示例9: getFlowIid

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
protected InstanceIdentifier<Flow> getFlowIid(short tableId, FlowId flowid, BigInteger dpnId) {

        FlowKey flowKey = new FlowKey(new FlowId(flowid));
        NodeId nodeId =
                new NodeId("openflow:" + dpnId);
        Node nodeDpn =
                new NodeBuilder().setId(nodeId).setKey(new NodeKey(nodeId)).build();
        return InstanceIdentifier.builder(Nodes.class)
                .child(Node.class,
                        nodeDpn.getKey()).augmentation(FlowCapableNode.class)
                .child(Table.class, new TableKey(tableId)).child(Flow.class, flowKey).build();
    }
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:13,代码来源:ElanServiceTestBase.java


示例10: createFlowPath

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
private static InstanceIdentifier<Flow> createFlowPath(FlowBuilder flowBuilder, NodeBuilder nodeBuilder) {
    return InstanceIdentifier.builder(Nodes.class)
            .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
                    nodeBuilder.getKey())
            .augmentation(FlowCapableNode.class)
            .child(Table.class, new TableKey(flowBuilder.getTableId()))
            .child(Flow.class, flowBuilder.getKey()).build();
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:9,代码来源:AbstractServiceInstance.java


示例11: getTable

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
public static Table getTable(NodeBuilder nodeBuilder, short table, ReadOnlyTransaction readTx,
        final LogicalDatastoreType store) {
    try {
        Optional<Table> data = readTx.read(store, createTablePath(nodeBuilder, table)).get();
        if (data.isPresent()) {
            return data.get();
        }
    } catch (InterruptedException | ExecutionException e) {
        LOG.error("Failed to get table {}", table, e);
    }

    LOG.info("Cannot find data for table {} in {}", table, store);
    return null;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:15,代码来源:OfFlowUtils.java


示例12: retrieveIdentifier

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
private InstanceIdentifier<Flow> retrieveIdentifier(final NodeBuilder nodeBuilder,
                                                    final FlowBuilder flowBuilder) {
    flowBuilder.setTableId(OFRendererConstants.FALLBACK_TABLE_ID);
    InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow> flowIID = InstanceIdentifier.builder(Nodes.class)
            .child(Node.class, nodeBuilder.getKey())
            .augmentation(FlowCapableNode.class)
            .child(Table.class, new TableKey(flowBuilder.getTableId()))
            .child(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow.class, flowBuilder.getKey())
            .build();
    return flowIID;
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:12,代码来源:OFRuleWithMeterManager.java


示例13: writeDataTransaction

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
/**
 * Writes a Flow with a flow action on the Configuration
 * data store so that it can be applied to an OF switch.
 * @param nodeId The {@link NodeId} of the OF Switch
 * @param flowBuilder The {@link FlowBuilder} that is built and submitted
 * @param flowAction The {@link FlowAction} the flow action (ADD or REMOVE)
 * @return A boolean representing the transaction result
 */
protected boolean writeDataTransaction(NodeId nodeId, FlowBuilder flowBuilder, FlowAction flowAction) {
    boolean result = false;
    final NodeBuilder nodeBuilder = new NodeBuilder();
    final FlowKey flowKey = new FlowKey(flowBuilder.getKey());
    nodeBuilder.setId(nodeId);
    nodeBuilder.setKey(new NodeKey(nodeBuilder.getId()));

    MdsalUtils mdsal = new MdsalUtils(dataBroker);
    if (!pipelineManager.setTableId(nodeId, flowBuilder)) {
        flowBuilder.setTableId(OFRendererConstants.FALLBACK_TABLE_ID);
    }
    final TableKey tableKey = new TableKey(flowBuilder.getTableId());

    InstanceIdentifier<Flow> flowIID = InstanceIdentifier.builder(Nodes.class)
            .child(Node.class, nodeBuilder.getKey())
            .augmentation(FlowCapableNode.class)
            .child(Table.class, tableKey)
            .child(Flow.class, flowKey)
            .build();

    if (flowAction == FlowAction.ADD_FLOW) {
        result = mdsal.put(LogicalDatastoreType.CONFIGURATION, flowIID, flowBuilder.build());
    }
    else if(flowAction == FlowAction.REMOVE_FLOW) {
        result = mdsal.delete(LogicalDatastoreType.CONFIGURATION, flowIID);
    }

    return result;
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:38,代码来源:AbstractFlowManager.java


示例14: createPipeline

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
private void createPipeline(Node node) {
    List<Table> tableList = getTableList(node);
    for (Table table : tableList) {
        List<Short> nextIds = getNextTablesMiss(node.getId(), table.getId());
        if (nextIds.isEmpty()) {
            break;
        }
        Short nextId = Collections.min(nextIds);
        Short currentId = table.getId();
        addFlowGoto(node, currentId, nextId);
    }
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:13,代码来源:PipelineManagerProviderImpl.java


示例15: addFlowGoto

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
private void addFlowGoto(Node node, Short currentId, Short nextId) {
    FlowBuilder flowBuilder = new FlowBuilder();
    flowBuilder.setTableId(currentId);
    flowBuilder.setHardTimeout(0);
    flowBuilder.setPriority(0);
    flowBuilder.setMatch(new MatchBuilder().build());
    flowBuilder.setInstructions(
            new InstructionsBuilder().setInstruction(Collections.singletonList(
                    new InstructionBuilder().setInstruction(
                            new GoToTableCaseBuilder().setGoToTable(
                                    new GoToTableBuilder().setTableId(nextId).build()
                            ).build()
                    ).setOrder(0).build()
            )).build());
    String flowIdStr = "PipelineManager";
    final FlowId flowId = new FlowId(flowIdStr);
    final FlowKey key = new FlowKey(flowId);
    flowBuilder.setKey(key);

    InstanceIdentifier<Flow> flowIID = InstanceIdentifier.builder(Nodes.class)
            .child(Node.class, new NodeKey(node.getId())).augmentation(FlowCapableNode.class)
            .child(Table.class, new TableKey(flowBuilder.getTableId())).child(Flow.class, flowBuilder.getKey())
            .build();

    WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
    transaction.put(LogicalDatastoreType.CONFIGURATION, flowIID, flowBuilder.build(), true);
    transaction.submit();
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:29,代码来源:PipelineManagerProviderImpl.java


示例16: setTableId

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
@Override
public boolean setTableId(NodeId nodeId, FlowBuilder flowBuilder) {
    List<Table> tableList = getTableList(nodeId);
    for (Table table : tableList) {
        List<TableFeatureProperties> tableFeaturePropertiesList = getTableFeatureProperties(nodeId, table.getId());
        if (isFlowSupported(tableFeaturePropertiesList, flowBuilder)) {
            flowBuilder.setTableId(table.getId());
            return true;
        }
    }
    return false;
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:13,代码来源:PipelineManagerProviderImpl.java


示例17: makeConnectedRoute

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
protected void makeConnectedRoute(BigInteger dpId, long vpnId, VrfEntry vrfEntry, String rd,
                        List<InstructionInfo> instructions, int addOrRemove, WriteTransaction tx,
                        List<SubTransaction> subTxns) {
    Boolean wrTxPresent = true;
    if (tx == null) {
        wrTxPresent = false;
        tx = dataBroker.newWriteOnlyTransaction();
    }

    LOG.trace("makeConnectedRoute: vrfEntry {}", vrfEntry);
    String[] values = vrfEntry.getDestPrefix().split("/");
    String ipAddress = values[0];
    int prefixLength = values.length == 1 ? 0 : Integer.parseInt(values[1]);
    if (addOrRemove == NwConstants.ADD_FLOW) {
        LOG.debug("Adding route to DPN {} for rd {} prefix {} ", dpId, rd, vrfEntry.getDestPrefix());
    } else {
        LOG.debug("Removing route from DPN {} for rd {} prefix {}", dpId, rd, vrfEntry.getDestPrefix());
    }
    InetAddress destPrefix;
    try {
        destPrefix = InetAddress.getByName(ipAddress);
    } catch (UnknownHostException e) {
        LOG.error("Failed to get destPrefix for prefix {} rd {} VpnId {} DPN {}",
                vrfEntry.getDestPrefix(), rd, vpnId, dpId, e);
        return;
    }

    List<MatchInfo> matches = new ArrayList<>();

    matches.add(new MatchMetadata(MetaDataUtil.getVpnIdMetadata(vpnId), MetaDataUtil.METADATA_MASK_VRFID));

    if (destPrefix instanceof Inet4Address) {
        matches.add(MatchEthernetType.IPV4);
        if (prefixLength != 0) {
            matches.add(new MatchIpv4Destination(destPrefix.getHostAddress(), Integer.toString(prefixLength)));
        }
    } else {
        matches.add(MatchEthernetType.IPV6);
        if (prefixLength != 0) {
            matches.add(new MatchIpv6Destination(destPrefix.getHostAddress() + "/" + prefixLength));
        }
    }

    int priority = DEFAULT_FIB_FLOW_PRIORITY + prefixLength;
    String flowRef = FibUtil.getFlowRef(dpId, NwConstants.L3_FIB_TABLE, rd, priority, destPrefix);
    FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpId, NwConstants.L3_FIB_TABLE, flowRef, priority,
            flowRef, 0, 0,
            COOKIE_VM_FIB_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 (RouteOrigin.value(vrfEntry.getOrigin()) == RouteOrigin.BGP) {
        SubTransaction subTransaction = new SubTransactionImpl();
        if (addOrRemove == NwConstants.ADD_FLOW) {
            subTransaction.setInstanceIdentifier(flowInstanceId);
            subTransaction.setInstance(flow);
            subTransaction.setAction(SubTransaction.CREATE);
        } else {
            subTransaction.setInstanceIdentifier(flowInstanceId);
            subTransaction.setAction(SubTransaction.DELETE);
        }
        subTxns.add(subTransaction);
    }

    if (addOrRemove == NwConstants.ADD_FLOW) {
        tx.put(LogicalDatastoreType.CONFIGURATION, flowInstanceId, flow, true);
    } else {
        tx.delete(LogicalDatastoreType.CONFIGURATION, flowInstanceId);
    }

    if (!wrTxPresent) {
        tx.submit();
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:81,代码来源:BaseVrfEntryHandler.java


示例18: installSubnetBroadcastAddrDropRule

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
private void installSubnetBroadcastAddrDropRule(final BigInteger dpnId, final String rd, final long vpnId,
                                                final VrfEntry vrfEntry, int addOrRemove, WriteTransaction tx) {
    List<MatchInfo> matches = new ArrayList<>();

    LOG.debug("SUBNETROUTE: installSubnetBroadcastAddrDropRule: destPrefix {} rd {} vpnId {} dpnId {}",
            vrfEntry.getDestPrefix(), rd, vpnId, dpnId);
    String[] ipAddress = vrfEntry.getDestPrefix().split("/");
    String subnetBroadcastAddr = FibUtil.getBroadcastAddressFromCidr(vrfEntry.getDestPrefix());
    final int prefixLength = ipAddress.length == 1 ? 0 : Integer.parseInt(ipAddress[1]);

    InetAddress destPrefix;
    try {
        destPrefix = InetAddress.getByName(subnetBroadcastAddr);
    } catch (UnknownHostException e) {
        LOG.error("Failed to get destPrefix for prefix {} rd {} VpnId {} DPN {}",
                vrfEntry.getDestPrefix(), rd, vpnId, dpnId, e);
        return;
    }

    // Match on VpnId and SubnetBroadCast IP address
    matches.add(new MatchMetadata(MetaDataUtil.getVpnIdMetadata(vpnId), MetaDataUtil.METADATA_MASK_VRFID));
    matches.add(MatchEthernetType.IPV4);

    if (prefixLength != 0) {
        matches.add(new MatchIpv4Destination(subnetBroadcastAddr, Integer.toString(IPV4_ADDR_PREFIX_LENGTH)));
    }

    //Action is to drop the packet
    List<InstructionInfo> dropInstructions = new ArrayList<>();
    List<ActionInfo> actionsInfos = new ArrayList<>();
    actionsInfos.add(new ActionDrop());
    dropInstructions.add(new InstructionApplyActions(actionsInfos));

    int priority = DEFAULT_FIB_FLOW_PRIORITY + IPV4_ADDR_PREFIX_LENGTH;
    String flowRef = FibUtil.getFlowRef(dpnId, NwConstants.L3_SUBNET_ROUTE_TABLE, rd, priority, destPrefix);
    FlowEntity flowEntity = MDSALUtil.buildFlowEntity(dpnId, NwConstants.L3_SUBNET_ROUTE_TABLE, flowRef, priority,
            flowRef, 0, 0, COOKIE_TABLE_MISS, matches, dropInstructions);

    Flow flow = flowEntity.getFlowBuilder().build();
    String flowId = flowEntity.getFlowId();
    FlowKey flowKey = new FlowKey(new FlowId(flowId));
    Node nodeDpn = FibUtil.buildDpnNode(dpnId);

    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, true);
    } else {
        tx.delete(LogicalDatastoreType.CONFIGURATION, flowInstanceId);
    }
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:54,代码来源:VrfEntryListener.java


示例19: createFlowPath

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
public static InstanceIdentifier<Flow> createFlowPath(FlowBuilder flowBuilder, NodeBuilder nodeBuilder) {
    return InstanceIdentifier.builder(Nodes.class).child(Node.class, nodeBuilder.getKey())
            .augmentation(FlowCapableNode.class).child(Table.class, new TableKey(flowBuilder.getTableId()))
            .child(Flow.class, flowBuilder.getKey()).build();
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:6,代码来源:OfFlowUtils.java


示例20: createTablePath

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table; //导入依赖的package包/类
public static InstanceIdentifier<Table> createTablePath(NodeBuilder nodeBuilder, short table) {
    return InstanceIdentifier.builder(Nodes.class).child(Node.class, nodeBuilder.getKey())
            .augmentation(FlowCapableNode.class).child(Table.class, new TableKey(table)).build();
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:5,代码来源:OfFlowUtils.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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