use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.mpls.ttl.action._case.SetMplsTtlActionBuilder in project openflowplugin by opendaylight.
the class OfToSalSetMplsTtlCase method process.
@Override
public Optional<Action> process(@Nonnull final SetMplsTtlCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
SetMplsTtlAction setMplsTtlActionFromOF = source.getSetMplsTtlAction();
SetMplsTtlActionBuilder mplsTtlAction = new SetMplsTtlActionBuilder();
mplsTtlAction.setMplsTtl(setMplsTtlActionFromOF.getMplsTtl());
return Optional.of(new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(mplsTtlAction.build()).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.mpls.ttl.action._case.SetMplsTtlActionBuilder in project openflowplugin by opendaylight.
the class SetMplsTtlActionSerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final short mpls = (short) 10;
final Action action = new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(new SetMplsTtlActionBuilder().setMplsTtl(mpls).build()).build();
assertAction(action, out -> {
assertEquals(out.readUnsignedByte(), mpls);
out.skipBytes(ActionConstants.SET_MPLS_TTL_PADDING);
});
}
Aggregations