use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader in project bgpcep by opendaylight.
the class Stateful07LspObjectParser method parseObject.
@Override
public Lsp parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
Preconditions.checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
final LspBuilder builder = new LspBuilder();
builder.setIgnore(header.isIgnore());
builder.setProcessingRule(header.isProcessingRule());
final int[] plspIdRaw = new int[] { bytes.readUnsignedByte(), bytes.readUnsignedByte(), bytes.getUnsignedByte(2) };
builder.setPlspId(new PlspId((long) ((plspIdRaw[0] << FLAGS_SIZE) | (plspIdRaw[1] << FOUR_BITS_SHIFT) | (plspIdRaw[2] >> FOUR_BITS_SHIFT))));
parseFlags(builder, bytes);
final TlvsBuilder b = new TlvsBuilder();
parseTlvs(b, bytes.slice());
builder.setTlvs(b.build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader in project bgpcep by opendaylight.
the class PCEPReportedRouteObjectParser method parseObject.
@Override
public Rro parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
Preconditions.checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
final RroBuilder builder = new RroBuilder();
builder.setIgnore(header.isIgnore());
builder.setProcessingRule(header.isProcessingRule());
builder.setSubobject(parseSubobjects(bytes.slice()));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader in project bgpcep by opendaylight.
the class AbstractVendorInformationObjectParser method parseObject.
@Override
public final Object parseObject(final ObjectHeader header, final ByteBuf buffer) throws PCEPDeserializerException {
Preconditions.checkArgument(buffer != null && buffer.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
final VendorInformationObjectBuilder builder = new VendorInformationObjectBuilder();
builder.setEnterpriseNumber(new EnterpriseNumber(getEnterpriseNumber()));
builder.setEnterpriseSpecificInformation(parseEnterpriseSpecificInformation(buffer));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader in project bgpcep by opendaylight.
the class PCEPPccIdReqIPv6ObjectParser method parseObject.
@Override
public Object parseObject(final ObjectHeader header, final ByteBuf buffer) throws PCEPDeserializerException {
Preconditions.checkArgument(buffer != null && buffer.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
final PccIdReqBuilder builder = new PccIdReqBuilder();
builder.setIpAddress(new IpAddress(Ipv6Util.addressForByteBuf(buffer)));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader in project bgpcep by opendaylight.
the class PCEPPceIdIPv4ObjectParser method parseObject.
@Override
public Object parseObject(final ObjectHeader header, final ByteBuf buffer) throws PCEPDeserializerException {
Preconditions.checkArgument(buffer != null && buffer.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
final PceIdBuilder builder = new PceIdBuilder();
builder.setIpAddress(new IpAddress(Ipv4Util.addressForByteBuf(buffer)));
return builder.build();
}
Aggregations