use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createL4SCTPMatch.
private static MatchBuilder createL4SCTPMatch() {
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) 132);
match.setIpMatch(ipmatch.build());
final SctpMatchBuilder sctpmatch = new SctpMatchBuilder();
final PortNumber srcport = new PortNumber(1435);
final PortNumber dstport = new PortNumber(22);
sctpmatch.setSctpSourcePort(srcport);
sctpmatch.setSctpDestinationPort(dstport);
match.setLayer4Match(sctpmatch.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 createToSMatch.
private static MatchBuilder createToSMatch() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
final EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
final EtherType type = new EtherType(0x0800L);
ethmatch.setEthernetType(ethtype.setType(type).build());
match.setEthernetMatch(ethmatch.build());
// ipv4 version
final IpMatchBuilder ipmatch = new IpMatchBuilder();
ipmatch.setIpProtocol((short) 6);
final Dscp dscp = new Dscp((short) 8);
ipmatch.setIpDscp(dscp);
match.setIpMatch(ipmatch.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 createMplsMatch.
private static MatchBuilder createMplsMatch() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x8847L));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
// mpls
final ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder();
// match
protomatch.setMplsLabel((long) 36008);
protomatch.setMplsTc((short) 4);
protomatch.setMplsBos((short) 1);
match.setProtocolMatchFields(protomatch.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 createL4TCPMatch.
private static MatchBuilder createL4TCPMatch() {
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) 6);
match.setIpMatch(ipmatch.build());
final PortNumber srcport = new PortNumber(1213);
final PortNumber dstport = new PortNumber(646);
// tcp match
final TcpMatchBuilder tcpmatch = new TcpMatchBuilder();
tcpmatch.setTcpSourcePort(srcport);
tcpmatch.setTcpDestinationPort(dstport);
match.setLayer4Match(tcpmatch.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 createMatch3.
private static MatchBuilder createMatch3() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
final EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
ethSourceBuilder.setAddress(new MacAddress("00:00:00:00:00:01"));
ethernetMatch.setEthernetSource(ethSourceBuilder.build());
match.setEthernetMatch(ethernetMatch.build());
return match;
}
Aggregations