Search in sources :

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

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

Example 3 with 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();
}
Also used : MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) Icmpv4CodeCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4CodeCaseBuilder) Icmpv4CodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.code._case.Icmpv4CodeBuilder)

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 Icmpv4CodeCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4CodeCaseBuilder)1 Icmpv4Code (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.code._case.Icmpv4Code)1 Icmpv4CodeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv4.code._case.Icmpv4CodeBuilder)1