use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder 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.model.match.types.rev131026.match.EthernetMatchBuilder 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.model.match.types.rev131026.match.EthernetMatchBuilder 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.model.match.types.rev131026.match.EthernetMatchBuilder 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;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createPbbMatch.
private static MatchBuilder createPbbMatch() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x88E7L));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
// mpls
final ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder();
// match
protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(new BigInteger(new byte[] { 0, 1, 0, 0 }).longValue()).build());
match.setProtocolMatchFields(protomatch.build());
return match;
}
Aggregations