Search in sources :

Example 1 with FlowMods

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods in project openflowplugin by opendaylight.

the class LearnConvertorUtil method getFlowMods.

private static List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods> getFlowMods(NxLearn nxLearn) {
    if (nxLearn.getFlowMods() == null) {
        return null;
    }
    List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods> flowMods = new ArrayList<>();
    for (FlowMods flowMod : nxLearn.getFlowMods()) {
        org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowModsBuilder flowModBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowModsBuilder();
        org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.FlowModSpec flowModSpec = buildFlowModSpec(flowMod.getFlowModSpec());
        flowModBuilder.setFlowModSpec(flowModSpec);
        flowMods.add(flowModBuilder.build());
    }
    return flowMods;
}
Also used : ArrayList(java.util.ArrayList) FlowModsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowModsBuilder) FlowMods(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowMods)

Example 2 with FlowMods

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods in project openflowplugin by opendaylight.

the class LearnConvertorUtil method getFlowMods.

private static List<FlowMods> getFlowMods(NxActionLearn action) {
    if (action.getFlowMods() == null) {
        return null;
    }
    List<FlowMods> flowMods = new ArrayList<>();
    for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods flowMod : action.getFlowMods()) {
        FlowModsBuilder flowModBuilder = new FlowModsBuilder();
        FlowModSpec flowModSpec = buildExtFlowModSpec(flowMod.getFlowModSpec());
        flowModBuilder.setFlowModSpec(flowModSpec);
        flowMods.add(flowModBuilder.build());
    }
    return flowMods;
}
Also used : FlowModSpec(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.flow.mod.spec.FlowModSpec) ArrayList(java.util.ArrayList) FlowModsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowModsBuilder) FlowMods(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowMods)

Example 3 with FlowMods

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods in project openflowplugin by opendaylight.

the class LearnCodecUtil method readFlowModAddMatchFromValue.

private static FlowMods readFlowModAddMatchFromValue(ByteBuf message, short numBits) {
    FlowModAddMatchFromValueBuilder builder = new FlowModAddMatchFromValueBuilder();
    builder.setValue(message.readUnsignedShort());
    builder.setSrcField((long) message.readInt());
    builder.setSrcOfs((int) message.readShort());
    builder.setFlowModNumBits((int) numBits);
    length -= FROM_VALUE_LENGTH - EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
    FlowModsBuilder flowModsBuilder = new FlowModsBuilder();
    FlowModAddMatchFromValueCaseBuilder caseBuilder = new FlowModAddMatchFromValueCaseBuilder();
    caseBuilder.setFlowModAddMatchFromValue(builder.build());
    flowModsBuilder.setFlowModSpec(caseBuilder.build());
    return flowModsBuilder.build();
}
Also used : FlowModsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowModsBuilder) FlowModAddMatchFromValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.value._case.FlowModAddMatchFromValueBuilder) FlowModAddMatchFromValueCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromValueCaseBuilder)

Example 4 with FlowMods

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods in project openflowplugin by opendaylight.

the class LearnCodecUtil method readFlowModCopyFromValue.

private static FlowMods readFlowModCopyFromValue(ByteBuf message, short numBits) {
    FlowModCopyValueIntoFieldBuilder builder = new FlowModCopyValueIntoFieldBuilder();
    builder.setValue(message.readUnsignedShort());
    builder.setDstField((long) message.readInt());
    builder.setDstOfs((int) message.readShort());
    builder.setFlowModNumBits((int) numBits);
    length -= FROM_VALUE_LENGTH - EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
    FlowModsBuilder flowModsBuilder = new FlowModsBuilder();
    FlowModCopyValueIntoFieldCaseBuilder caseBuilder = new FlowModCopyValueIntoFieldCaseBuilder();
    caseBuilder.setFlowModCopyValueIntoField(builder.build());
    flowModsBuilder.setFlowModSpec(caseBuilder.build());
    return flowModsBuilder.build();
}
Also used : FlowModCopyValueIntoFieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.copy.value.into.field._case.FlowModCopyValueIntoFieldBuilder) FlowModsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowModsBuilder) FlowModCopyValueIntoFieldCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyValueIntoFieldCaseBuilder)

Example 5 with FlowMods

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods in project openflowplugin by opendaylight.

the class LearnCodecUtil method readFlowModCopyFromField.

private static FlowMods readFlowModCopyFromField(ByteBuf message, short numBits) {
    FlowModCopyFieldIntoFieldBuilder builder = new FlowModCopyFieldIntoFieldBuilder();
    builder.setSrcField((long) message.readInt());
    builder.setSrcOfs((int) message.readShort());
    builder.setDstField((long) message.readInt());
    builder.setDstOfs((int) message.readShort());
    builder.setFlowModNumBits((int) numBits);
    length -= FROM_FIELD_LENGTH - EncodeConstants.SIZE_OF_SHORT_IN_BYTES;
    FlowModsBuilder flowModsBuilder = new FlowModsBuilder();
    FlowModCopyFieldIntoFieldCaseBuilder caseBuilder = new FlowModCopyFieldIntoFieldCaseBuilder();
    caseBuilder.setFlowModCopyFieldIntoField(builder.build());
    flowModsBuilder.setFlowModSpec(caseBuilder.build());
    return flowModsBuilder.build();
}
Also used : FlowModCopyFieldIntoFieldBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.copy.field.into.field._case.FlowModCopyFieldIntoFieldBuilder) FlowModCopyFieldIntoFieldCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyFieldIntoFieldCaseBuilder) FlowModsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowModsBuilder)

Aggregations

FlowModsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowModsBuilder)6 ArrayList (java.util.ArrayList)4 FlowMods (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods)3 FlowMods (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowMods)3 FlowModAddMatchFromFieldCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCaseBuilder)2 FlowModAddMatchFromValueCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromValueCaseBuilder)2 FlowModCopyFieldIntoFieldCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyFieldIntoFieldCaseBuilder)2 FlowModCopyValueIntoFieldCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyValueIntoFieldCaseBuilder)2 FlowModOutputToPortCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModOutputToPortCaseBuilder)2 FlowModAddMatchFromFieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.field._case.FlowModAddMatchFromFieldBuilder)2 FlowModAddMatchFromValueBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.value._case.FlowModAddMatchFromValueBuilder)2 FlowModCopyFieldIntoFieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.copy.field.into.field._case.FlowModCopyFieldIntoFieldBuilder)2 FlowModCopyValueIntoFieldBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.copy.value.into.field._case.FlowModCopyValueIntoFieldBuilder)2 FlowModOutputToPortBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.output.to.port._case.FlowModOutputToPortBuilder)2 FlowModsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowModsBuilder)2 FlowModAddMatchFromFieldCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCase)1 FlowModAddMatchFromValueCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromValueCase)1 FlowModCopyFieldIntoFieldCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyFieldIntoFieldCase)1 FlowModCopyValueIntoFieldCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyValueIntoFieldCase)1 FlowModOutputToPortCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModOutputToPortCase)1