use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.Tlv in project bgpcep by opendaylight.
the class SimpleBindingSubTlvsRegistry method serializeBindingSubTlvs.
public void serializeBindingSubTlvs(final List<BindingSubTlvs> bindingSubTlvs, final ByteBuf aggregator) {
for (final BindingSubTlvs subTlv : bindingSubTlvs) {
final BindingSubTlv bindingSubTlv = subTlv.getBindingSubTlv();
final BindingSubTlvsSerializer serializer = this.handlers.getSerializer(bindingSubTlv.getImplementedInterface());
if (serializer == null) {
LOG.info("Unknown binding sub Tlv type {}", subTlv);
return;
}
serializer.serializeSubTlv(bindingSubTlv, aggregator);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.Tlv in project bgpcep by opendaylight.
the class Stateful07TopologySessionListener method onSessionUp.
@Override
protected void onSessionUp(final PCEPSession session, final PathComputationClientBuilder pccBuilder) {
final InetAddress peerAddress = session.getRemoteAddress();
final Tlvs tlvs = session.getRemoteTlvs();
if (tlvs != null && tlvs.getAugmentation(Tlvs1.class) != null) {
final Stateful stateful = tlvs.getAugmentation(Tlvs1.class).getStateful();
if (stateful != null) {
setStatefulCapabilities(stateful);
pccBuilder.setReportedLsp(Collections.emptyList());
if (isSynchronized()) {
pccBuilder.setStateSync(PccSyncState.Synchronized);
} else if (isTriggeredInitialSynchro()) {
pccBuilder.setStateSync(PccSyncState.TriggeredInitialSync);
} else if (isIncrementalSynchro()) {
pccBuilder.setStateSync(PccSyncState.IncrementalSync);
} else {
pccBuilder.setStateSync(PccSyncState.InitialResync);
}
pccBuilder.setStatefulTlv(new StatefulTlvBuilder().addAugmentation(StatefulTlv1.class, new StatefulTlv1Builder(tlvs.getAugmentation(Tlvs1.class)).build()).build());
} else {
LOG.debug("Peer {} does not advertise stateful TLV", peerAddress);
}
} else {
LOG.debug("Peer {} does not advertise stateful TLV", peerAddress);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.Tlv in project bgpcep by opendaylight.
the class SrPceCapabilityTlvParser method serializeTlv.
@Override
public void serializeTlv(final Tlv tlv, final ByteBuf buffer) {
Preconditions.checkArgument(tlv instanceof SrPceCapability, "SrPceCapability is mandatory.");
final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
body.writerIndex(OFFSET);
writeUnsignedByte(((SrPceCapability) tlv).getMsd(), body);
TlvUtil.formatTlv(TYPE, body, buffer);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.Tlv in project jmulticard by ctt-gob-es.
the class DerBoolean method decodeValue.
@Override
protected void decodeValue() throws Asn1Exception, TlvException {
final Tlv tmpTlv = new Tlv(this.getRawDerValue());
checkTag(tmpTlv.getTag());
this.booleanValue = Boolean.valueOf(tmpTlv.getValue()[0] == (byte) 0x00);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.Tlv in project jmulticard by ctt-gob-es.
the class OctectString method decodeValue.
@Override
protected void decodeValue() throws TlvException {
final Tlv tlv = new Tlv(this.getRawDerValue());
if (TAG_OCTECTSTRING != tlv.getTag()) {
throw new TlvException(// $NON-NLS-1$
"Se esperaba un TLV de tipo OctectString pero se ha encontrado uno de tipo " + HexUtils.hexify(new byte[] { tlv.getTag() }, false));
}
this.value = tlv.getValue();
}
Aggregations