use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ipv6.match.fields.Ipv6ExtHeaderBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createL3IPv6Match.
private static MatchBuilder createL3IPv6Match() {
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());
final MacAddress ndsll = new MacAddress("c2:00:54:f5:00:00");
final MacAddress ndtll = new MacAddress("00:0c:29:0e:4c:67");
final Ipv6ExtHeaderBuilder nextheader = new Ipv6ExtHeaderBuilder();
nextheader.setIpv6Exthdr(58);
final Ipv6LabelBuilder ipv6label = new Ipv6LabelBuilder();
final Ipv6FlowLabel label = new Ipv6FlowLabel(10028L);
ipv6label.setIpv6Flabel(label);
ipv6label.setFlabelMask(new Ipv6FlowLabel(1L));
// icmpv6
final Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder();
// match
icmpv6match.setIcmpv6Type((short) 135);
icmpv6match.setIcmpv6Code((short) 0);
match.setIcmpv6Match(icmpv6match.build());
final Ipv6MatchBuilder ipv6match = new Ipv6MatchBuilder();
// ipv6match.setIpv6Source(srcip6);
// ipv6match.setIpv6Destination(dstip6);
// ipv6match.setIpv6ExtHeader(nextheader.build());
ipv6match.setIpv6NdSll(ndsll);
ipv6match.setIpv6NdTll(ndtll);
// ipv6match.setIpv6NdTarget(ndtarget);
ipv6match.setIpv6Label(ipv6label.build());
match.setLayer3Match(ipv6match.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ipv6.match.fields.Ipv6ExtHeaderBuilder in project openflowplugin by opendaylight.
the class OfToSalIpv6ExthdrCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull Ipv6ExthdrCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final Ipv6MatchBuilder ipv6MatchBuilder = data.getIpv6MatchBuilder();
Ipv6Exthdr ipv6Exthdr = source.getIpv6Exthdr();
if (ipv6Exthdr != null) {
Ipv6ExtHeaderBuilder ipv6ExtHeaderBuilder = new Ipv6ExtHeaderBuilder();
Ipv6ExthdrFlags headerFlags = ipv6Exthdr.getPseudoField();
Integer bitmap = MatchConvertorUtil.ipv6ExthdrFlagsToInt(headerFlags);
ipv6ExtHeaderBuilder.setIpv6Exthdr(bitmap);
byte[] mask = ipv6Exthdr.getMask();
if (mask != null) {
ipv6ExtHeaderBuilder.setIpv6ExthdrMask(ByteUtil.bytesToUnsignedShort(mask));
}
ipv6MatchBuilder.setIpv6ExtHeader(ipv6ExtHeaderBuilder.build());
matchBuilder.setLayer3Match(ipv6MatchBuilder.build());
}
return Optional.of(matchBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ipv6.match.fields.Ipv6ExtHeaderBuilder 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