use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.code._case.Icmpv4Code in project openflowplugin by opendaylight.
the class OfToSalIcmpv4CodeCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull Icmpv4CodeCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final Icmpv4MatchBuilder icmpv4MatchBuilder = data.getIcmpv4MatchBuilder();
Icmpv4Code icmpv4Code = source.getIcmpv4Code();
Short v4code = icmpv4Code.getIcmpv4Code();
if (v4code != null) {
icmpv4MatchBuilder.setIcmpv4Code(v4code);
matchBuilder.setIcmpv4Match(icmpv4MatchBuilder.build());
}
return Optional.of(matchBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.code._case.Icmpv4Code in project openflowplugin by opendaylight.
the class Icmpv4CodeEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final short code = message.readUnsignedByte();
if (Objects.isNull(builder.getIcmpv4Match())) {
builder.setIcmpv4Match(new Icmpv4MatchBuilder().setIcmpv4Code(code).build());
} else if (Objects.isNull(builder.getIcmpv4Match().getIcmpv4Code())) {
builder.setIcmpv4Match(new Icmpv4MatchBuilder(builder.getIcmpv4Match()).setIcmpv4Code(code).build());
} else {
throwErrorOnMalformed(builder, "icmpv4Match", "icmpv4Code");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.code._case.Icmpv4Code in project openflowplugin by opendaylight.
the class MatchConvertor method toOfIcmpv4Code.
private static MatchEntry toOfIcmpv4Code(final Short icmpv4Code) {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
matchEntryBuilder.setOxmClass(OpenflowBasicClass.class);
matchEntryBuilder.setHasMask(false);
matchEntryBuilder.setOxmMatchField(Icmpv4Code.class);
Icmpv4CodeCaseBuilder icmpv4CodeCaseBuilder = new Icmpv4CodeCaseBuilder();
Icmpv4CodeBuilder icmpv4CodeBuilder = new Icmpv4CodeBuilder();
icmpv4CodeBuilder.setIcmpv4Code(icmpv4Code);
icmpv4CodeCaseBuilder.setIcmpv4Code(icmpv4CodeBuilder.build());
matchEntryBuilder.setMatchEntryValue(icmpv4CodeCaseBuilder.build());
return matchEntryBuilder.build();
}
Aggregations