use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.network.instances.network.instance.protocols.protocol.bgp.neighbors.neighbor.state.messages.Received in project controller by opendaylight.
the class MdsalLowLevelTestProvider method unregisterFlappingSingleton.
@Override
public Future<RpcResult<UnregisterFlappingSingletonOutput>> unregisterFlappingSingleton() {
LOG.debug("unregister-flapping-singleton received.");
if (flappingSingletonService == null) {
final RpcError rpcError = RpcResultBuilder.newError(ErrorType.APPLICATION, "missing-registration", "No flapping-singleton registration present.");
final RpcResult<UnregisterFlappingSingletonOutput> result = RpcResultBuilder.<UnregisterFlappingSingletonOutput>failed().withRpcError(rpcError).build();
return Futures.immediateFuture(result);
}
final long flapCount = flappingSingletonService.setInactive();
flappingSingletonService = null;
final UnregisterFlappingSingletonOutput output = new UnregisterFlappingSingletonOutputBuilder().setFlapCount(flapCount).build();
return Futures.immediateFuture(RpcResultBuilder.success(output).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.network.instances.network.instance.protocols.protocol.bgp.neighbors.neighbor.state.messages.Received in project bgpcep by opendaylight.
the class BmpRibInWriter method checkEndOfRib.
/**
* For each received Update message, the upd sync variable needs to be updated to true, for particular AFI/SAFI
* combination. Currently we only assume Unicast SAFI. From the Update message we have to extract the AFI. Each
* Update message can contain BGP Object with one type of AFI. If the object is BGP Link, BGP Node or a BGPPrefix
* the AFI is Linkstate. In case of BGPRoute, the AFI depends on the IP Address of the prefix.
*
* @param msg received Update message
*/
private boolean checkEndOfRib(final UpdateMessage msg) {
TablesKey type = new TablesKey(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class);
boolean isEOR = false;
if (msg.getNlri() == null && msg.getWithdrawnRoutes() == null) {
if (msg.getAttributes() != null) {
if (msg.getAttributes().getAugmentation(Attributes1.class) != null) {
final Attributes1 pa = msg.getAttributes().getAugmentation(Attributes1.class);
if (pa.getMpReachNlri() != null) {
type = new TablesKey(pa.getMpReachNlri().getAfi(), pa.getMpReachNlri().getSafi());
}
} else if (msg.getAttributes().getAugmentation(Attributes2.class) != null) {
final Attributes2 pa = msg.getAttributes().getAugmentation(Attributes2.class);
if (pa.getMpUnreachNlri() != null) {
type = new TablesKey(pa.getMpUnreachNlri().getAfi(), pa.getMpUnreachNlri().getSafi());
}
if (pa.getMpUnreachNlri().getWithdrawnRoutes() == null) {
// EOR message contains only MPUnreach attribute and no NLRI
isEOR = true;
}
}
} else {
// true for empty Update Message
isEOR = true;
}
}
if (isEOR) {
markTableUptodated(type);
LOG.debug("BMP Synchronization finished for table {} ", type);
}
return isEOR;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.network.instances.network.instance.protocols.protocol.bgp.neighbors.neighbor.state.messages.Received in project bgpcep by opendaylight.
the class AbstractReachabilityTopologyBuilder method removeObject.
@Override
protected final void removeObject(final ReadWriteTransaction trans, final InstanceIdentifier<T> id, final T value) {
if (value == null) {
LOG.error("Empty before-data received in delete data change notification for instance id {}", id);
return;
}
final NodeId ni = advertizingNode(getAttributes(value));
if (ni == null) {
return;
}
final NodeUsage present = this.nodes.get(ni);
Preconditions.checkState(present != null, "Removing prefix from non-existent node %s", present);
final PrefixKey pk = new PrefixKey(getPrefix(value));
trans.delete(LogicalDatastoreType.OPERATIONAL, present.attrId.child(Prefix.class, pk));
/*
* This is optimization magic: we are reading a list and we want to remove it once it
* hits zero. We may be in a transaction, so the read is costly, especially since we
* have just modified the list.
*
* Once we have performed the read, though, we can check the number of nodes, and reuse
* it for that number of removals. Note that since we do not track data and thus have
* no understanding about the difference between replace and add, we do not ever increase
* the life of this in createObject().
*/
present.useCount--;
if (present.useCount == 0) {
final IgpNodeAttributes attrs = read(trans, present.attrId);
if (attrs != null) {
present.useCount = attrs.getPrefix().size();
if (present.useCount == 0) {
trans.delete(LogicalDatastoreType.OPERATIONAL, nodeInstanceId(ni));
this.nodes.remove(ni);
}
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.network.instances.network.instance.protocols.protocol.bgp.neighbors.neighbor.state.messages.Received in project bgpcep by opendaylight.
the class LinkstateTopologyBuilder method removeObject.
@Override
protected void removeObject(final ReadWriteTransaction trans, final InstanceIdentifier<LinkstateRoute> id, final LinkstateRoute value) {
if (value == null) {
LOG.error("Empty before-data received in delete data change notification for instance id {}", id);
return;
}
final UriBuilder base = new UriBuilder(value);
final ObjectType t = value.getObjectType();
if (t instanceof LinkCase) {
removeLink(trans, base, (LinkCase) t);
} else if (t instanceof NodeCase) {
removeNode(trans, base, (NodeCase) t);
} else if (t instanceof PrefixCase) {
removePrefix(trans, base, (PrefixCase) t);
} else {
LOG.debug(UNHANDLED_OBJECT_CLASS, t.getImplementedInterface());
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.network.instances.network.instance.protocols.protocol.bgp.neighbors.neighbor.state.messages.Received in project bgpcep by opendaylight.
the class NeighborStateCliUtils method printMessagesState.
private static void printMessagesState(final State neighborState, final ShellTable table) {
final BgpNeighborStateAugmentation state = neighborState.getAugmentation(BgpNeighborStateAugmentation.class);
if (state == null) {
return;
}
addHeader(table, "Messages state");
final Messages messages = state.getMessages();
table.addRow().addContent("Messages Received", "");
final Received received = messages.getReceived();
table.addRow().addContent("NOTIFICATION", received.getNOTIFICATION());
table.addRow().addContent("UPDATE", received.getUPDATE());
final Sent sent = messages.getSent();
table.addRow().addContent("Messages Sent", "");
table.addRow().addContent("NOTIFICATION", sent.getNOTIFICATION());
table.addRow().addContent("UPDATE", sent.getUPDATE());
}
Aggregations