本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder.setIpMatch方法的典型用法代码示例。如果您正苦于以下问题:Java MatchBuilder.setIpMatch方法的具体用法?Java MatchBuilder.setIpMatch怎么用?Java MatchBuilder.setIpMatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder
的用法示例。
在下文中一共展示了MatchBuilder.setIpMatch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: createICMPv6Match
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* Match ICMPv6 code and type
*
* @param matchBuilder
* MatchBuilder Object
* @param type
* short representing an ICMP type
* @param code
* short representing an ICMP code
* @return matchBuilder Map MatchBuilder Object with a match
*/
public static MatchBuilder createICMPv6Match(MatchBuilder matchBuilder, short type, short code) {
// Build the IPv6 Match required per OVS Syntax
IpMatchBuilder ipmatch = new IpMatchBuilder();
ipmatch.setIpProtocol((short) 58);
matchBuilder.setIpMatch(ipmatch.build());
// Build the ICMPv6 Match
Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder();
if (type != ALL_ICMP || code != ALL_ICMP) {
icmpv6match.setIcmpv6Type(type);
icmpv6match.setIcmpv6Code(code);
}
matchBuilder.setIcmpv6Match(icmpv6match.build());
return matchBuilder;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: createTcpSynWithProtoMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* Create tcp syn with proto match.
*
* @param matchBuilder
* the match builder
* @return matchBuilder match builder
*/
public static MatchBuilder createTcpSynWithProtoMatch(MatchBuilder matchBuilder) {
// 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());
TcpFlagsMatchBuilder tcpFlagMatch = new TcpFlagsMatchBuilder();
tcpFlagMatch.setTcpFlags(TCP_SYN);
matchBuilder.setTcpFlagsMatch(tcpFlagMatch.build());
return matchBuilder;
}
示例7: 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;
}
示例8: 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;
}
示例9: createTcpProtoSynMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* Create tcp proto syn match.
*
* @param matchBuilder
* the match builder
* @return matchBuilder match builder
*/
public static MatchBuilder createTcpProtoSynMatch(MatchBuilder matchBuilder) {
// TCP Protocol Match
IpMatchBuilder ipMatch = new IpMatchBuilder(); // ipv4 version
ipMatch.setIpProtocol((short) 6);
matchBuilder.setIpMatch(ipMatch.build());
TcpFlagsMatchBuilder tcpFlagMatch = new TcpFlagsMatchBuilder();
tcpFlagMatch.setTcpFlags(TCP_SYN);
matchBuilder.setTcpFlagsMatch(tcpFlagMatch.build());
return matchBuilder;
}
示例10: 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;
}
示例11: createDmacIpTcpSynMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* Create dmac ip tcp syn match.
*
* @param matchBuilder
* the match builder
* @param dMacAddr
* the d mac addr
* @param mask
* the mask
* @param ipPrefix
* the ip prefix
* @return MatchBuilder containing the metadata match values
*/
public static MatchBuilder createDmacIpTcpSynMatch(MatchBuilder matchBuilder, MacAddress dMacAddr, MacAddress mask,
Ipv4Prefix ipPrefix) {
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
EthernetDestinationBuilder ethDestBuilder = new EthernetDestinationBuilder();
ethDestBuilder.setAddress(dMacAddr);
if (mask != null) {
ethDestBuilder.setMask(mask);
}
ethernetMatch.setEthernetDestination(ethDestBuilder.build());
matchBuilder.setEthernetMatch(ethernetMatch.build());
// Ethertype match
EthernetMatchBuilder ethernetType = new EthernetMatchBuilder();
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
ethernetType.setEthernetType(ethTypeBuilder.build());
matchBuilder.setEthernetMatch(ethernetType.build());
if (ipPrefix != null) {
Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
Ipv4Prefix canonicalizedIpv4Prefix = IpAddressUtils.canonicalizeIpPrefixToNetAddress(ipPrefix);
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 Flag Match
TcpFlagsMatchBuilder tcpFlagMatch = new TcpFlagsMatchBuilder();
tcpFlagMatch.setTcpFlags(TCP_SYN);
matchBuilder.setTcpFlagsMatch(tcpFlagMatch.build());
return matchBuilder;
}
示例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;
}
示例13: createSmacTcpPortWithFlagMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* Create smac tcp port with flag match.
*
* @param matchBuilder
* the match builder
* @param attachedMac
* the attached mac
* @param tcpFlag
* the tcp flag
* @param tunnelID
* the tunnel iD
* @return matchBuilder
*/
public static MatchBuilder createSmacTcpPortWithFlagMatch(MatchBuilder matchBuilder, String attachedMac,
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(TCP_SHORT);
matchBuilder.setIpMatch(ipMatch.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;
}
示例14: createSmacIpTcpSynMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* Create smac ip tcp syn match.
*
* @param matchBuilder
* the match builder
* @param dMacAddr
* the d mac addr
* @param mask
* the mask
* @param ipPrefix
* the ip prefix
* @return MatchBuilder containing the metadata match values
*/
public static MatchBuilder createSmacIpTcpSynMatch(MatchBuilder matchBuilder, MacAddress dMacAddr, MacAddress mask,
Ipv4Prefix ipPrefix) {
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
EthernetSourceBuilder ethSrcBuilder = new EthernetSourceBuilder();
ethSrcBuilder.setAddress(dMacAddr);
if (mask != null) {
ethSrcBuilder.setMask(mask);
}
ethernetMatch.setEthernetSource(ethSrcBuilder.build());
matchBuilder.setEthernetMatch(ethernetMatch.build());
// Ethertype match
EthernetMatchBuilder ethernetType = new EthernetMatchBuilder();
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
ethernetType.setEthernetType(ethTypeBuilder.build());
matchBuilder.setEthernetMatch(ethernetType.build());
if (ipPrefix != null) {
Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
Ipv4Prefix canonicalizedIpv4Prefix = IpAddressUtils.canonicalizeIpPrefixToNetAddress(ipPrefix);
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 Flag Match
TcpFlagsMatchBuilder tcpFlagMatch = new TcpFlagsMatchBuilder();
tcpFlagMatch.setTcpFlags(TCP_SYN);
matchBuilder.setTcpFlagsMatch(tcpFlagMatch.build());
return matchBuilder;
}
示例15: 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;
}