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


Java MatchBuilder.setLayer4Match方法代码示例

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


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

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

示例2: createSetDstTcpMatch

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

    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.setTcpDestinationPort(tcpDstPort);
    matchBuilder.setLayer4Match(tcpmatch.build());

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

示例3: createTcpFlagMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Test match for TCP_Flags
 *
 * @param matchBuilder
 *            MatchBuilder Object without a match yet
 * @param tcpPort
 *            PortNumber representing a destination TCP port
 * @param tcpFlag
 *            int representing a tcp_flag
 * @return match containing TCP_Flag (), IP Protocol (TCP), TCP_Flag (SYN)
 *         <p>
 *         Defined TCP Flag values in OVS v2.1+ TCP_FIN 0x001 / TCP_SYN
 *         0x002 / TCP_RST 0x004 TCP_PSH 0x008 / TCP_ACK 0x010 / TCP_URG
 *         0x020 TCP_ECE 0x040 / TCP_CWR 0x080 / TCP_NS 0x100
 */
public static MatchBuilder createTcpFlagMatch(MatchBuilder matchBuilder, PortNumber tcpPort, int tcpFlag) {

    // Ethertype match
    EthernetMatchBuilder ethernetType = new EthernetMatchBuilder();
    EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
    ethTypeBuilder.setType(new EtherType(0x0800L));
    ethernetType.setEthernetType(ethTypeBuilder.build());
    matchBuilder.setEthernetMatch(ethernetType.build());

    // TCP Protocol Match
    IpMatchBuilder ipMatch = new IpMatchBuilder(); // ipv4 version
    ipMatch.setIpProtocol((short) 6);
    matchBuilder.setIpMatch(ipMatch.build());

    // TCP Port Match
    PortNumber dstPort = new PortNumber(tcpPort);
    TcpMatchBuilder tcpMatch = new TcpMatchBuilder();
    tcpMatch.setTcpDestinationPort(dstPort);
    matchBuilder.setLayer4Match(tcpMatch.build());

    TcpFlagsMatchBuilder tcpFlagMatch = new TcpFlagsMatchBuilder();
    tcpFlagMatch.setTcpFlags(tcpFlag);
    matchBuilder.setTcpFlagsMatch(tcpFlagMatch.build());
    return matchBuilder;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:41,代码来源:OfMatchUtils.java

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

示例5: createDhcpv6Match

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 createDhcpv6Match(MatchBuilder matchBuilder, 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());

    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

示例6: createTcpMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
public static MatchBuilder createTcpMatch(MatchBuilder matchBuilder, Integer tcpSourcePortLower,
        Integer tcpDestinationPortLower) {
    TcpMatchBuilder tcpmatch = new TcpMatchBuilder();

    if (0 != tcpSourcePortLower) {
        tcpmatch.setTcpSourcePort(new PortNumber(tcpSourcePortLower));
    } else {
        /* TODO TCP PortRange Match */
    }

    if (0 != tcpDestinationPortLower) {
        tcpmatch.setTcpDestinationPort(new PortNumber(tcpDestinationPortLower));
    } else {
        /* TODO TCP PortRange Match */
    }

    matchBuilder.setLayer4Match(tcpmatch.build());

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

示例7: createUdpMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
public static MatchBuilder createUdpMatch(MatchBuilder matchBuilder, Integer udpSourcePortLower,
        Integer udpDestinationPortLower) {
    UdpMatchBuilder udpmatch = new UdpMatchBuilder();

    if (0 != udpSourcePortLower) {
        udpmatch.setUdpSourcePort(new PortNumber(udpSourcePortLower));
    } else {
        /* TODO UDP PortRange Match */
    }

    if (0 != udpDestinationPortLower) {
        udpmatch.setUdpDestinationPort(new PortNumber(udpDestinationPortLower));
    } else {
        /* TODO UDP PortRange Match */
    }

    matchBuilder.setLayer4Match(udpmatch.build());

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

示例8: createDmacTcpSynMatch

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Create dmac tcp syn match.
 *
 * @param matchBuilder
 *            the match builder
 * @param attachedMac
 *            the attached mac
 * @param tcpPort
 *            the tcp port
 * @param tcpFlag
 *            the tcp flag
 * @param tunnelID
 *            the tunnel iD
 * @return the match builder
 */
public static MatchBuilder createDmacTcpSynMatch(MatchBuilder matchBuilder, String attachedMac, PortNumber tcpPort,
        Integer tcpFlag, String tunnelID) {

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

    EthernetDestinationBuilder ethDestinationBuilder = new EthernetDestinationBuilder();
    ethDestinationBuilder.setAddress(new MacAddress(attachedMac));
    ethernetMatch.setEthernetDestination(ethDestinationBuilder.build());
    matchBuilder.setEthernetMatch(ethernetMatch.build());

    // TCP Protocol Match
    IpMatchBuilder ipMatch = new IpMatchBuilder(); // ipv4 version
    ipMatch.setIpProtocol((short) 6);
    matchBuilder.setIpMatch(ipMatch.build());

    // TCP Port Match
    PortNumber dstPort = new PortNumber(tcpPort);
    TcpMatchBuilder tcpMatch = new TcpMatchBuilder();
    tcpMatch.setTcpDestinationPort(dstPort);
    matchBuilder.setLayer4Match(tcpMatch.build());

    TcpFlagsMatchBuilder tcpFlagMatch = new TcpFlagsMatchBuilder();
    tcpFlagMatch.setTcpFlags(tcpFlag);
    matchBuilder.setTcpFlagsMatch(tcpFlagMatch.build());

    TunnelBuilder tunnelBuilder = new TunnelBuilder();
    tunnelBuilder.setTunnelId(new BigInteger(tunnelID));
    matchBuilder.setTunnel(tunnelBuilder.build());

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

示例9: createSmacTcpSyn

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Create smac tcp syn.
 *
 * @param matchBuilder
 *            the match builder
 * @param attachedMac
 *            the attached mac
 * @param tcpPort
 *            the tcp port
 * @param tcpFlag
 *            the tcp flag
 * @param tunnelID
 *            the tunnel iD
 * @return the match builder
 */
public static MatchBuilder createSmacTcpSyn(MatchBuilder matchBuilder, String attachedMac, PortNumber tcpPort,
        Integer tcpFlag, String tunnelID) {

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

    EthernetSourceBuilder ethSrcBuilder = new EthernetSourceBuilder();
    ethSrcBuilder.setAddress(new MacAddress(attachedMac));
    ethernetMatch.setEthernetSource(ethSrcBuilder.build());
    matchBuilder.setEthernetMatch(ethernetMatch.build());

    // TCP Protocol Match
    IpMatchBuilder ipMatch = new IpMatchBuilder(); // ipv4 version
    ipMatch.setIpProtocol((short) 6);
    matchBuilder.setIpMatch(ipMatch.build());

    // TCP Port Match
    PortNumber dstPort = new PortNumber(tcpPort);
    TcpMatchBuilder tcpMatch = new TcpMatchBuilder();
    tcpMatch.setTcpDestinationPort(dstPort);
    matchBuilder.setLayer4Match(tcpMatch.build());

    TcpFlagsMatchBuilder tcpFlagMatch = new TcpFlagsMatchBuilder();
    tcpFlagMatch.setTcpFlags(tcpFlag);
    matchBuilder.setTcpFlagsMatch(tcpFlagMatch.build());

    TunnelBuilder tunnelBuilder = new TunnelBuilder();
    tunnelBuilder.setTunnelId(new BigInteger(tunnelID));
    matchBuilder.setTunnel(tunnelBuilder.build());

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

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

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

示例12: addLayer4Match

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Add a layer4 match to an existing match
 *
 * @param matchBuilder
 *            Map matchBuilder MatchBuilder Object with a match
 * @param protocol
 *            The layer4 protocol
 * @param srcPort
 *            The src port
 * @param destPort
 *            The destination port
 * @return matchBuilder Map Object with a match
 */
public static MatchBuilder addLayer4Match(MatchBuilder matchBuilder, int protocol, int srcPort, int destPort) {
    IpMatchBuilder ipmatch = new IpMatchBuilder();
    if (TCP_SHORT == protocol) {
        ipmatch.setIpProtocol(TCP_SHORT);
        TcpMatchBuilder tcpmatch = new TcpMatchBuilder();
        if (0 != srcPort) {
            tcpmatch.setTcpSourcePort(new PortNumber(srcPort));
        }
        if (0 != destPort) {
            tcpmatch.setTcpDestinationPort(new PortNumber(destPort));
        }
        matchBuilder.setLayer4Match(tcpmatch.build());
    } else if (UDP_SHORT == protocol) {
        ipmatch.setIpProtocol(UDP_SHORT);
        UdpMatchBuilder udpMatch = new UdpMatchBuilder();
        if (0 != srcPort) {
            udpMatch.setUdpSourcePort(new PortNumber(srcPort));
        }
        if (0 != destPort) {
            udpMatch.setUdpDestinationPort(new PortNumber(destPort));
        }
        matchBuilder.setLayer4Match(udpMatch.build());
    } else if (SCTP_SHORT == protocol) {
        ipmatch.setIpProtocol(SCTP_SHORT);
        SctpMatchBuilder sctpMatchBuilder = new SctpMatchBuilder();
        if (0 != srcPort) {
            sctpMatchBuilder.setSctpSourcePort(new PortNumber(srcPort));
        }
        if (0 != destPort) {
            sctpMatchBuilder.setSctpDestinationPort(new PortNumber(destPort));
        }
        matchBuilder.setLayer4Match(sctpMatchBuilder.build());
    }
    matchBuilder.setIpMatch(ipmatch.build());

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

示例13: createDmacTcpSynDstIpPrefixTcpPort

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Create dmac tcp syn dst ip prefix tcp port.
 *
 * @param matchBuilder
 *            the match builder
 * @param attachedMac
 *            the attached mac
 * @param tcpPort
 *            the tcp port
 * @param tcpFlag
 *            the tcp flag
 * @param segmentationId
 *            the segmentation id
 * @param dstIp
 *            the dst ip
 * @return the match builder
 */
public static MatchBuilder createDmacTcpSynDstIpPrefixTcpPort(MatchBuilder matchBuilder, MacAddress attachedMac,
        PortNumber tcpPort, Integer tcpFlag, String segmentationId, Ipv4Prefix dstIp) {

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

    EthernetDestinationBuilder ethDestinationBuilder = new EthernetDestinationBuilder();
    ethDestinationBuilder.setAddress(attachedMac);
    ethernetMatch.setEthernetDestination(ethDestinationBuilder.build());

    matchBuilder.setEthernetMatch(ethernetMatch.build());

    Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();

    Ipv4Prefix canonicalizedIpv4Prefix = IpAddressUtils.canonicalizeIpPrefixToNetAddress(dstIp);
    ipv4match.setIpv4Destination(canonicalizedIpv4Prefix);
    matchBuilder.setLayer3Match(ipv4match.build());

    // TCP Protocol Match
    IpMatchBuilder ipMatch = new IpMatchBuilder(); // ipv4 version
    ipMatch.setIpProtocol(TCP_SHORT);
    matchBuilder.setIpMatch(ipMatch.build());

    // TCP Port Match
    PortNumber dstPort = new PortNumber(tcpPort);
    TcpMatchBuilder tcpMatch = new TcpMatchBuilder();
    tcpMatch.setTcpDestinationPort(dstPort);
    matchBuilder.setLayer4Match(tcpMatch.build());

    TcpFlagsMatchBuilder tcpFlagMatch = new TcpFlagsMatchBuilder();
    tcpFlagMatch.setTcpFlags(tcpFlag);
    matchBuilder.setTcpFlagsMatch(tcpFlagMatch.build());

    TunnelBuilder tunnelBuilder = new TunnelBuilder();
    tunnelBuilder.setTunnelId(new BigInteger(segmentationId));
    matchBuilder.setTunnel(tunnelBuilder.build());

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

示例14: createSmacTcpSynDstIpPrefixTcpPort

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
 * Create smac tcp syn dst ip prefix tcp port.
 *
 * @param matchBuilder
 *            the match builder
 * @param attachedMac
 *            the attached mac
 * @param tcpPort
 *            the tcp port
 * @param tcpFlag
 *            the tcp flag
 * @param segmentationId
 *            the segmentation id
 * @param dstIp
 *            the dst ip
 * @return the match builder
 */
public static MatchBuilder createSmacTcpSynDstIpPrefixTcpPort(MatchBuilder matchBuilder, MacAddress attachedMac,
        PortNumber tcpPort, Integer tcpFlag, String segmentationId, Ipv4Prefix dstIp) {

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

    EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
    ethSourceBuilder.setAddress(attachedMac);
    ethernetMatch.setEthernetSource(ethSourceBuilder.build());

    matchBuilder.setEthernetMatch(ethernetMatch.build());

    Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
    Ipv4Prefix canonicalizedIpv4Prefix = IpAddressUtils.canonicalizeIpPrefixToNetAddress(dstIp);

    ipv4match.setIpv4Destination(canonicalizedIpv4Prefix);
    matchBuilder.setLayer3Match(ipv4match.build());

    // TCP Protocol Match
    IpMatchBuilder ipMatch = new IpMatchBuilder(); // ipv4 version
    ipMatch.setIpProtocol(TCP_SHORT);
    matchBuilder.setIpMatch(ipMatch.build());

    // TCP Port Match
    PortNumber dstPort = new PortNumber(tcpPort);
    TcpMatchBuilder tcpMatch = new TcpMatchBuilder();
    tcpMatch.setTcpDestinationPort(dstPort);
    matchBuilder.setLayer4Match(tcpMatch.build());

    TcpFlagsMatchBuilder tcpFlagMatch = new TcpFlagsMatchBuilder();
    tcpFlagMatch.setTcpFlags(tcpFlag);
    matchBuilder.setTcpFlagsMatch(tcpFlagMatch.build());

    TunnelBuilder tunnelBuilder = new TunnelBuilder();
    tunnelBuilder.setTunnelId(new BigInteger(segmentationId));
    matchBuilder.setTunnel(tunnelBuilder.build());

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


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