Search in sources :

Example 6 with VendorInformationTlv

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.vendor.information.tlvs.VendorInformationTlv in project bgpcep by opendaylight.

the class AbstractVendorInformationTlvParser method serializeTlv.

@Override
public final void serializeTlv(final Tlv tlv, final ByteBuf buffer) {
    checkArgument(tlv instanceof VendorInformationTlv, "Vendor Specific Tlv is mandatory.");
    final VendorInformationTlv viTlv = (VendorInformationTlv) tlv;
    final ByteBuf body = Unpooled.buffer();
    ByteBufUtils.write(body, getEnterpriseNumber().getValue());
    serializeEnterpriseSpecificInformation(viTlv.getEnterpriseSpecificInformation(), body);
    TlvUtil.formatTlv(VENDOR_INFORMATION_TLV_TYPE, body, buffer);
}
Also used : VendorInformationTlv(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.vendor.information.tlvs.VendorInformationTlv) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

VendorInformationTlv (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.vendor.information.tlvs.VendorInformationTlv)5 ByteBuf (io.netty.buffer.ByteBuf)4 EnterpriseNumber (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber)3 Test (org.junit.Test)2 TestEnterpriseSpecificInformation (org.opendaylight.protocol.pcep.impl.TestVendorInformationTlvParser.TestEnterpriseSpecificInformation)2 VendorInformationTlvBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.vendor.information.tlvs.VendorInformationTlvBuilder)2 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 PCEPCloseObjectParser (org.opendaylight.protocol.pcep.parser.object.PCEPCloseObjectParser)1 ObjectHeaderImpl (org.opendaylight.protocol.pcep.spi.ObjectHeaderImpl)1 EnterpriseSpecificInformation (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.vendor.information.EnterpriseSpecificInformation)1 VendorInformationTlvBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.vendor.information.tlvs.VendorInformationTlvBuilder)1 Tlv (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Tlv)1 CCloseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.close.object.CCloseBuilder)1 Subobject (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.exclude.route.object.xro.Subobject)1