Search in sources :

Example 6 with VendorInformationTlv

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.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) {
    Preconditions.checkArgument(tlv instanceof VendorInformationTlv, "Vendor Specific Tlv is mandatory.");
    final VendorInformationTlv viTlv = (VendorInformationTlv) tlv;
    final ByteBuf body = Unpooled.buffer();
    writeUnsignedInt(getEnterpriseNumber().getValue(), body);
    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.rev131005.vendor.information.tlvs.VendorInformationTlv) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

VendorInformationTlv (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.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 VendorInformationTlvBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.vendor.information.tlvs.VendorInformationTlvBuilder)3 Test (org.junit.Test)2 TestEnterpriseSpecificInformation (org.opendaylight.protocol.pcep.impl.TestVendorInformationTlvParser.TestEnterpriseSpecificInformation)2 PCEPCloseObjectParser (org.opendaylight.protocol.pcep.parser.object.PCEPCloseObjectParser)1 ObjectHeaderImpl (org.opendaylight.protocol.pcep.spi.ObjectHeaderImpl)1 Tlv (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Tlv)1 CCloseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.close.object.CCloseBuilder)1 Subobject (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.xro.Subobject)1 EnterpriseSpecificInformation (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.vendor.information.EnterpriseSpecificInformation)1