final byte[] srpObjectWithPstTlvBytes = { 0x21, 0x10, 0x00, 0x14, 0x0, 0x0, 0x0, 0x01, 0x0, 0x0,
0x0, 0x01,
/* pst-tlv */
- 0x0, 0x1b, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
+ 0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
final CInitiated00SrpObjectParser parser = new CInitiated00SrpObjectParser(this.tlvRegistry, this.viTlvRegistry);
SrpBuilder builder = new SrpBuilder();
builder.setProcessingRule(false);
public class PathSetupTypeTlvParser implements TlvParser, TlvSerializer {
- // http://tools.ietf.org/html/draft-sivabalan-pce-ietf-routing-00#section-9.3
- public static final int TYPE = 27;
+ public static final int TYPE = 28;
private static final int CONTENT_LENGTH = 4;
private static final int PST_LENGTH = 1;
}
@Override
- public void serializeTlv(Tlv tlv, ByteBuf buffer) {
+ public void serializeTlv(final Tlv tlv, final ByteBuf buffer) {
Preconditions.checkArgument(tlv instanceof PathSetupType, "PathSetupType is mandatory.");
final PathSetupType pstTlv = (PathSetupType) tlv;
Preconditions.checkArgument(checkPST(pstTlv.getPst()), UNSUPPORTED_PST);
- ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
+ final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
body.writeZero(OFFSET);
writeUnsignedByte(pstTlv.getPst(), body);
TlvUtil.formatTlv(TYPE, body, buffer);
}
@Override
- public Tlv parseTlv(ByteBuf buffer) throws PCEPDeserializerException {
+ public Tlv parseTlv(final ByteBuf buffer) throws PCEPDeserializerException {
if (buffer == null) {
return null;
}
final byte[] rpObjectWithPstTlvBytes = { 0x2, 0x10, 0x0, 0x14, 0x0, 0x0, 0x4, 0x2d, (byte) 0xde,
(byte) 0xad, (byte) 0xbe, (byte) 0xef,
/* pst-tlv */
- 0x0, 0x1b, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
+ 0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
final PCEPRequestParameterObjectParser parser = new PCEPRequestParameterObjectParser(this.tlvRegistry, this.viTlvRegistry);
final RpBuilder builder = new RpBuilder();
0x00, 0x00, 0x00, 0x05
};
- private static final byte[] PST_TLV_BYTES = { 0x0, 0x1b, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
+ private static final byte[] PST_TLV_BYTES = { 0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
- private static final byte[] PST_TLV_BYTES_UNSUPPORTED = { 0x0, 0x1b, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1 };
+ private static final byte[] PST_TLV_BYTES_UNSUPPORTED = { 0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1 };
private final AbstractVendorSpecificTlvParser vsParser = new AbstractVendorSpecificTlvParser() {
private static final byte[] SPC_TLV_BYTES = { 0x0, 0x1a, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1 };
- private static final byte[] SR_TE_PST_BYTES = { 0x0, 0x1b, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1 };
+ private static final byte[] SR_TE_PST_BYTES = { 0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x1 };
@Test
public void testSrPceCapabilityParser() throws PCEPDeserializerException {