use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Type in project openflowplugin by opendaylight.
the class MatchConvertor method toOfIcmpv4Type.
private static MatchEntry toOfIcmpv4Type(final Short icmpv4Type) {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
matchEntryBuilder.setOxmClass(OpenflowBasicClass.class);
matchEntryBuilder.setHasMask(false);
matchEntryBuilder.setOxmMatchField(Icmpv4Type.class);
Icmpv4TypeCaseBuilder icmpv4TypeCaseBuilder = new Icmpv4TypeCaseBuilder();
Icmpv4TypeBuilder icmpv4TypeBuilder = new Icmpv4TypeBuilder();
icmpv4TypeBuilder.setIcmpv4Type(icmpv4Type);
icmpv4TypeCaseBuilder.setIcmpv4Type(icmpv4TypeBuilder.build());
matchEntryBuilder.setMatchEntryValue(icmpv4TypeCaseBuilder.build());
return matchEntryBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Type in project openflowplugin by opendaylight.
the class Icmpv4TypeEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
processHeader(message);
final short type = message.readUnsignedByte();
if (Objects.isNull(builder.getIcmpv4Match())) {
builder.setIcmpv4Match(new Icmpv4MatchBuilder().setIcmpv4Type(type).build());
} else if (Objects.isNull(builder.getIcmpv4Match().getIcmpv4Type())) {
builder.setIcmpv4Match(new Icmpv4MatchBuilder(builder.getIcmpv4Match()).setIcmpv4Type(type).build());
} else {
throwErrorOnMalformed(builder, "icmpv4Match", "icmpv4Type");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Type in project openflowplugin by opendaylight.
the class OfToSalIcmpv4TypeCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull Icmpv4TypeCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final Icmpv4MatchBuilder icmpv4MatchBuilder = data.getIcmpv4MatchBuilder();
Icmpv4Type icmpv4Type = source.getIcmpv4Type();
Short type = icmpv4Type.getIcmpv4Type();
if (type != null) {
icmpv4MatchBuilder.setIcmpv4Type(type);
matchBuilder.setIcmpv4Match(icmpv4MatchBuilder.build());
}
return Optional.of(matchBuilder);
}
Aggregations