Search in sources :

Example 66 with Received

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());
}
Also used : RpcError(org.opendaylight.yangtools.yang.common.RpcError) UnregisterFlappingSingletonOutputBuilder(org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.control.rev170215.UnregisterFlappingSingletonOutputBuilder) UnregisterFlappingSingletonOutput(org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.control.rev170215.UnregisterFlappingSingletonOutput)

Example 67 with Received

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;
}
Also used : TablesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.TablesKey) Attributes2(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.Attributes2) Attributes1(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.Attributes1)

Example 68 with Received

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);
            }
        }
    }
}
Also used : PrefixKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.igp.node.attributes.igp.node.attributes.PrefixKey) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) Prefix(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.igp.node.attributes.igp.node.attributes.Prefix) IpPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix) IgpNodeAttributes(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.igp.node.attributes.IgpNodeAttributes)

Example 69 with Received

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());
    }
}
Also used : ObjectType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.ObjectType) NodeCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.NodeCase) PrefixCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.PrefixCase) LinkCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.LinkCase)

Example 70 with Received

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());
}
Also used : Messages(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(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) BgpNeighborStateAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.BgpNeighborStateAugmentation) Sent(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.Sent)

Aggregations

BigInteger (java.math.BigInteger)26 ArrayList (java.util.ArrayList)20 ExecutionException (java.util.concurrent.ExecutionException)16 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)13 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)13 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)10 List (java.util.List)10 ReadFailedException (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)10 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)9 UnknownHostException (java.net.UnknownHostException)8 VpnInterface (org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.VpnInterface)8 Network (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.Network)8 Optional (com.google.common.base.Optional)7 Test (org.junit.Test)7 PacketException (org.opendaylight.openflowplugin.libraries.liblldp.PacketException)7 Collections (java.util.Collections)6 TunnelTypeVxlan (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan)6 FutureCallback (com.google.common.util.concurrent.FutureCallback)5 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action)5 NodeConnectorRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef)5