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


Java MatchBuilder.setEthernetMatch方法代码示例

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


在下文中一共展示了MatchBuilder.setEthernetMatch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSrcL3Ipv6MatchWithMac

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Creates a Match with src ip address mac address set.
 *
 * @param matchBuilder
 *            MatchBuilder Object
 * @param srcip
 *            String containing an IPv6 prefix
 * @param srcMac
 *            The source macAddress
 * @return matchBuilder Map Object with a match
 */
public static MatchBuilder createSrcL3Ipv6MatchWithMac(MatchBuilder matchBuilder, Ipv6Prefix srcip,
        MacAddress srcMac) {

    Ipv6MatchBuilder ipv6MatchBuilder = new Ipv6MatchBuilder();
    ipv6MatchBuilder.setIpv6Source(srcip);
    EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
    ethTypeBuilder.setType(new EtherType(0x86DDL));
    EthernetMatchBuilder eth = new EthernetMatchBuilder();
    eth.setEthernetType(ethTypeBuilder.build());
    eth.setEthernetSource(new EthernetSourceBuilder().setAddress(srcMac).build());

    matchBuilder.setLayer3Match(ipv6MatchBuilder.build());
    matchBuilder.setEthernetMatch(eth.build());
    return matchBuilder;

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

示例2: createDhcpMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Create a DHCP match with port provided.
 *
 * @param matchBuilder
 *            the match builder
 * @param srcPort
 *            the source port
 * @param dstPort
 *            the destination port
 * @return the DHCP match
 */
public static MatchBuilder createDhcpMatch(MatchBuilder matchBuilder, int srcPort, int dstPort) {

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

    IpMatchBuilder ipmatch = new IpMatchBuilder();
    ipmatch.setIpProtocol(UDP_SHORT);
    matchBuilder.setIpMatch(ipmatch.build());

    UdpMatchBuilder udpmatch = new UdpMatchBuilder();
    udpmatch.setUdpSourcePort(new PortNumber(srcPort));
    udpmatch.setUdpDestinationPort(new PortNumber(dstPort));
    matchBuilder.setLayer4Match(udpmatch.build());

    return matchBuilder;

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

示例3: 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

示例4: createSrcL3Ipv4MatchWithMac

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Creates a Match with src ip address mac address set.
 *
 * @param matchBuilder
 *            MatchBuilder Object
 * @param srcip
 *            String containing an IPv4 prefix
 * @param srcMac
 *            The source macAddress
 * @return matchBuilder Map Object with a match
 */
public static MatchBuilder createSrcL3Ipv4MatchWithMac(MatchBuilder matchBuilder, Ipv4Prefix srcip,
        MacAddress srcMac) {

    Ipv4MatchBuilder ipv4MatchBuilder = new Ipv4MatchBuilder();
    Ipv4Prefix canonicalizedIpv4Prefix = IpAddressUtils.canonicalizeIpPrefixToNetAddress(srcip);
    ipv4MatchBuilder.setIpv4Source(canonicalizedIpv4Prefix);
    EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
    ethTypeBuilder.setType(new EtherType(0x0800L));
    EthernetMatchBuilder eth = new EthernetMatchBuilder();
    eth.setEthernetType(ethTypeBuilder.build());
    eth.setEthernetSource(new EthernetSourceBuilder().setAddress(srcMac).build());

    matchBuilder.setLayer3Match(ipv4MatchBuilder.build());
    matchBuilder.setEthernetMatch(eth.build());
    return matchBuilder;

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

示例5: createSetSrcTcpMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Create Source TCP Port Match
 *
 * @param matchBuilder
 *            MatchBuilder Object without a match yet
 * @param tcpport
 *            Integer representing a source TCP port
 * @return matchBuilder Map MatchBuilder Object with a match
 */
public static MatchBuilder createSetSrcTcpMatch(MatchBuilder matchBuilder, PortNumber tcpport) {

    EthernetMatchBuilder ethType = new EthernetMatchBuilder();
    EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
    ethTypeBuilder.setType(new EtherType(0x0800L));
    ethType.setEthernetType(ethTypeBuilder.build());
    matchBuilder.setEthernetMatch(ethType.build());

    IpMatchBuilder ipmatch = new IpMatchBuilder();
    ipmatch.setIpProtocol((short) 6);
    matchBuilder.setIpMatch(ipmatch.build());

    TcpMatchBuilder tcpmatch = new TcpMatchBuilder();
    tcpmatch.setTcpSourcePort(tcpport);
    matchBuilder.setLayer4Match(tcpmatch.build());

    return matchBuilder;

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

示例6: createIpProtocolMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Create TCP Port Match
 *
 * @param matchBuilder
 *            MatchBuilder Object without a match yet
 * @param ipProtocol
 *            Integer representing the IP protocol
 * @return matchBuilder Map MatchBuilder Object with a match
 */
public static MatchBuilder createIpProtocolMatch(MatchBuilder matchBuilder, short ipProtocol) {

    EthernetMatchBuilder ethType = new EthernetMatchBuilder();
    EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
    ethTypeBuilder.setType(new EtherType(0x0800L));
    ethType.setEthernetType(ethTypeBuilder.build());
    matchBuilder.setEthernetMatch(ethType.build());

    IpMatchBuilder ipMmatch = new IpMatchBuilder();
    if (ipProtocol == TCP_SHORT) {
        ipMmatch.setIpProtocol(TCP_SHORT);
    } else if (ipProtocol == UDP_SHORT) {
        ipMmatch.setIpProtocol(UDP_SHORT);
    } else if (ipProtocol == ICMP_SHORT) {
        ipMmatch.setIpProtocol(ICMP_SHORT);
    }
    matchBuilder.setIpMatch(ipMmatch.build());
    return matchBuilder;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:29,代码来源:OfMatchUtils.java

示例7: createIpv6ProtocolMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Create TCP Port Match
 *
 * @param matchBuilder
 *            MatchBuilder Object without a match yet
 * @param ipProtocol
 *            Integer representing the IP protocol
 * @return matchBuilder Map MatchBuilder Object with a match
 */
public static MatchBuilder createIpv6ProtocolMatch(MatchBuilder matchBuilder, short ipProtocol) {

    EthernetMatchBuilder ethType = new EthernetMatchBuilder();
    EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
    ethTypeBuilder.setType(new EtherType(0x86DDL));
    ethType.setEthernetType(ethTypeBuilder.build());
    matchBuilder.setEthernetMatch(ethType.build());

    IpMatchBuilder ipMmatch = new IpMatchBuilder();
    if (ipProtocol == TCP_SHORT) {
        ipMmatch.setIpProtocol(TCP_SHORT);
    } else if (ipProtocol == UDP_SHORT) {
        ipMmatch.setIpProtocol(UDP_SHORT);
    } else if (ipProtocol == ICMP_SHORT) {
        ipMmatch.setIpProtocol(ICMP_SHORT);
    }
    matchBuilder.setIpMatch(ipMmatch.build());
    return matchBuilder;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:29,代码来源:OfMatchUtils.java

示例8: createMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
private Match createMatch(Ipv4Prefix ipv4Prefix) {
    final Ipv4MatchBuilder ipv4MatchBuilder = new Ipv4MatchBuilder();
    ipv4MatchBuilder.setIpv4Source(ipv4Prefix);

    Layer3Match layer3Match = ipv4MatchBuilder.build();

    final MatchBuilder matchBuilder = new MatchBuilder();
    final EthernetMatchBuilder ethernetMatchBuilder = new EthernetMatchBuilder();
    final EthernetTypeBuilder ethernetTypeBuilder = new EthernetTypeBuilder();

    ethernetTypeBuilder.setType(new EtherType(ETHER_TYPE));
    ethernetMatchBuilder.setEthernetType(ethernetTypeBuilder.build());

    matchBuilder.setLayer3Match(layer3Match);
    matchBuilder.setEthernetMatch(ethernetMatchBuilder.build());

    return matchBuilder.build();
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:19,代码来源:OFRuleWithMeterManager.java

示例9: createEthMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Create Ethernet Source Match
 *
 * @param matchBuilder MatchBuilder Object without a match yet
 * @param srcMac     String representing a source MAC
 * @param dstMac     String representing a destination MAC
 * @return matchBuilder Map MatchBuilder Object with a match
 */
public static MatchBuilder createEthMatch(MatchBuilder matchBuilder, MacAddress srcMac, MacAddress dstMac) {
    Preconditions.checkNotNull(matchBuilder);
    EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
    if (srcMac != null) {
        EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
        ethSourceBuilder.setAddress(srcMac);
        ethernetMatch.setEthernetSource(ethSourceBuilder.build());
    }
    if (dstMac != null) {
        EthernetDestinationBuilder ethDestinationBuilder = new EthernetDestinationBuilder();
        ethDestinationBuilder.setAddress(dstMac);
        ethernetMatch.setEthernetDestination(ethDestinationBuilder.build());
    }
    matchBuilder.setEthernetMatch(ethernetMatch.build());
    return matchBuilder;
}
 
开发者ID:opendaylight,项目名称:nic,代码行数:25,代码来源:MatchUtils.java

示例10: aceIpAcl

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
private void aceIpAcl(String nodeName, String flowId, MatchBuilder matchBuilder, AceIp aceIp, boolean isWriteFlow,
        Actions aclActions) {
    NodeBuilder nodeBuilder = createNodeBuilder(nodeName);

    if (aceIp.getDscp() != null) {
        OfMatchUtils.addDscp(matchBuilder, aceIp.getDscp().getValue());
    }

    short aceIpProtocol = aceIp.getProtocol();
    matchBuilder = createIpProtocolMatch(matchBuilder, aceIpProtocol);

    if (aceIp.getAceIpVersion() instanceof AceIpv6) {
        /* TODO IPv6 Support */
        return;
    } else {
        // Match IPv4 protocol and IP Address
        EthernetMatchBuilder eth = new EthernetMatchBuilder();
        EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
        ethTypeBuilder.setType(new EtherType(0x0800L));
        eth.setEthernetType(ethTypeBuilder.build());
        matchBuilder.setEthernetMatch(eth.build());

        createIpAddressMatch(matchBuilder, aceIp);

        // Match IP protocol, Now, support TCP, UDP, ICMP
        if (aceIpProtocol != 0) {
            if (PROTOCOL_TCP == aceIpProtocol) {
                // Set TCP Port
                matchBuilder = createTcpMatch(matchBuilder, aceIp);
            }

            if (PROTOCOL_UDP == aceIpProtocol) {
                // Set UDP Port
                matchBuilder = createUdpMatch(matchBuilder, aceIp);
            }
        }
    }

    syncFlow(flowId, nodeBuilder, matchBuilder, ACL_MATCH_PRIORITY, isWriteFlow, aclActions);
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:41,代码来源:PipelineAclHandler.java

示例11: createEtherTypeMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Create EtherType Match
 *
 * @param matchBuilder
 *            Map matchBuilder MatchBuilder Object without a match
 * @param etherType
 *            Long EtherType
 * @return matchBuilder Map MatchBuilder Object with a match
 */
public static MatchBuilder createEtherTypeMatch(MatchBuilder matchBuilder, EtherType etherType) {

    EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
    EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
    ethTypeBuilder.setType(new EtherType(etherType));
    ethernetMatch.setEthernetType(ethTypeBuilder.build());
    matchBuilder.setEthernetMatch(ethernetMatch.build());

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

示例12: createEthSrcMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Create Ethernet Source Match
 *
 * @param matchBuilder
 *            MatchBuilder Object without a match yet
 * @param sMacAddr
 *            String representing a source MAC
 * @return matchBuilder Map MatchBuilder Object with a match
 */
public static MatchBuilder createEthSrcMatch(MatchBuilder matchBuilder, MacAddress sMacAddr) {

    EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
    EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
    ethSourceBuilder.setAddress(sMacAddr);
    ethernetMatch.setEthernetSource(ethSourceBuilder.build());
    matchBuilder.setEthernetMatch(ethernetMatch.build());

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

示例13: createEthTypeMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
public static MatchBuilder createEthTypeMatch(MatchBuilder matchBuilder, String sMacAddr) {

        EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
        EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
        ethTypeBuilder.setType(new EtherType(new Long(0x8100)));
        ethernetMatch.setEthernetType(ethTypeBuilder.build());
        matchBuilder.setEthernetMatch(ethernetMatch.build());

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

示例14: createDhcpv6ServerMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Creates DHCPv6 server packet match with DHCP mac address and port.
 *
 * @param matchBuilder
 *            the matchbuilder
 * @param dhcpServerMac
 *            MAc address of the DHCP server of the subnet
 * @param srcPort
 *            the source port
 * @param dstPort
 *            the destination port
 * @return the DHCP server match
 */
public static MatchBuilder createDhcpv6ServerMatch(MatchBuilder matchBuilder, String dhcpServerMac, int srcPort,
        int dstPort) {

    EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
    EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
    ethTypeBuilder.setType(new EtherType(0x86DDL));
    ethernetMatch.setEthernetType(ethTypeBuilder.build());
    matchBuilder.setEthernetMatch(ethernetMatch.build());

    EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
    ethSourceBuilder.setAddress(new MacAddress(dhcpServerMac));
    ethernetMatch.setEthernetSource(ethSourceBuilder.build());
    matchBuilder.setEthernetMatch(ethernetMatch.build());

    IpMatchBuilder ipmatch = new IpMatchBuilder();
    ipmatch.setIpProtocol(UDP_SHORT);
    matchBuilder.setIpMatch(ipmatch.build());

    UdpMatchBuilder udpmatch = new UdpMatchBuilder();
    udpmatch.setUdpSourcePort(new PortNumber(srcPort));
    udpmatch.setUdpDestinationPort(new PortNumber(dstPort));
    matchBuilder.setLayer4Match(udpmatch.build());

    return matchBuilder;

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

示例15: createDhcpServerMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Creates DHCP server packet match with DHCP mac address and port.
 *
 * @param matchBuilder
 *            the matchbuilder
 * @param dhcpServerMac
 *            MAc address of the DHCP server of the subnet
 * @param srcPort
 *            the source port
 * @param dstPort
 *            the destination port
 * @return the DHCP server match
 */
public static MatchBuilder createDhcpServerMatch(MatchBuilder matchBuilder, String dhcpServerMac, int srcPort,
        int dstPort) {

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

    EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
    ethSourceBuilder.setAddress(new MacAddress(dhcpServerMac));
    ethernetMatch.setEthernetSource(ethSourceBuilder.build());
    matchBuilder.setEthernetMatch(ethernetMatch.build());

    IpMatchBuilder ipmatch = new IpMatchBuilder();
    ipmatch.setIpProtocol(UDP_SHORT);
    matchBuilder.setIpMatch(ipmatch.build());

    UdpMatchBuilder udpmatch = new UdpMatchBuilder();
    udpmatch.setUdpSourcePort(new PortNumber(srcPort));
    udpmatch.setUdpDestinationPort(new PortNumber(dstPort));
    matchBuilder.setLayer4Match(udpmatch.build());

    return matchBuilder;

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


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