Search in sources :

Example 1 with Icmpv4Type

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();
}
Also used : MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) Icmpv4TypeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.type._case.Icmpv4TypeBuilder) Icmpv4TypeCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4TypeCaseBuilder)

Example 2 with Icmpv4Type

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");
    }
}
Also used : Icmpv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder)

Example 3 with 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);
}
Also used : Icmpv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder) Icmpv4Type(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.type._case.Icmpv4Type) Icmpv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)

Aggregations

Icmpv4MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder)2 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)1 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)1 Icmpv4TypeCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4TypeCaseBuilder)1 Icmpv4Type (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.type._case.Icmpv4Type)1 Icmpv4TypeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.type._case.Icmpv4TypeBuilder)1