本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder类的典型用法代码示例。如果您正苦于以下问题:Java EthernetSourceBuilder类的具体用法?Java EthernetSourceBuilder怎么用?Java EthernetSourceBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EthernetSourceBuilder类属于org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields包,在下文中一共展示了EthernetSourceBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createEthSrcDstMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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
示例2: createSrcL3Ipv4MatchWithMac
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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
示例3: createSrcL3Ipv6MatchWithMac
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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
示例4: createV4EtherMatchWithType
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的package包/类
/**
* Creates a ether net match with ether type set to 0x0800L.
*
* @param matchBuilder
* MatchBuilder Object
* @param srcMac
* The source macAddress
* @param dstMac
* The destination mac address
* @return matchBuilder Map Object with a match
*/
public static MatchBuilder createV4EtherMatchWithType(MatchBuilder matchBuilder, String srcMac, String dstMac,
Long type) {
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(type));
EthernetMatchBuilder eth = new EthernetMatchBuilder();
eth.setEthernetType(ethTypeBuilder.build());
if (null != srcMac) {
eth.setEthernetSource(new EthernetSourceBuilder().setAddress(new MacAddress(srcMac)).build());
}
if (null != dstMac) {
eth.setEthernetDestination(new EthernetDestinationBuilder().setAddress(new MacAddress(dstMac)).build());
}
matchBuilder.setEthernetMatch(eth.build());
return matchBuilder;
}
开发者ID:opendaylight,项目名称:faas,代码行数:27,代码来源:OfMatchUtils.java
示例5: createEthMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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
示例6: ethernetMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的package包/类
public static EthernetMatch ethernetMatch(MacAddress srcMac,
MacAddress dstMac,
Long etherType) {
EthernetMatchBuilder emb = new EthernetMatchBuilder();
if (srcMac != null)
emb.setEthernetSource(new EthernetSourceBuilder()
.setAddress(srcMac)
.build());
if (dstMac != null)
emb.setEthernetDestination(new EthernetDestinationBuilder()
.setAddress(dstMac)
.build());
if (etherType != null)
emb.setEthernetType(new EthernetTypeBuilder()
.setType(new EtherType(etherType))
.build());
return emb.build();
}
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:19,代码来源:MatchUtils.java
示例7: getEtherMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的package包/类
/**
* Gets the ether match.
*
* @param macAddress
* the src/destination MAC
* @param isSrc
* indicates source or destination MAC
* @return the ether match
*/
public static EthernetMatch getEtherMatch(MacAddress macAddress, boolean isSrc) {
if (isSrc) {
return new EthernetMatchBuilder()
.setEthernetSource(new EthernetSourceBuilder().setAddress(macAddress).build()).build();
} else {
return new EthernetMatchBuilder()
.setEthernetDestination(new EthernetDestinationBuilder().setAddress(macAddress).build()).build();
}
}
开发者ID:onfsdn,项目名称:atrium-odl,代码行数:19,代码来源:AtriumUtils.java
示例8: createEthSrcMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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
示例9: createSmacTcpPortWithFlagMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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;
}
开发者ID:opendaylight,项目名称:faas,代码行数:42,代码来源:OfMatchUtils.java
示例10: createSmacIpTcpSynMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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;
}
开发者ID:opendaylight,项目名称:faas,代码行数:48,代码来源:OfMatchUtils.java
示例11: createSmacTcpSyn
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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
示例12: createDhcpServerMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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
示例13: createDhcpv6ServerMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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
示例14: createV6EtherMatchWithType
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的package包/类
/**
* Creates a ether net match with ether type set to 0x86DDL.
*
* @param matchBuilder
* MatchBuilder Object
* @param srcMac
* The source macAddress
* @param dstMac
* The destination mac address
* @return matchBuilder Map Object with a match
*/
public static MatchBuilder createV6EtherMatchWithType(MatchBuilder matchBuilder, String srcMac, String dstMac) {
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x86DDL));
EthernetMatchBuilder eth = new EthernetMatchBuilder();
eth.setEthernetType(ethTypeBuilder.build());
if (null != srcMac) {
eth.setEthernetSource(new EthernetSourceBuilder().setAddress(new MacAddress(srcMac)).build());
}
if (null != dstMac) {
eth.setEthernetDestination(new EthernetDestinationBuilder().setAddress(new MacAddress(dstMac)).build());
}
matchBuilder.setEthernetMatch(eth.build());
return matchBuilder;
}
开发者ID:opendaylight,项目名称:faas,代码行数:26,代码来源:OfMatchUtils.java
示例15: ethernetMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的package包/类
public static EthernetMatch ethernetMatch(MacAddress srcMac, MacAddress dstMac, Long etherType) {
EthernetMatchBuilder emb = new EthernetMatchBuilder();
if (srcMac != null) {
emb.setEthernetSource(new EthernetSourceBuilder().setAddress(srcMac).build());
}
if (dstMac != null) {
emb.setEthernetDestination(new EthernetDestinationBuilder().setAddress(dstMac).build());
}
if (etherType != null) {
emb.setEthernetType(new EthernetTypeBuilder().setType(new EtherType(etherType)).build());
}
return emb.build();
}
开发者ID:opendaylight,项目名称:faas,代码行数:14,代码来源:OfMatchUtils.java
示例16: createEthAddressMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的package包/类
public static MatchBuilder createEthAddressMatch(MatchBuilder matchBuilder, String srcMac, String srcMask,
String destMac, String destMask) {
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
ethernetMatch.setEthernetType(ethTypeBuilder.build());
if (srcMac != null) {
EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
ethSourceBuilder.setAddress(new MacAddress(srcMac));
if (srcMask != null) {
ethSourceBuilder.setMask(new MacAddress(srcMask));
}
ethernetMatch.setEthernetSource(ethSourceBuilder.build());
}
if (destMac != null) {
EthernetDestinationBuilder ethDestinationBuilder = new EthernetDestinationBuilder();
ethDestinationBuilder.setAddress(new MacAddress(destMac));
if (destMask != null) {
ethDestinationBuilder.setMask(new MacAddress(destMask));
}
ethernetMatch.setEthernetDestination(ethDestinationBuilder.build());
}
matchBuilder.setEthernetMatch(ethernetMatch.build());
return matchBuilder;
}
开发者ID:opendaylight,项目名称:faas,代码行数:31,代码来源:OfMatchUtils.java
示例17: createEthSrcMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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(new MacAddress(sMacAddr));
ethernetMatch.setEthernetSource(ethSourceBuilder.build());
matchBuilder.setEthernetMatch(ethernetMatch.build());
return matchBuilder;
}
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:18,代码来源:MatchUtils.java
示例18: createSmacTcpSynDstIpPrefixTcpPort
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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(IPV4_LONG));
ethernetMatch.setEthernetType(ethTypeBuilder.build());
EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
ethSourceBuilder.setAddress(new MacAddress(attachedMac));
ethernetMatch.setEthernetSource(ethSourceBuilder.build());
matchBuilder.setEthernetMatch(ethernetMatch.build());
Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
ipv4match.setIpv4Destination(dstIp);
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());
TcpFlagMatchBuilder tcpFlagMatch = new TcpFlagMatchBuilder();
tcpFlagMatch.setTcpFlag(tcpFlag);
matchBuilder.setTcpFlagMatch(tcpFlagMatch.build());
TunnelBuilder tunnelBuilder = new TunnelBuilder();
tunnelBuilder.setTunnelId(new BigInteger(segmentationId));
matchBuilder.setTunnel(tunnelBuilder.build());
return matchBuilder;
}
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:51,代码来源:MatchUtils.java
示例19: createSmacTcpPortWithFlagMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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(IPV4_LONG));
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());
TcpFlagMatchBuilder tcpFlagMatch = new TcpFlagMatchBuilder();
tcpFlagMatch.setTcpFlag(tcpFlag);
matchBuilder.setTcpFlagMatch(tcpFlagMatch.build());
TunnelBuilder tunnelBuilder = new TunnelBuilder();
tunnelBuilder.setTunnelId(new BigInteger(tunnelID));
matchBuilder.setTunnel(tunnelBuilder.build());
return matchBuilder;
}
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:38,代码来源:MatchUtils.java
示例20: createSmacIpTcpSynMatch
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder; //导入依赖的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(new MacAddress(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(IPV4_LONG));
ethernetType.setEthernetType(ethTypeBuilder.build());
matchBuilder.setEthernetMatch(ethernetType.build());
if (ipPrefix != null) {
Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
ipv4match.setIpv4Destination(ipPrefix);
matchBuilder.setLayer3Match(ipv4match.build());
}
// TCP Protocol Match
IpMatchBuilder ipMatch = new IpMatchBuilder(); // ipv4 version
ipMatch.setIpProtocol(TCP_SHORT);
matchBuilder.setIpMatch(ipMatch.build());
// TCP Flag Match
TcpFlagMatchBuilder tcpFlagMatch = new TcpFlagMatchBuilder();
tcpFlagMatch.setTcpFlag(TCP_SYN);
matchBuilder.setTcpFlagMatch(tcpFlagMatch.build());
return matchBuilder;
}
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:43,代码来源:MatchUtils.java
注:本文中的org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论