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

Java MatchBuilder类代码示例

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

本文整理汇总了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类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: programBridgePortAclEntry

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

    String flowId = "PipelineAcl_BridgePort_" + bridgePort.toString();

    AccessListEntries accessListEntries = acl.getAccessListEntries();

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

        MatchBuilder matchBuilder = new MatchBuilder();
        matchBuilder = OfMatchUtils.createInPortMatch(matchBuilder, dpid, bridgePort);

        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,代码行数:25,代码来源:PipelineAclHandler.java


示例17: createIpProtocolMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
private MatchBuilder createIpProtocolMatch(MatchBuilder matchBuilder, short ipProtocol) {

        IpMatchBuilder ipMmatch = new IpMatchBuilder();
        if (ipProtocol == PROTOCOL_TCP) {
            ipMmatch.setIpProtocol(PROTOCOL_TCP);
        } else if (ipProtocol == PROTOCOL_UDP) {
            ipMmatch.setIpProtocol(PROTOCOL_UDP);
        } else if (ipProtocol == PROTOCOL_ICMP) {
            ipMmatch.setIpProtocol(PROTOCOL_ICMP);
        } else {
            ipMmatch.setIpProtocol(ipProtocol);
        }

        matchBuilder.setIpMatch(ipMmatch.build());
        return matchBuilder;
    }
 
开发者ID:opendaylight,项目名称:faas,代码行数:17,代码来源:PipelineAclHandler.java


示例18: createEthSrcDstMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
public static MatchBuilder createEthSrcDstMatch(MatchBuilder matchBuilder, MacAddress srcMac, MacAddress dstMac) {
    EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
    if (srcMac != null) {
        EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
        ethSourceBuilder.setAddress(srcMac);
        ethernetMatch.setEthernetSource(ethSourceBuilder.build());
    }
    if (dstMac != null) {
        EthernetDestinationBuilder ethDestinationBuild = new EthernetDestinationBuilder();
        ethDestinationBuild.setAddress(dstMac);
        ethernetMatch.setEthernetDestination(ethDestinationBuild.build());
    }
    if (matchBuilder.getEthernetMatch() != null && matchBuilder.getEthernetMatch().getEthernetType() != null) {
        ethernetMatch.setEthernetType(matchBuilder.getEthernetMatch().getEthernetType());
    }

    matchBuilder.setEthernetMatch(ethernetMatch.build());

    return matchBuilder;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:21,代码来源:OfMatchUtils.java


示例19: createVlanIdMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
/**
 * Create Ethernet Destination Match
 *
 * @param matchBuilder
 *            MatchBuilder Object without a match yet
 * @param vlanId
 *            Integer representing a VLAN ID Integer representing a VLAN ID
 * @return matchBuilder Map MatchBuilder Object with a match
 */
public static MatchBuilder createVlanIdMatch(MatchBuilder matchBuilder, VlanId vlanId, boolean present) {
    VlanMatchBuilder vlanMatchBuilder = new VlanMatchBuilder();
    VlanIdBuilder vlanIdBuilder = new VlanIdBuilder();
    if (vlanId.getValue() != 0) vlanIdBuilder.setVlanId(new VlanId(vlanId));
    vlanIdBuilder.setVlanIdPresent(present);
    vlanMatchBuilder.setVlanId(vlanIdBuilder.build());


    //VlanPcp vp = new VlanPcp((short)3);
    //vlanMatchBuilder.setVlanPcp(vp);

    matchBuilder.setVlanMatch(vlanMatchBuilder.build());

    return matchBuilder;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:25,代码来源:OfMatchUtils.java


示例20: createDmacDestIpMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入依赖的package包/类
public static MatchBuilder createDmacDestIpMatch(MatchBuilder matchBuilder, String destMac,
        Ipv4Prefix destIpPrefix) {

    EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
    EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
    ethTypeBuilder.setType(new EtherType(0x0800L));
    ethernetMatch.setEthernetType(ethTypeBuilder.build());

    if (destMac != null) {
        EthernetDestinationBuilder ethDestinationBuilder = new EthernetDestinationBuilder();
        ethDestinationBuilder.setAddress(new MacAddress(destMac));
        ethernetMatch.setEthernetDestination(ethDestinationBuilder.build());
        matchBuilder.setEthernetMatch(ethernetMatch.build());
    }

    if (destIpPrefix != null) {
        Ipv4Prefix canonicalizedIpv4Prefix = IpAddressUtils.canonicalizeIpPrefixToNetAddress(destIpPrefix);
        Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
        ipv4match.setIpv4Destination(canonicalizedIpv4Prefix);
        matchBuilder.setLayer3Match(ipv4match.build());
    }

    return matchBuilder;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:25,代码来源:OfMatchUtils.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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