use of org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createTcpFlagMatch.
/**
* Test match for TCP_Flags.
*
* @return match containing Ethertype (0x0800), IP Protocol (TCP), TCP_Flag (SYN)
*/
// FIXME: move to extensible support
private static MatchBuilder createTcpFlagMatch() {
final MatchBuilder match = new MatchBuilder();
// Ethertype match
final EthernetMatchBuilder ethernetType = new EthernetMatchBuilder();
final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
ethernetType.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(ethernetType.build());
// TCP Protocol Match
// ipv4 version
final IpMatchBuilder ipMatch = new IpMatchBuilder();
ipMatch.setIpProtocol((short) 6);
match.setIpMatch(ipMatch.build());
// TCP Port Match
final PortNumber dstPort = new PortNumber(80);
final TcpMatchBuilder tcpMatch = new TcpMatchBuilder();
tcpMatch.setTcpDestinationPort(dstPort);
match.setLayer4Match(tcpMatch.build());
/**
* 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
*/
final TcpFlagsMatchBuilder tcpFlagsMatch = new TcpFlagsMatchBuilder();
tcpFlagsMatch.setTcpFlags(0x002);
match.setTcpFlagsMatch(tcpFlagsMatch.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createL4UDPMatch.
private static MatchBuilder createL4UDPMatch() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
// ipv4 version
final IpMatchBuilder ipmatch = new IpMatchBuilder();
ipmatch.setIpProtocol((short) 17);
match.setIpMatch(ipmatch.build());
final PortNumber srcport = new PortNumber(1325);
final PortNumber dstport = new PortNumber(42);
// udp match
final UdpMatchBuilder udpmatch = new UdpMatchBuilder();
udpmatch.setUdpDestinationPort(dstport);
udpmatch.setUdpSourcePort(srcport);
match.setLayer4Match(udpmatch.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createICMPv6Match1.
private static MatchBuilder createICMPv6Match1() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x86ddL));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
// ipv4 version
final IpMatchBuilder ipmatch = new IpMatchBuilder();
ipmatch.setIpProtocol((short) 256);
match.setIpMatch(ipmatch.build());
// icmpv6
final Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder();
// match
icmpv6match.setIcmpv6Type((short) 135);
icmpv6match.setIcmpv6Code((short) 1);
match.setIcmpv6Match(icmpv6match.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createLLDPMatch.
private static MatchBuilder createLLDPMatch() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x88ccL));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createEthernetMatch.
private static MatchBuilder createEthernetMatch() {
final MatchBuilder match = new MatchBuilder();
// ethernettype
final EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
// match
final EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
final EtherType type = new EtherType(0x0800L);
ethmatch.setEthernetType(ethtype.setType(type).build());
// ethernet
final EthernetDestinationBuilder ethdest = new EthernetDestinationBuilder();
// macaddress
// match
final MacAddress macdest = new MacAddress(DEST_MAC_ADDRESS);
ethdest.setAddress(macdest);
ethdest.setMask(new MacAddress("ff:ff:ff:00:00:00"));
ethmatch.setEthernetDestination(ethdest.build());
final EthernetSourceBuilder ethsrc = new EthernetSourceBuilder();
final MacAddress macsrc = new MacAddress(SRC_MAC_ADDRESS);
ethsrc.setAddress(macsrc);
ethsrc.setMask(new MacAddress("ff:ff:00:00:00:00"));
ethmatch.setEthernetSource(ethsrc.build());
match.setEthernetMatch(ethmatch.build());
return match;
}
Aggregations