Search in sources :

Example 21 with MeterFlags

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterFlags in project openflowplugin by opendaylight.

the class MeterMessageSerializer method serialize.

@Override
public void serialize(final MeterMessage message, final ByteBuf outBuffer) {
    final int index = outBuffer.writerIndex();
    super.serialize(message, outBuffer);
    outBuffer.writeShort(message.getCommand().getIntValue());
    outBuffer.writeShort(createMeterFlagsBitMask(MoreObjects.firstNonNull(message.getFlags(), new MeterFlags(false, false, true, false))));
    outBuffer.writeInt(message.getMeterId().getValue().intValue());
    serializeBands(message.getMeterBandHeaders(), outBuffer);
    outBuffer.setShort(index + 2, outBuffer.writerIndex() - index);
}
Also used : MeterFlags(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterFlags)

Example 22 with MeterFlags

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterFlags in project openflowplugin by opendaylight.

the class MultipartReplyTranslatorUtilTest method translateMeterFeatures.

@Test
public void translateMeterFeatures() {
    final MultipartReply multipartReply = buildReply(MultipartType.OFPMPMETERFEATURES, new MultipartReplyMeterFeaturesCaseBuilder().setMultipartReplyMeterFeatures(new MultipartReplyMeterFeaturesBuilder().setMaxMeter(10L).setCapabilities(new MeterFlags(true, false, false, false)).setBandTypes(new MeterBandTypeBitmap(true, false)).build()).build());
    dummyAssertReply(multipartReply);
}
Also used : MultipartReplyMeterFeaturesCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyMeterFeaturesCaseBuilder) MultipartReply(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply) MultipartReplyMeterFeaturesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.meter.features._case.MultipartReplyMeterFeaturesBuilder) MeterFlags(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterFlags) MeterBandTypeBitmap(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterBandTypeBitmap) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)15 MeterFlags (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterFlags)15 ByteBuf (io.netty.buffer.ByteBuf)8 ArrayList (java.util.ArrayList)8 MeterFlags (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterFlags)7 MeterId (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterId)7 MeterModInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterModInputBuilder)6 MeterBandType (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterBandType)5 DscpRemarkBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.band.type.DscpRemarkBuilder)5 MeterBandHeadersBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.MeterBandHeadersBuilder)5 MeterBandHeader (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.MeterBandHeader)5 MeterBandHeaderBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.MeterBandHeaderBuilder)5 MeterBandTypesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.meter.band.headers.meter.band.header.MeterBandTypesBuilder)5 MeterBandTypeBitmap (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MeterBandTypeBitmap)5 MultipartReplyMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage)5 MeterBandDropCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandDropCase)5 MeterBandDscpRemarkCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.meter.band.header.meter.band.MeterBandDscpRemarkCase)5 AddMeterInput (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterInput)4 VersionConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData)3 BandId (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.BandId)3