本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder.setLayer3Match方法的典型用法代码示例。如果您正苦于以下问题:Java MatchBuilder.setLayer3Match方法的具体用法?Java MatchBuilder.setLayer3Match怎么用?Java MatchBuilder.setLayer3Match使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder
的用法示例。
在下文中一共展示了MatchBuilder.setLayer3Match方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: createDstL3IPv4Match
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* @param matchBuilder
* MatchBuilder Object without a match yet
* @param dstip
* String containing an IPv4 prefix
* @return matchBuilder Map Object with a match
*/
public static MatchBuilder createDstL3IPv4Match(MatchBuilder matchBuilder, Ipv4Prefix dstip) {
EthernetMatchBuilder eth = new EthernetMatchBuilder();
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
eth.setEthernetType(ethTypeBuilder.build());
matchBuilder.setEthernetMatch(eth.build());
Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
Ipv4Prefix canonicalizedIpv4Prefix = IpAddressUtils.canonicalizeIpPrefixToNetAddress(dstip);
ipv4match.setIpv4Destination(canonicalizedIpv4Prefix);
matchBuilder.setLayer3Match(ipv4match.build());
return matchBuilder;
}
示例3: addArpMacMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* Builds the arp match with src and destintion mac address.
*
* @param matchBuilder
* the match builder
* @param srcMac
* the src mac address , will not be added to match if null.
* @param dstMac
* the destination mac address, will not be added to match if
* null.
* @return the match builder with the matches
*/
public static MatchBuilder addArpMacMatch(MatchBuilder matchBuilder, String srcMac, String dstMac) {
ArpMatchBuilder arpMatch = new ArpMatchBuilder();
if (null != srcMac) {
ArpSourceHardwareAddressBuilder arpSrc = new ArpSourceHardwareAddressBuilder();
arpSrc.setAddress(new MacAddress(srcMac));
arpMatch.setArpSourceHardwareAddress(arpSrc.build());
}
if (null != dstMac) {
ArpTargetHardwareAddressBuilder arpDst = new ArpTargetHardwareAddressBuilder();
arpDst.setAddress(new MacAddress(dstMac));
arpMatch.setArpTargetHardwareAddress(arpDst.build());
}
matchBuilder.setLayer3Match(arpMatch.build());
return matchBuilder;
}
示例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;
}
示例5: 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;
}
示例6: addRemoteIpPrefix
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* Adds remote Ip prefix to existing match.
*
* @param matchBuilder
* The match builder
* @param sourceIpPrefix
* The source IP prefix
* @param destIpPrefix
* The destination IP prefix
* @return matchBuilder Map Object with a match
*/
public static MatchBuilder addRemoteIpPrefix(MatchBuilder matchBuilder, Ipv4Prefix sourceIpPrefix,
Ipv4Prefix destIpPrefix) {
Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
if (null != sourceIpPrefix) {
Ipv4Prefix canonicalizedSourceIpv4Prefix = IpAddressUtils.canonicalizeIpPrefixToNetAddress(sourceIpPrefix);
ipv4match.setIpv4Source(canonicalizedSourceIpv4Prefix);
}
if (null != destIpPrefix) {
Ipv4Prefix canonicalizedDestIpv4Prefix = IpAddressUtils.canonicalizeIpPrefixToNetAddress(destIpPrefix);
ipv4match.setIpv4Destination(canonicalizedDestIpv4Prefix);
}
matchBuilder.setLayer3Match(ipv4match.build());
return matchBuilder;
}
示例7: createIpAddressMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
public static MatchBuilder createIpAddressMatch(MatchBuilder matchBuilder, String sourceIpv4, String destIpv4) {
Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
if (sourceIpv4 != null) {
Ipv4Prefix canonicalizedSourceIpv4Prefix = IpAddressUtils
.canonicalizeIpPrefixToNetAddress(new Ipv4Prefix(sourceIpv4));
ipv4match.setIpv4Source(canonicalizedSourceIpv4Prefix);
}
if (destIpv4 != null) {
Ipv4Prefix canonicalizedDestSourceIpv4Prefix = IpAddressUtils
.canonicalizeIpPrefixToNetAddress(new Ipv4Prefix(destIpv4));
ipv4match.setIpv4Destination(canonicalizedDestSourceIpv4Prefix);
}
matchBuilder.setLayer3Match(ipv4match.build());
return matchBuilder;
}
示例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();
}
示例9: createArpDstIpv4Match
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* @param matchBuilder
* MatchBuilder Object without a match yet
* @param dstip
* String containing an IPv4 prefix
* @return matchBuilder Map Object with a match
*/
public static MatchBuilder createArpDstIpv4Match(MatchBuilder matchBuilder, Ipv4Prefix dstip) {
ArpMatchBuilder arpDstMatch = new ArpMatchBuilder();
Ipv4Prefix canonicalizedIpv4Prefix = IpAddressUtils.canonicalizeIpPrefixToNetAddress(dstip);
arpDstMatch.setArpTargetTransportAddress(canonicalizedIpv4Prefix).setArpOp(OfFlowUtils.ARP_OP_REQUEST);
matchBuilder.setLayer3Match(arpDstMatch.build());
return matchBuilder;
}
示例10: 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;
}
示例11: 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;
}
示例12: createMacSrcIpTcpSynMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* @return MatchBuilder containing the metadata match values
*/
public static MatchBuilder createMacSrcIpTcpSynMatch(MatchBuilder matchBuilder, MacAddress dMacAddr,
MacAddress mask, Ipv4Prefix ipPrefix) {
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
EthernetDestinationBuilder ethDestinationBuilder = new EthernetDestinationBuilder();
ethDestinationBuilder.setAddress(dMacAddr);
if (mask != null) {
ethDestinationBuilder.setMask(mask);
}
ethernetMatch.setEthernetDestination(ethDestinationBuilder.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.setIpv4Source(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;
}
示例13: addRemoteIpv6Prefix
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* Adds remote Ipv6 prefix to existing match.
*
* @param matchBuilder
* The match builder
* @param sourceIpPrefix
* The source IP prefix
* @param destIpPrefix
* The destination IP prefix
* @return matchBuilder Map Object with a match
*/
public static MatchBuilder addRemoteIpv6Prefix(MatchBuilder matchBuilder, Ipv6Prefix sourceIpPrefix,
Ipv6Prefix destIpPrefix) {
Ipv6MatchBuilder ipv6match = new Ipv6MatchBuilder();
if (null != sourceIpPrefix) {
ipv6match.setIpv6Source(sourceIpPrefix);
}
if (null != destIpPrefix) {
ipv6match.setIpv6Destination(destIpPrefix);
}
matchBuilder.setLayer3Match(ipv6match.build());
return matchBuilder;
}
示例14: createSrcL3IPv4Match
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* @param matchBuilder
* MatchBuilder Object without a match yet
* @param srcip
* String containing an IPv4 prefix
* @return matchBuilder Map Object with a match
*/
public static MatchBuilder createSrcL3IPv4Match(MatchBuilder matchBuilder, Ipv4Prefix srcip) {
EthernetMatchBuilder eth = new EthernetMatchBuilder();
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
eth.setEthernetType(ethTypeBuilder.build());
matchBuilder.setEthernetMatch(eth.build());
Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
Ipv4Prefix canonicalizedIpv4Prefix = IpAddressUtils.canonicalizeIpPrefixToNetAddress(srcip);
ipv4match.setIpv4Source(canonicalizedIpv4Prefix);
matchBuilder.setLayer3Match(ipv4match.build());
return matchBuilder;
}
示例15: createDmacTcpPortIpSaWithFlagMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; //导入方法依赖的package包/类
/**
* Create dmac tcp port ipSa with flag match.
*
* @param matchBuilder
* the match builder
* @param attachedMac
* the attached mac
* @param tcpFlag
* the tcp flag
* @param ipPrefix
* the src ipPrefix
* @param tunnelID
* the tunnel iD
* @return match containing TCP_Flag (), IP Protocol (TCP), TCP_Flag (SYN),
* Ip Source Address (IPsa)
*/
private static MatchBuilder createDmacTcpPortIpSaWithFlagMatch(MatchBuilder matchBuilder, String attachedMac,
Integer tcpFlag, Ipv4Prefix ipPrefix, String tunnelID) {
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
ethernetMatch.setEthernetType(ethTypeBuilder.build());
if (attachedMac != null) {
EthernetDestinationBuilder ethDestinationBuilder = new EthernetDestinationBuilder();
ethDestinationBuilder.setAddress(new MacAddress(attachedMac));
ethernetMatch.setEthernetDestination(ethDestinationBuilder.build());
matchBuilder.setEthernetMatch(ethernetMatch.build());
}
if (tcpFlag != null) {
// 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());
}
if (tunnelID != null) {
TunnelBuilder tunnelBuilder = new TunnelBuilder();
tunnelBuilder.setTunnelId(new BigInteger(tunnelID));
matchBuilder.setTunnel(tunnelBuilder.build());
}
if (ipPrefix != null) {
Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
Ipv4Prefix canonicalizedIpv4Prefix = IpAddressUtils.canonicalizeIpPrefixToNetAddress(ipPrefix);
ipv4match.setIpv4Source(canonicalizedIpv4Prefix);
matchBuilder.setLayer3Match(ipv4match.build());
}
return matchBuilder;
}