use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.bandwidth.object.Bandwidth in project bgpcep by opendaylight.
the class BandwidthObjectParser method localParseObject.
@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
final BasicBandwidthObjectBuilder builder = new BasicBandwidthObjectBuilder();
final ByteBuf v = byteBuf.readSlice(METRIC_VALUE_F_LENGTH);
builder.setBandwidth(new Bandwidth(ByteArray.readAllBytes(v)));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.bandwidth.object.Bandwidth in project bgpcep by opendaylight.
the class BandwidthObjectParser method localSerializeObject.
@Override
public void localSerializeObject(final RsvpTeObject teLspObject, final ByteBuf output) {
Preconditions.checkArgument(teLspObject instanceof BasicBandwidthObject, "BandwidthObject is mandatory.");
final BasicBandwidthObject bandObject = (BasicBandwidthObject) teLspObject;
serializeAttributeHeader(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.pcep.types.rev131005.bandwidth.object.Bandwidth in project bgpcep by opendaylight.
the class FastRerouteObjectParser method localParseObject.
@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) {
final BasicFastRerouteObjectBuilder builder = new BasicFastRerouteObjectBuilder();
builder.setSetupPriority(byteBuf.readUnsignedByte());
builder.setHoldPriority(byteBuf.readUnsignedByte());
builder.setHopLimit(byteBuf.readUnsignedByte());
builder.setFlags(FastRerouteFlags.forValue(byteBuf.readUnsignedByte()));
final ByteBuf v = byteBuf.readSlice(METRIC_VALUE_F_LENGTH);
builder.setBandwidth(new Bandwidth(ByteArray.readAllBytes(v)));
builder.setIncludeAny(new AttributeFilter(byteBuf.readUnsignedInt()));
builder.setExcludeAny(new AttributeFilter(byteBuf.readUnsignedInt()));
builder.setIncludeAll(new AttributeFilter(byteBuf.readUnsignedInt()));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.bandwidth.object.Bandwidth in project bgpcep by opendaylight.
the class InformationalFastRerouteObjectParser method localParseObject.
@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
final LegacyFastRerouteObjectBuilder builder = new LegacyFastRerouteObjectBuilder();
builder.setSetupPriority(byteBuf.readUnsignedByte());
builder.setHoldPriority(byteBuf.readUnsignedByte());
builder.setHopLimit(byteBuf.readUnsignedByte());
// skip reserved
byteBuf.skipBytes(ByteBufWriteUtil.ONE_BYTE_LENGTH);
final ByteBuf v = byteBuf.readSlice(METRIC_VALUE_F_LENGTH);
builder.setBandwidth(new Bandwidth(ByteArray.readAllBytes(v)));
builder.setIncludeAny(new AttributeFilter(byteBuf.readUnsignedInt()));
builder.setExcludeAny(new AttributeFilter(byteBuf.readUnsignedInt()));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.bandwidth.object.Bandwidth 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()));
}
Aggregations