Search in sources :

Example 1 with PerAfiSafiLocRibTlv

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.stat.tlvs.PerAfiSafiLocRibTlv in project bgpcep by opendaylight.

the class StatType010TlvHandler method serializeTlv.

@Override
public void serializeTlv(final Tlv tlv, final ByteBuf output) {
    checkArgument(tlv instanceof PerAfiSafiLocRibTlv, "PerAfiSafiLocRibInTlv is mandatory.");
    final PerAfiSafiLocRibTlv perAfiSafi = (PerAfiSafiLocRibTlv) tlv;
    final ByteBuf buffer = Unpooled.buffer();
    final Integer afiInt = this.afiRegistry.numberForClass(perAfiSafi.getAfi());
    buffer.writeShort(afiInt != null ? afiInt : 0);
    buffer.writeByte(this.safiRegistry.numberForClass(perAfiSafi.getSafi()));
    ByteBufUtils.write(buffer, perAfiSafi.getCount().getValue());
    TlvUtil.formatTlv(TYPE, buffer, output);
}
Also used : PerAfiSafiLocRibTlv(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.stat.tlvs.PerAfiSafiLocRibTlv) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 PerAfiSafiLocRibTlv (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.stat.tlvs.PerAfiSafiLocRibTlv)1