• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java OutputPortValues类的典型用法和代码示例

java 1次浏览

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

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

示例1: createSendToControllerInstructions

点赞 3

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.OutputPortValues; //导入依赖的package包/类
/**
 * Create Send to Controller Reserved Port Instruction (packet_in)
 *
 * @param nodeName Uri Prefix, containing nodeConnectorType and dpId (aka NodeId)
 * @param ib Map InstructionBuilder without any instructions
 * @return ib Map InstructionBuilder with instructions
 */
public static InstructionBuilder createSendToControllerInstructions(String nodeName, InstructionBuilder ib) {

    List<Action> actionList = new ArrayList<>();
    ActionBuilder ab = new ActionBuilder();

    OutputActionBuilder output = new OutputActionBuilder();
    output.setMaxLength(MAX_LENGTH);
    NodeId nodeId = new NodeId(nodeName);
    output.setOutputNodeConnector(new NodeConnectorId(nodeId.getValue() + ":"
            + OutputPortValues.CONTROLLER.toString()));
    ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
    ab.setOrder(0);
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());

    // Create an Apply Action
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);

    // Wrap our Apply Action in an Instruction
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());

    return ib;
}
 

开发者ID:opendaylight,
项目名称:faas,
代码行数:32,
代码来源:OfInstructionUtils.java

示例2: createNormalInstructions

点赞 3

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.OutputPortValues; //导入依赖的package包/类
/**
 * Create NORMAL Reserved Port Instruction (packet_in)
 *
 * @param nodeName Uri Prefix, containing nodeConnectorType and dpId (aka NodeId)
 * @param ib Map InstructionBuilder without any instructions
 * @return ib Map InstructionBuilder with instructions
 */

public static InstructionBuilder createNormalInstructions(String nodeName, InstructionBuilder ib) {

    List<Action> actionList = new ArrayList<>();
    ActionBuilder ab = new ActionBuilder();

    OutputActionBuilder output = new OutputActionBuilder();
    NodeId nodeId = new NodeId(nodeName);
    output.setOutputNodeConnector(new NodeConnectorId(nodeId.getValue() + ":"
            + OutputPortValues.NORMAL.toString()));
    ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
    ab.setOrder(0);
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());

    // Create an Apply Action
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);

    // Wrap our Apply Action in an Instruction
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());

    return ib;
}
 

开发者ID:opendaylight,
项目名称:faas,
代码行数:32,
代码来源:OfInstructionUtils.java

示例3: createLocalInstructions

点赞 3

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.OutputPortValues; //导入依赖的package包/类
/**
 * Create LOCAL Reserved Port Instruction
 *
 * @param ib Map InstructionBuilder without any instructions
 * @param dpidLong Long the datapath ID of a switch/node
 * @return ib Map InstructionBuilder with instructions
 */
public static InstructionBuilder createLocalInstructions(InstructionBuilder ib, long dpidLong) {
    List<Action> actionList = new ArrayList<>();
    ActionBuilder ab = new ActionBuilder();

    OutputActionBuilder output = new OutputActionBuilder();
    output.setOutputNodeConnector(new NodeConnectorId("openflow:" + dpidLong + ":"
            + OutputPortValues.LOCAL.toString()));
    ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
    ab.setOrder(0);
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());

    // Create an Apply Action
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);

    // Wrap our Apply Action in an Instruction
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());

    return ib;
}
 

开发者ID:opendaylight,
项目名称:faas,
代码行数:29,
代码来源:OfInstructionUtils.java

示例4: createArpReplyToControllerFlow

点赞 3

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

示例5: pushFlowsByMacAddress

点赞 3

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

示例6: createLldpReplyToControllerFlow

点赞 3

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

示例7: createOutputInstructions

点赞 3

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

示例8: createSendToControllerAction

点赞 2

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.OutputPortValues; //导入依赖的package包/类
/**
 * Creates {@link Action} representing output to the controller
 * @param order the order for the action
 * @return Action
 */
public static Action createSendToControllerAction(int order) {
    return new ActionBuilder().setOrder(order)
        .setKey(new ActionKey(order))
        .setAction(
                new OutputActionCaseBuilder().setOutputAction(
                        new OutputActionBuilder().setMaxLength(0xffff)
                            .setOutputNodeConnector(new Uri(OutputPortValues.CONTROLLER.toString()))
                            .build()).build())
        .build();
}
 

开发者ID:opendaylight,
项目名称:nic,
代码行数:16,
代码来源:FlowUtils.java

示例9: createOutputNormal

点赞 2

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.OutputPortValues; //导入依赖的package包/类
/**
 * @param order An integer representing the order of the Action
 * withinin the table.
 * @return Action with an order
 */
public static Action createOutputNormal(int order) {
    return new ActionBuilder().setOrder(order)
            .setKey(new ActionKey(order))
            .setAction(
                    new OutputActionCaseBuilder().setOutputAction(
                            new OutputActionBuilder().setMaxLength(0xffff)
                                    .setOutputNodeConnector(new Uri(OutputPortValues.NORMAL.toString()))
                                    .build()).build())
            .build();
}
 

开发者ID:opendaylight,
项目名称:nic,
代码行数:16,
代码来源:FlowUtils.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)