use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.mpls.action._case.PopMplsAction in project openflowplugin by opendaylight.
the class PopMplsActionSerializer method serialize.
@Override
public void serialize(PopMplsActionCase action, ByteBuf outBuffer) {
super.serialize(action, outBuffer);
final PopMplsAction popMplsAction = action.getPopMplsAction();
outBuffer.writeShort(popMplsAction.getEthernetType());
outBuffer.writeZero(ActionConstants.ETHERTYPE_ACTION_PADDING);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.mpls.action._case.PopMplsAction in project openflowplugin by opendaylight.
the class PopMplsActionDeserializerTest method testDeserialize.
@Test
public void testDeserialize() throws Exception {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short ethType = 10;
writeHeader(in);
in.writeShort(ethType);
in.writeZero(ActionConstants.ETHERTYPE_ACTION_PADDING);
final Action action = deserializeAction(in);
assertTrue(PopMplsActionCase.class.isInstance(action));
final PopMplsAction popAction = PopMplsActionCase.class.cast(action).getPopMplsAction();
assertEquals(ethType, popAction.getEthernetType().shortValue());
assertEquals(0, in.readableBytes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.mpls.action._case.PopMplsAction in project openflowplugin by opendaylight.
the class OfToSalPopMplsCase method process.
@Override
public Optional<Action> process(@Nonnull final PopMplsCase source, final ActionResponseConvertorData data, ConvertorExecutor convertorExecutor) {
PopMplsAction popMplsActionFromOF = source.getPopMplsAction();
PopMplsActionBuilder popMplsAction = new PopMplsActionBuilder();
popMplsAction.setEthernetType(popMplsActionFromOF.getEthertype().getValue());
return Optional.of(new PopMplsActionCaseBuilder().setPopMplsAction(popMplsAction.build()).build());
}
Aggregations