Search in sources :

Example 1 with SetDlSrcAction

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcAction in project openflowplugin by opendaylight.

the class SalToOfSetDlSrcActionV10Case method process.

@Nonnull
@Override
public Optional<Action> process(@Nonnull final SetDlSrcActionCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
    SetDlSrcAction setdlsrcaction = source.getSetDlSrcAction();
    SetDlSrcCaseBuilder setDlSrcCaseBuilder = new SetDlSrcCaseBuilder();
    SetDlSrcActionBuilder setDlSrcActionBuilder = new SetDlSrcActionBuilder();
    setDlSrcActionBuilder.setDlSrcAddress(setdlsrcaction.getAddress());
    setDlSrcCaseBuilder.setSetDlSrcAction(setDlSrcActionBuilder.build());
    return Optional.of(new ActionBuilder().setActionChoice(setDlSrcCaseBuilder.build()).build());
}
Also used : SetDlSrcActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.dl.src._case.SetDlSrcActionBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) SetDlSrcAction(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcAction) SetDlSrcCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlSrcCaseBuilder) SetDlSrcActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.dl.src._case.SetDlSrcActionBuilder) Nonnull(javax.annotation.Nonnull)

Example 2 with SetDlSrcAction

use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcAction in project openflowplugin by opendaylight.

the class SalToOfSetDlSrcActionCase method process.

@Nonnull
@Override
public Optional<Action> process(@Nonnull final SetDlSrcActionCase source, final ActionConvertorData data, ConvertorExecutor convertorExecutor) {
    SetDlSrcAction setdlsrcaction = source.getSetDlSrcAction();
    MatchEntryBuilder matchBuilder = new MatchEntryBuilder();
    matchBuilder.setOxmClass(OpenflowBasicClass.class);
    matchBuilder.setOxmMatchField(EthSrc.class);
    EthSrcCaseBuilder ethSrcCaseBuilder = new EthSrcCaseBuilder();
    EthSrcBuilder ethSrcBuilder = new EthSrcBuilder();
    ethSrcBuilder.setMacAddress(setdlsrcaction.getAddress());
    matchBuilder.setHasMask(false);
    ethSrcCaseBuilder.setEthSrc(ethSrcBuilder.build());
    matchBuilder.setMatchEntryValue(ethSrcCaseBuilder.build());
    List<MatchEntry> entries = new ArrayList<>();
    entries.add(matchBuilder.build());
    SetFieldActionBuilder setFieldBuilder = new SetFieldActionBuilder();
    setFieldBuilder.setMatchEntry(entries);
    SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
    setFieldCaseBuilder.setSetFieldAction(setFieldBuilder.build());
    return Optional.of(new ActionBuilder().setActionChoice(setFieldCaseBuilder.build()).build());
}
Also used : EthSrcBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.src._case.EthSrcBuilder) SetFieldCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCaseBuilder) MatchEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry) MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder) SetFieldActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder) SetDlSrcAction(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcAction) EthSrcCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthSrcCaseBuilder) ArrayList(java.util.ArrayList) SetFieldActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder) Nonnull(javax.annotation.Nonnull)

Aggregations

Nonnull (javax.annotation.Nonnull)2 SetDlSrcAction (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.dl.src.action._case.SetDlSrcAction)2 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder)2 ArrayList (java.util.ArrayList)1 SetDlSrcCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetDlSrcCaseBuilder)1 SetFieldCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCaseBuilder)1 SetDlSrcActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.dl.src._case.SetDlSrcActionBuilder)1 SetFieldActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder)1 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)1 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)1 EthSrcCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthSrcCaseBuilder)1 EthSrcBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.src._case.EthSrcBuilder)1