use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.stateful.capability.tlv.Stateful in project bgpcep by opendaylight.
the class CInitiated00StatefulCapabilityTlvParser method serializeFlags.
@Override
protected BitArray serializeFlags(final Stateful sct) {
final BitArray flags = new BitArray(FLAGS_F_LENGTH);
final Stateful1 sfi = sct.getAugmentation(Stateful1.class);
if (sfi != null) {
flags.set(I_FLAG_OFFSET, sfi.isInitiation());
}
flags.set(U_FLAG_OFFSET, sct.isLspUpdateCapability());
return flags;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.stateful.capability.tlv.Stateful 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.pcep.ietf.stateful.rev171025.stateful.capability.tlv.Stateful in project bgpcep by opendaylight.
the class Stateful07TopologySessionListener method setStatefulCapabilities.
private synchronized void setStatefulCapabilities(final Stateful stateful) {
this.statefulCapability.set(true);
if (stateful.isLspUpdateCapability() != null) {
this.lspUpdateCapability.set(stateful.isLspUpdateCapability());
}
final Stateful1 stateful1 = stateful.getAugmentation(Stateful1.class);
if (stateful1 != null && stateful1.isInitiation() != null) {
this.initiationCapability.set(stateful1.isInitiation());
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.stateful.capability.tlv.Stateful in project bgpcep by opendaylight.
the class PcepStateUtils method showCapabilities.
private static void showCapabilities(final ShellTable table, final PeerCapabilities capa) {
if (capa == null) {
return;
}
final StatefulCapabilitiesStatsAug stateFulCapa = capa.getAugmentation(StatefulCapabilitiesStatsAug.class);
if (stateFulCapa != null) {
addHeader(table, "Stateful Capabilities");
table.addRow().addContent("Stateful", stateFulCapa.isStateful());
table.addRow().addContent("Active", stateFulCapa.isActive());
table.addRow().addContent("Instantiation", stateFulCapa.isInstantiation());
}
}
Aggregations