use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.nd.tll._case.Ipv6NdTll in project openflowplugin by opendaylight.
the class OfToSalIpv6NdTllCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull Ipv6NdTllCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final Ipv6MatchBuilder ipv6MatchBuilder = data.getIpv6MatchBuilder();
Ipv6NdTll ipv6NdTll = source.getIpv6NdTll();
if (ipv6NdTll != null) {
ipv6MatchBuilder.setIpv6NdTll(ipv6NdTll.getMacAddress());
matchBuilder.setLayer3Match(ipv6MatchBuilder.build());
}
return Optional.of(matchBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.nd.tll._case.Ipv6NdTll in project openflowplugin by opendaylight.
the class Ipv6NdTllEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final MacAddress address = OxmDeserializerHelper.convertMacAddress(message);
if (Objects.isNull(builder.getLayer3Match())) {
builder.setLayer3Match(new Ipv6MatchBuilder().setIpv6NdTll(address).build());
} else if (Ipv6Match.class.isInstance(builder.getLayer3Match()) && Objects.isNull(Ipv6Match.class.cast(builder.getLayer3Match()).getIpv6NdTll())) {
final Ipv6Match match = Ipv6Match.class.cast(builder.getLayer3Match());
builder.setLayer3Match(new Ipv6MatchBuilder(match).setIpv6NdTll(address).build());
} else {
throwErrorOnMalformed(builder, "layer3Match", "ipv6NdTll");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.ipv6.nd.tll._case.Ipv6NdTll in project openflowplugin by opendaylight.
the class Ipv6NdTllEntrySerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final MacAddress ipv6NdTll = new MacAddress("00:01:02:03:04:05");
final Match ipv6NdTllMatch = new MatchBuilder().setLayer3Match(new Ipv6MatchBuilder().setIpv6NdTll(ipv6NdTll).build()).build();
assertMatch(ipv6NdTllMatch, false, (out) -> {
byte[] addressBytes = new byte[6];
out.readBytes(addressBytes);
assertEquals(new MacAddress(ByteBufUtils.macAddressToString(addressBytes)).getValue(), ipv6NdTll.getValue());
});
}
Aggregations