Search in sources :

Example 1 with Icmpv6Code

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.code._case.Icmpv6Code in project openflowplugin by opendaylight.

the class Icmpv6CodeEntryDeserializer method deserializeEntry.

@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
    processHeader(message);
    final short code = message.readUnsignedByte();
    if (Objects.isNull(builder.getIcmpv6Match())) {
        builder.setIcmpv6Match(new Icmpv6MatchBuilder().setIcmpv6Code(code).build());
    } else if (Objects.isNull(builder.getIcmpv6Match().getIcmpv6Code())) {
        builder.setIcmpv6Match(new Icmpv6MatchBuilder(builder.getIcmpv6Match()).setIcmpv6Code(code).build());
    } else {
        throwErrorOnMalformed(builder, "icmpv6Match", "icmpv6Code");
    }
}
Also used : Icmpv6MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder)

Example 2 with Icmpv6Code

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.code._case.Icmpv6Code in project openflowplugin by opendaylight.

the class OfToSalIcmpv6CodeCase method process.

@Override
public Optional<MatchBuilder> process(@Nonnull Icmpv6CodeCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
    final MatchBuilder matchBuilder = data.getMatchBuilder();
    final Icmpv6MatchBuilder icmpv6MatchBuilder = data.getIcmpv6MatchBuilder();
    Icmpv6Code icmpv6Code = source.getIcmpv6Code();
    Short v6code = icmpv6Code.getIcmpv6Code();
    if (v6code != null) {
        icmpv6MatchBuilder.setIcmpv6Code(v6code);
        matchBuilder.setIcmpv6Match(icmpv6MatchBuilder.build());
    }
    return Optional.of(matchBuilder);
}
Also used : MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder) Icmpv6MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder) Icmpv6MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder) Icmpv6Code(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.code._case.Icmpv6Code)

Example 3 with Icmpv6Code

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.code._case.Icmpv6Code in project openflowplugin by opendaylight.

the class MatchConvertor method toOfIcmpv6Code.

private static MatchEntry toOfIcmpv6Code(final Short icmpv6Code) {
    MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
    matchEntryBuilder.setOxmClass(OpenflowBasicClass.class);
    matchEntryBuilder.setHasMask(false);
    matchEntryBuilder.setOxmMatchField(Icmpv6Code.class);
    Icmpv6CodeCaseBuilder icmpv6CodeCaseBuilder = new Icmpv6CodeCaseBuilder();
    Icmpv6CodeBuilder icmpv6CodeBuilder = new Icmpv6CodeBuilder();
    icmpv6CodeBuilder.setIcmpv6Code(icmpv6Code);
    icmpv6CodeCaseBuilder.setIcmpv6Code(icmpv6CodeBuilder.build());
    matchEntryBuilder.setMatchEntryValue(icmpv6CodeCaseBuilder.build());
    return matchEntryBuilder.build();
}
Also used : MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) Icmpv6CodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.code._case.Icmpv6CodeBuilder) Icmpv6CodeCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6CodeCaseBuilder)

Aggregations

Icmpv6MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder)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 Icmpv6CodeCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv6CodeCaseBuilder)1 Icmpv6Code (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.code._case.Icmpv6Code)1 Icmpv6CodeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.icmpv6.code._case.Icmpv6CodeBuilder)1