当前位置: 首页>>代码示例>>Java>>正文


Java MatchBuilder类代码示例

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


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

示例1: mergeIpv4Match

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
private static Ipv4Match mergeIpv4Match(MatchBuilder match, Ipv4MatchBuilder ipMatchBuilder) {
    Ipv4Match ipv4Match = (Ipv4Match) match.getLayer3Match();
    if (ipv4Match == null) {
        return ipMatchBuilder.build();
    }

    if (ipv4Match.getIpv4Destination() != null) {
        ipMatchBuilder.setIpv4Destination(ipv4Match.getIpv4Destination());
    }

    if (ipv4Match.getIpv4Source() != null) {
        ipMatchBuilder.setIpv4Source(ipv4Match.getIpv4Source());
    }

    return ipMatchBuilder.build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:AclMatches.java

示例2: mergeIpv6Match

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
private static Ipv6Match mergeIpv6Match(MatchBuilder match, Ipv6MatchBuilder ipMatchBuilder) {
    Ipv6Match ipv6Match = (Ipv6Match) match.getLayer3Match();
    if (ipv6Match == null) {
        return ipMatchBuilder.build();
    }

    if (ipv6Match.getIpv6Destination() != null) {
        ipMatchBuilder.setIpv6Destination(ipv6Match.getIpv6Destination());
    }

    if (ipv6Match.getIpv6Source() != null) {
        ipMatchBuilder.setIpv6Source(ipv6Match.getIpv6Source());
    }

    return ipMatchBuilder.build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:AclMatches.java

示例3: mergeIpMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
private static IpMatch mergeIpMatch(MatchBuilder match, IpMatchBuilder ipMatchBuilder) {
    IpMatch ipMatch = match.getIpMatch();
    if (ipMatch == null) {
        return ipMatchBuilder.build();
    }

    if (ipMatch.getIpDscp() != null) {
        ipMatchBuilder.setIpDscp(ipMatch.getIpDscp());
    }

    if (ipMatch.getIpEcn() != null) {
        ipMatchBuilder.setIpEcn(ipMatch.getIpEcn());
    }

    if (ipMatch.getIpProto() != null) {
        ipMatchBuilder.setIpProto(ipMatch.getIpProto());
    }

    if (ipMatch.getIpProtocol() != null) {
        ipMatchBuilder.setIpProtocol(ipMatch.getIpProtocol());
    }

    return ipMatchBuilder.build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:25,代码来源:AclMatches.java

示例4: mergeEthernetMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
private static EthernetMatch mergeEthernetMatch(MatchBuilder match, EthernetMatchBuilder ethMatchBuilder) {
    EthernetMatch ethMatch = match.getEthernetMatch();
    if (ethMatch == null) {
        return ethMatchBuilder.build();
    }

    if (ethMatch.getEthernetDestination() != null) {
        ethMatchBuilder.setEthernetDestination(ethMatch.getEthernetDestination());
    }

    if (ethMatch.getEthernetSource() != null) {
        ethMatchBuilder.setEthernetSource(ethMatch.getEthernetSource());
    }

    if (ethMatch.getEthernetType() != null) {
        ethMatchBuilder.setEthernetType(ethMatch.getEthernetType());
    }

    return ethMatchBuilder.build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:21,代码来源:AclMatches.java

示例5: addExtension

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
private static void addExtension(MatchBuilder match, Class<? extends ExtensionKey> extensionKey,
                                 NxAugMatchNodesNodeTableFlow am) {
    GeneralAugMatchNodesNodeTableFlow existingAugmentations = match
        .getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
    List<ExtensionList> extensions = null;
    if (existingAugmentations != null) {
        extensions = existingAugmentations.getExtensionList();
    }
    if (extensions == null) {
        extensions = new ArrayList<>();
    }

    extensions.add(new ExtensionListBuilder().setExtensionKey(extensionKey)
        .setExtension(new ExtensionBuilder().addAugmentation(NxAugMatchNodesNodeTableFlow.class, am).build())
        .build());

    GeneralAugMatchNodesNodeTableFlow generalAugMatchNodesNode = new GeneralAugMatchNodesNodeTableFlowBuilder()
        .setExtensionList(extensions).build();
    match.addAugmentation(GeneralAugMatchNodesNodeTableFlow.class, generalAugMatchNodesNode);
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:21,代码来源:OpenFlow13Utils.java

示例6: createFlowBuilder

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

示例7: createIngressClassifierSfcTunnelTrafficCaptureFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
public Flow createIngressClassifierSfcTunnelTrafficCaptureFlow(NodeId nodeId) {
    MatchBuilder match = new MatchBuilder();
    OpenFlow13Utils.addMatchTunId(match, SFC_TUNNEL_ID);
    OpenFlow13Utils.addMatchEthNsh(match);

    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE,
            actionList.size()));

    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
    String flowIdStr = INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_FLOW_NAME + nodeId.getValue();


    return OpenFlow13Utils.createFlowBuilder(NwConstants.INTERNAL_TUNNEL_TABLE,
            INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_PRIORITY,
            INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_COOKIE,
            INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_FLOW_NAME, flowIdStr, match, isb).build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:19,代码来源:OpenFlow13Provider.java

示例8: createIngressClassifierFilterEthNshFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
public Flow createIngressClassifierFilterEthNshFlow(NodeId nodeId) {
    MatchBuilder match = new MatchBuilder();
    OpenFlow13Utils.addMatchEthNsh(match);
    OpenFlow13Utils.addMatchTunDstIp(match, NULL_IP);

    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.LPORT_DISPATCHER_TABLE,
        actionList.size()));

    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
    String flowIdStr = INGRESS_CLASSIFIER_FILTER_ETHNSH_FLOW_NAME + nodeId.getValue();

    return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE,
            INGRESS_CLASSIFIER_FILTER_ETH_NSH_PRIORITY, INGRESS_CLASSIFIER_FILTER_COOKIE,
        INGRESS_CLASSIFIER_FILTER_ETHNSH_FLOW_NAME, flowIdStr, match, isb).build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:OpenFlow13Provider.java

示例9: createIngressClassifierFilterChainEgressFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
public Flow createIngressClassifierFilterChainEgressFlow(NodeId nodeId, long nsp, short egressNsi) {

        MatchBuilder match = new MatchBuilder();
        OpenFlow13Utils.addMatchNsp(match, nsp);
        OpenFlow13Utils.addMatchNsi(match, egressNsi);

        List<Action> actionList = new ArrayList<>();
        actionList.add(OpenFlow13Utils.createActionNxMoveNsc4ToReg6Register(actionList.size()));
        actionList.add(OpenFlow13Utils.createActionNxPopNsh(actionList.size()));
        actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.EGRESS_LPORT_DISPATCHER_TABLE,
                actionList.size()));

        InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
        String flowIdStr = INGRESS_CLASSIFIER_FILTER_NSH_CHAIN_EGRESS_FLOW_NAME + nodeId.getValue() + "_" + nsp;

        return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE,
                INGRESS_CLASSIFIER_FILTER_CHAIN_EGRESS_PRIORITY, INGRESS_CLASSIFIER_FILTER_COOKIE,
                INGRESS_CLASSIFIER_FILTER_NSH_CHAIN_EGRESS_FLOW_NAME, flowIdStr, match, isb).build();
    }
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:OpenFlow13Provider.java

示例10: createIngressClassifierAclFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
public Flow createIngressClassifierAclFlow(NodeId nodeId, MatchBuilder match, Long port, long nsp, short nsi) {
    OpenFlow13Utils.addMatchInPort(match, nodeId, port);

    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionNxPushNsh(actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadNshMdtype(NSH_MDTYPE_ONE, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadNp(NSH_NP_ETH, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadNsp((int) nsp, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadNsi(nsi, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadNshc1(ACL_FLAG_CONTEXT_VALUE, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadNshc2(DEFAULT_NSH_CONTEXT_VALUE, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.LPORT_DISPATCHER_TABLE,
        actionList.size()));

    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);

    // The flowIdStr needs to be unique, so the best way to make it unique is to use the match
    String flowIdStr = INGRESS_CLASSIFIER_ACL_FLOW_NAME + "_" + nodeId.getValue() + match.build().toString();

    return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_ACL_TABLE,
        INGRESS_CLASSIFIER_ACL_PRIORITY, INGRESS_CLASSIFIER_ACL_COOKIE, INGRESS_CLASSIFIER_ACL_FLOW_NAME,
        flowIdStr, match, isb).build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:24,代码来源:OpenFlow13Provider.java

示例11: createIngressClassifierAclNoMatchFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
public Flow createIngressClassifierAclNoMatchFlow(NodeId nodeId) {
    // This is a MatchAny flow
    MatchBuilder match = new MatchBuilder();

    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.LPORT_DISPATCHER_TABLE,
            actionList.size()));

    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);

    String flowIdStr = INGRESS_CLASSIFIER_ACL_FLOW_NAME + "_" + nodeId.getValue();

    return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_ACL_TABLE,
            INGRESS_CLASSIFIER_ACL_NOMATCH_PRIORITY, INGRESS_CLASSIFIER_ACL_COOKIE,
            INGRESS_CLASSIFIER_ACL_FLOW_NAME, flowIdStr, match, isb).build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:OpenFlow13Provider.java

示例12: createEgressClassifierNextHopNoC1C2Flow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
public Flow createEgressClassifierNextHopNoC1C2Flow(NodeId nodeId) {
    MatchBuilder match = new MatchBuilder();
    OpenFlow13Utils.addMatchNshNsc1(match, DEFAULT_NSH_CONTEXT_VALUE);
    OpenFlow13Utils.addMatchNshNsc2(match, DEFAULT_NSH_CONTEXT_VALUE);

    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionNxMoveReg0ToNsc1Register(actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxMoveTunIdToNsc2Register(actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxMoveReg6ToNsc4Register(actionList.size()));
    actionList.add(OpenFlow13Utils.createActionNxLoadTunId(SFC_TUNNEL_ID, actionList.size()));

    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
    OpenFlow13Utils.appendGotoTableInstruction(isb, NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE);
    String flowIdStr = EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_FLOW_NAME + nodeId.getValue();

    return OpenFlow13Utils.createFlowBuilder(NwConstants.EGRESS_SFC_CLASSIFIER_NEXTHOP_TABLE,
        EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_PRIORITY, EGRESS_CLASSIFIER_NEXTHOP_COOKIE,
        EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_FLOW_NAME, flowIdStr, match, isb).build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:20,代码来源:OpenFlow13Provider.java

示例13: createEgressClassifierTransportEgressRemoteFlow

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
public Flow createEgressClassifierTransportEgressRemoteFlow(NodeId nodeId, long nsp, long outport,
                                                            String firstHopIp) {
    MatchBuilder match = OpenFlow13Utils.getNspMatch(nsp);

    Long ipl = InetAddresses.coerceToInteger(InetAddresses.forString(firstHopIp)) & 0xffffffffL;
    List<Action> actionList = new ArrayList<>();
    actionList.add(OpenFlow13Utils.createActionNxLoadTunIpv4Dst(ipl, actionList.size()));
    actionList.add(OpenFlow13Utils.createActionOutPort("output:" + outport, actionList.size()));

    InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
    String flowIdStr = EGRESS_CLASSIFIER_TPORTEGRESS_FLOW_NAME + nodeId.getValue() + "_" + nsp;

    return OpenFlow13Utils.createFlowBuilder(NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE,
        EGRESS_CLASSIFIER_EGRESS_REMOTE_PRIORITY, EGRESS_CLASSIFIER_TPORTEGRESS_COOKIE,
        EGRESS_CLASSIFIER_TPORTEGRESS_FLOW_NAME, flowIdStr, match, isb).build();
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:17,代码来源:OpenFlow13Provider.java

示例14: buildEthMatchTest

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
@Test
public void buildEthMatchTest() {
    AceEthBuilder aceEthBuilder = new AceEthBuilder();
    aceEthBuilder.setDestinationMacAddress(new MacAddress(MAC_DST_STR));
    aceEthBuilder.setSourceMacAddress(new MacAddress(MAC_SRC_STR));

    MatchesBuilder matchesBuilder = new MatchesBuilder();
    matchesBuilder.setAceType(aceEthBuilder.build());

    // Create the aclMatches that is the object to be tested
    AclMatches aclMatches = new AclMatches(matchesBuilder.build());
    MatchBuilder matchBuilder = aclMatches.buildMatch();

    // The ethernet match should be there with src/dst values
    EthernetMatch ethMatch = matchBuilder.getEthernetMatch();
    assertNotNull(ethMatch);
    assertEquals(ethMatch.getEthernetSource().getAddress().getValue(), MAC_SRC_STR);
    assertEquals(ethMatch.getEthernetDestination().getAddress().getValue(), MAC_DST_STR);

    // The rest should be null
    assertNull(matchBuilder.getIpMatch());
    assertNull(matchBuilder.getLayer3Match());
    assertNull(matchBuilder.getLayer4Match());
}
 
开发者ID:opendaylight,项目名称:netvirt,代码行数:25,代码来源:AclMatchesTest.java

示例15: programBridgeDomainAclEntry

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
public void programBridgeDomainAclEntry(Long dpid, Long segmentationId, Acl acl, boolean isWriteFlow) {
    String nodeName = OPENFLOW + dpid;

    String flowId = "PipelineAcl_BridgeDomain_" + segmentationId.toString();

    AccessListEntries accessListEntries = acl.getAccessListEntries();

    for (Ace ace : accessListEntries.getAce()) {
        flowId = flowId + ace.getRuleName();
        Matches aclMatches = ace.getMatches();

        MatchBuilder matchBuilder = new MatchBuilder();

        OfMatchUtils.addNxRegMatch(matchBuilder,
                new OfMatchUtils.RegMatch(PipelineTrafficClassifier.REG_SRC_TUN_ID, segmentationId));

        Actions aclActions = ace.getActions();
        AceType aceType = aclMatches.getAceType();
        if (aceType instanceof AceEth) {
            aceEthAcl(nodeName, flowId, matchBuilder, (AceEth) aceType, isWriteFlow, aclActions);
        } else if (aceType instanceof AceIp) {
            aceIpAcl(nodeName, flowId, matchBuilder, (AceIp) aceType, isWriteFlow, aclActions);
        }

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


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