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());
}
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());
}
Aggregations