use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.
the class DynamicProtectionObjectParser method localParseObject.
@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
final DynamicControlProtectionObjectBuilder builder = new DynamicControlProtectionObjectBuilder();
final ProtectionSubobject pSub = ProtectionCommonParser.parseCommonProtectionBodyType2(byteBuf);
return builder.setProtectionSubobject(pSub).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.
the class DynamicProtectionObjectParser method localSerializeObject.
@Override
public void localSerializeObject(final RsvpTeObject teLspObject, final ByteBuf output) {
Preconditions.checkArgument(teLspObject instanceof DynamicControlProtectionObject, "ProtectionObject is mandatory.");
final DynamicControlProtectionObject protectionObject = (DynamicControlProtectionObject) teLspObject;
serializeAttributeHeader(PROTECTION_TYPE2_BODY_SIZE, CLASS_NUM, CTYPE, output);
ProtectionCommonParser.serializeBodyType2(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 ExcludeRouteObjectParser method localSerializeObject.
@Override
public void localSerializeObject(final RsvpTeObject teLspObject, final ByteBuf output) {
Preconditions.checkArgument(teLspObject instanceof ExcludeRouteObject, "DetourObject is mandatory.");
final ExcludeRouteObject excludeObject = (ExcludeRouteObject) teLspObject;
final ByteBuf bufferAux = Unpooled.buffer();
serializeList(excludeObject.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 ExplicitRouteObjectParser 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);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject in project bgpcep by opendaylight.
the class FlowSpecObjectParser method localParseObject.
@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
final FlowSpecObjectBuilder builder = new FlowSpecObjectBuilder();
// skip version number, reserved, overall length
byteBuf.skipBytes(ByteBufWriteUtil.INT_BYTES_LENGTH);
builder.setServiceHeader(ServiceNumber.forValue(byteBuf.readUnsignedByte()));
// skip reserved
byteBuf.skipBytes(ByteBufWriteUtil.ONE_BYTE_LENGTH);
// skip Length of controlled-load data
byteBuf.skipBytes(ByteBufWriteUtil.SHORT_BYTES_LENGTH);
// skip parameter ID 127 and 127 flags
byteBuf.skipBytes(ByteBufWriteUtil.INT_BYTES_LENGTH);
final TspecObjectBuilder tBuilder = new TspecObjectBuilder();
tBuilder.setTokenBucketRate(new Float32(ByteArray.readBytes(byteBuf, METRIC_VALUE_F_LENGTH)));
tBuilder.setTokenBucketSize(new Float32(ByteArray.readBytes(byteBuf, METRIC_VALUE_F_LENGTH)));
tBuilder.setPeakDataRate(new Float32(ByteArray.readBytes(byteBuf, METRIC_VALUE_F_LENGTH)));
tBuilder.setMinimumPolicedUnit(byteBuf.readUnsignedInt());
tBuilder.setMaximumPacketSize(byteBuf.readUnsignedInt());
builder.setTspecObject(tBuilder.build());
if (builder.getServiceHeader().getIntValue() == 2) {
// skip parameter ID 130, flags, lenght
byteBuf.skipBytes(ByteBufWriteUtil.INT_BYTES_LENGTH);
builder.setRate(new Float32(ByteArray.readBytes(byteBuf, METRIC_VALUE_F_LENGTH)));
builder.setSlackTerm(byteBuf.readUnsignedInt());
}
return builder.build();
}
Aggregations