use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createMatch1.
private static MatchBuilder createMatch1() {
MatchBuilder match = new MatchBuilder();
Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
ipv4Match.setIpv4Destination(prefix);
Ipv4Match i4m = ipv4Match.build();
match.setLayer3Match(i4m);
EthernetMatchBuilder eth = new EthernetMatchBuilder();
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder in project openflowplugin by opendaylight.
the class EthernetTypeEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final int type = message.readUnsignedShort();
if (Objects.isNull(builder.getEthernetMatch())) {
builder.setEthernetMatch(new EthernetMatchBuilder().setEthernetType(new EthernetTypeBuilder().setType(new EtherType(Long.valueOf(type))).build()).build());
} else if (Objects.isNull(builder.getEthernetMatch().getEthernetType())) {
builder.setEthernetMatch(new EthernetMatchBuilder(builder.getEthernetMatch()).setEthernetType(new EthernetTypeBuilder().setType(new EtherType(Long.valueOf(type))).build()).build());
} else {
throwErrorOnMalformed(builder, "ethernetMatch", "ethernetType");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder in project openflowplugin by opendaylight.
the class FlowConvertorTest method createEthernetMatch.
private static EthernetMatch createEthernetMatch() {
EthernetMatchBuilder ethernetMatchBuilder = new EthernetMatchBuilder();
ethernetMatchBuilder.setEthernetType(new EthernetTypeBuilder().setType(new EtherType(33024L)).build());
return ethernetMatchBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider method createLLDPMatch.
private static MatchBuilder createLLDPMatch() {
MatchBuilder match = new MatchBuilder();
EthernetMatchBuilder eth = new EthernetMatchBuilder();
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.ethernet.match.fields.EthernetTypeBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider method createL3IPv6Match.
private static MatchBuilder createL3IPv6Match() {
MatchBuilder match = new MatchBuilder();
EthernetMatchBuilder eth = new EthernetMatchBuilder();
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x86ddL));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
Ipv6ExtHeaderBuilder nextheader = new Ipv6ExtHeaderBuilder();
nextheader.setIpv6Exthdr(58);
Ipv6LabelBuilder ipv6label = new Ipv6LabelBuilder();
Ipv6FlowLabel label = new Ipv6FlowLabel(10028L);
ipv6label.setIpv6Flabel(label);
// ipv6label.setFlabelMask(new byte[] { 0, 1, -1, -1 });
// icmpv6
Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder();
// match
icmpv6match.setIcmpv6Type((short) 135);
icmpv6match.setIcmpv6Code((short) 0);
match.setIcmpv6Match(icmpv6match.build());
Ipv6MatchBuilder ipv6match = new Ipv6MatchBuilder();
// ipv6match.setIpv6Source(srcip6);
// ipv6match.setIpv6Destination(dstip6);
// ipv6match.setIpv6ExtHeader(nextheader.build());
ipv6match.setIpv6NdSll(new MacAddress("c2:00:54:f5:00:00"));
ipv6match.setIpv6NdTll(new MacAddress("00:0c:29:0e:4c:67"));
// ipv6match.setIpv6NdTarget(ndtarget);
ipv6match.setIpv6Label(ipv6label.build());
match.setLayer3Match(ipv6match.build());
return match;
}
Aggregations