use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.
the class AttributesObjectParser method localSerializeObject.
@Override
public void localSerializeObject(final RsvpTeObject teLspObject, final ByteBuf byteAggregator) {
Preconditions.checkArgument(teLspObject instanceof LspAttributesObject, "LspAttributesObject is mandatory.");
final LspAttributesObject lspAttributesObject = (LspAttributesObject) teLspObject;
final ByteBuf bufferAux = Unpooled.buffer();
int length = 0;
for (final SubobjectContainer subObject : lspAttributesObject.getSubobjectContainer()) {
final LspSubobject lspSubonject = subObject.getLspSubobject();
if (lspSubonject instanceof FlagsTlv) {
final ByteBuf flagTLVValue = Unpooled.buffer();
final List<FlagContainer> flagList = ((FlagsTlv) lspSubonject).getFlagContainer();
length = FLAG_TLV_SIZE * flagList.size();
serializeFlag(flagList, flagTLVValue);
serializeTLV(FLAG_TLV_TYPE, length, flagTLVValue, bufferAux);
length += TLV_HEADER_SIZE;
}
}
serializeAttributeHeader(length, CLASS_NUM, CTYPE, byteAggregator);
byteAggregator.writeBytes(bufferAux);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.
the class PrimaryPathRouteObjectParser method localSerializeObject.
@Override
public void localSerializeObject(final RsvpTeObject teLspObject, final ByteBuf output) {
Preconditions.checkArgument(teLspObject instanceof PrimaryPathRouteObject, "ExplicitRouteObject is mandatory.");
final PrimaryPathRouteObject explicitObject = (PrimaryPathRouteObject) teLspObject;
final ByteBuf bufferAux = Unpooled.buffer();
serializeList(explicitObject.getSubobjectContainer(), bufferAux);
serializeAttributeHeader(bufferAux.readableBytes(), CLASS_NUM, CTYPE, output);
output.writeBytes(bufferAux);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.
the class ProtectionObjectParser method localSerializeObject.
@Override
public void localSerializeObject(final RsvpTeObject teLspObject, final ByteBuf output) {
Preconditions.checkArgument(teLspObject instanceof BasicProtectionObject, "ProtectionObject is mandatory.");
final BasicProtectionObject protectionObject = (BasicProtectionObject) teLspObject;
serializeAttributeHeader(PROTECTION_BODY_SIZE, CLASS_NUM, CTYPE, output);
ProtectionCommonParser.serializeBodyType1(protectionObject.getProtectionSubobject(), output);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.
the class ReoptimizationBandwidthObjectParser method localSerializeObject.
@Override
public void localSerializeObject(final RsvpTeObject teLspObject, final ByteBuf output) {
Preconditions.checkArgument(teLspObject instanceof ReoptimizationBandwidthObject, "BandwidthObject is mandatory.");
final ReoptimizationBandwidthObject bandObject = (ReoptimizationBandwidthObject) teLspObject;
serializeAttributeHeader(BandwidthObjectParser.BODY_SIZE, CLASS_NUM, CTYPE, output);
final Bandwidth band = bandObject.getBandwidth();
output.writeBytes(Unpooled.wrappedBuffer(band.getValue()));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.
the class SecondaryExplicitRouteObjectParser method localSerializeObject.
@Override
public void localSerializeObject(final RsvpTeObject teLspObject, final ByteBuf output) {
Preconditions.checkArgument(teLspObject instanceof ExplicitRouteObject, "ExplicitRouteObject is mandatory.");
final ExplicitRouteObject explicitObject = (ExplicitRouteObject) teLspObject;
final ByteBuf bufferAux = Unpooled.buffer();
serializeList(explicitObject.getSubobjectContainer(), bufferAux);
serializeAttributeHeader(bufferAux.readableBytes(), CLASS_NUM, CTYPE, output);
output.writeBytes(bufferAux);
}
Aggregations