Search in sources :

Example 1 with FlowModsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowModsBuilder 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 2 with FlowModsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowModsBuilder 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 3 with FlowModsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowModsBuilder 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 4 with FlowModsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowModsBuilder 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)

Example 5 with FlowModsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowModsBuilder in project openflowplugin by opendaylight.

the class LearnCodecTest method createFlowMods.

private List<FlowMods> createFlowMods() {
    final List<FlowMods> flowMods = new ArrayList<>();
    // length = 14
    final FlowModsBuilder flowMod = new FlowModsBuilder();
    FlowModAddMatchFromFieldBuilder spec = new FlowModAddMatchFromFieldBuilder();
    spec.setFlowModNumBits(48);
    spec.setSrcField((long) 9);
    spec.setSrcOfs(10);
    spec.setDstField((long) 11);
    spec.setDstOfs(12);
    FlowModAddMatchFromFieldCaseBuilder caseBuilder = new FlowModAddMatchFromFieldCaseBuilder();
    caseBuilder.setFlowModAddMatchFromField(spec.build());
    flowMod.setFlowModSpec(caseBuilder.build());
    flowMods.add(flowMod.build());
    // length = 14
    final FlowModsBuilder flowMod2 = new FlowModsBuilder();
    FlowModCopyFieldIntoFieldBuilder spec2 = new FlowModCopyFieldIntoFieldBuilder();
    spec2.setFlowModNumBits(48);
    spec2.setSrcField((long) 9);
    spec2.setSrcOfs(10);
    spec2.setDstField((long) 11);
    spec2.setDstOfs(12);
    FlowModCopyFieldIntoFieldCaseBuilder caseBuilder2 = new FlowModCopyFieldIntoFieldCaseBuilder();
    caseBuilder2.setFlowModCopyFieldIntoField(spec2.build());
    flowMod2.setFlowModSpec(caseBuilder2.build());
    flowMods.add(flowMod2.build());
    // length = 10
    final FlowModsBuilder flowMod3 = new FlowModsBuilder();
    FlowModCopyValueIntoFieldBuilder spec3 = new FlowModCopyValueIntoFieldBuilder();
    spec3.setFlowModNumBits(48);
    spec3.setValue(9);
    spec3.setDstField((long) 10);
    spec3.setDstOfs(11);
    FlowModCopyValueIntoFieldCaseBuilder caseBuilder3 = new FlowModCopyValueIntoFieldCaseBuilder();
    caseBuilder3.setFlowModCopyValueIntoField(spec3.build());
    flowMod3.setFlowModSpec(caseBuilder3.build());
    flowMods.add(flowMod3.build());
    // length = 10
    final FlowModsBuilder flowMod4 = new FlowModsBuilder();
    FlowModAddMatchFromValueBuilder spec4 = new FlowModAddMatchFromValueBuilder();
    spec4.setFlowModNumBits(48);
    spec4.setValue(9);
    spec4.setSrcField((long) 10);
    spec4.setSrcOfs(11);
    FlowModAddMatchFromValueCaseBuilder caseBuilder4 = new FlowModAddMatchFromValueCaseBuilder();
    caseBuilder4.setFlowModAddMatchFromValue(spec4.build());
    flowMod4.setFlowModSpec(caseBuilder4.build());
    flowMods.add(flowMod4.build());
    // length = 8
    final FlowModsBuilder flowMod5 = new FlowModsBuilder();
    FlowModOutputToPortBuilder spec5 = new FlowModOutputToPortBuilder();
    spec5.setFlowModNumBits(48);
    spec5.setSrcField((long) 9);
    spec5.setSrcOfs(10);
    FlowModOutputToPortCaseBuilder caseBuilder5 = new FlowModOutputToPortCaseBuilder();
    caseBuilder5.setFlowModOutputToPort(spec5.build());
    flowMod5.setFlowModSpec(caseBuilder5.build());
    flowMods.add(flowMod5.build());
    return flowMods;
}
Also used : FlowModAddMatchFromFieldCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromFieldCaseBuilder) 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) FlowModOutputToPortCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModOutputToPortCaseBuilder) 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) 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) ArrayList(java.util.ArrayList) FlowModsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowModsBuilder) FlowModAddMatchFromValueCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModAddMatchFromValueCaseBuilder) FlowMods(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods) 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) 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) FlowModCopyValueIntoFieldCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.FlowModCopyValueIntoFieldCaseBuilder)

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)2 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 FlowMods (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.ofj.nx.action.learn.grouping.nx.action.learn.FlowMods)1 FlowModSpec (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.flow.mod.spec.FlowModSpec)1 FlowMods (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowMods)1 FlowModsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.learn.grouping.nx.learn.FlowModsBuilder)1