Search in sources :

Example 1 with Neighbors

use of org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.Neighbors in project netvirt by opendaylight.

the class BgpConfigurationManager method delNeighbor.

public void delNeighbor(String nbrIp) {
    Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
    InstanceIdentifier.InstanceIdentifierBuilder<Neighbors> iib = InstanceIdentifier.builder(Bgp.class).child(NeighborsContainer.class).child(Neighbors.class, new NeighborsKey(nbrAddr));
    InstanceIdentifier<Neighbors> iid = iib.build();
    delete(iid);
}
Also used : NeighborsContainer(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.NeighborsContainer) Neighbors(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.Neighbors) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) NeighborsKey(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.NeighborsKey) Ipv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)

Example 2 with Neighbors

use of org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.Neighbors in project netvirt by opendaylight.

the class BgpAlarms method init.

public void init() {
    alarmAgent.registerMbean();
    Bgp bgp = bgpMgr.getConfig();
    if (bgp != null && bgp.getNeighborsContainer() != null) {
        Map<NeighborsKey, Neighbors> keyNeighborsMap = bgp.getNeighborsContainer().getNeighbors();
        if (keyNeighborsMap != null) {
            for (Neighbors nbr : keyNeighborsMap.values()) {
                LOG.trace("Clearing Neighbor DOWN alarm at the startup for Neighbor {}", nbr.getAddress().getValue());
                clearBgpNbrDownAlarm(nbr.getAddress().getValue());
            }
        }
    }
}
Also used : Neighbors(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.Neighbors) Bgp(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.Bgp) NeighborsKey(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.NeighborsKey)

Example 3 with Neighbors

use of org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.Neighbors in project netvirt by opendaylight.

the class BgpConfigurationManager method addNeighbor.

public void addNeighbor(String nbrIp, long remoteAs, @Nullable final TcpMd5SignaturePasswordType md5Secret) {
    Ipv4Address nbrAddr = new Ipv4Address(nbrIp);
    InstanceIdentifier.InstanceIdentifierBuilder<Neighbors> iib = InstanceIdentifier.builder(Bgp.class).child(NeighborsContainer.class).child(Neighbors.class, new NeighborsKey(nbrAddr));
    InstanceIdentifier<Neighbors> iid = iib.build();
    TcpSecurityOption tcpSecOption = null;
    if (md5Secret != null) {
        tcpSecOption = new TcpMd5SignatureOptionBuilder().setTcpMd5SignaturePassword(md5Secret).build();
    }
    // else let tcpSecOption be null
    Neighbors dto = new NeighborsBuilder().setAddress(nbrAddr).setRemoteAs(remoteAs).setTcpSecurityOption(tcpSecOption).build();
    update(iid, dto);
}
Also used : TcpSecurityOption(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.tcp.security.option.grouping.TcpSecurityOption) TcpMd5SignatureOptionBuilder(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.tcp.security.option.grouping.tcp.security.option.TcpMd5SignatureOptionBuilder) NeighborsBuilder(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.NeighborsBuilder) NeighborsContainer(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.NeighborsContainer) Neighbors(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.Neighbors) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) NeighborsKey(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.NeighborsKey) Ipv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)

Example 4 with Neighbors

use of org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.Neighbors in project netvirt by opendaylight.

the class BgpManager method getDCGwIP.

@Override
public String getDCGwIP() {
    Bgp conf = bcm.getConfig();
    if (conf == null) {
        return null;
    }
    List<Neighbors> nbrs = conf.getNeighborsContainer() == null ? null : new ArrayList<Neighbors>(conf.getNeighborsContainer().nonnullNeighbors().values());
    if (nbrs == null) {
        return null;
    }
    return nbrs.get(0).getAddress().getValue();
}
Also used : Neighbors(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.Neighbors) Bgp(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.Bgp)

Example 5 with Neighbors

use of org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.Neighbors in project netvirt by opendaylight.

the class ConfigureBgpCli method stopBgp.

private void stopBgp() {
    Bgp conf = bgpManager.getConfig();
    if (conf == null) {
        return;
    }
    Map<NeighborsKey, Neighbors> keyNeighborsMap = conf.getNeighborsContainer() == null ? null : conf.getNeighborsContainer().getNeighbors();
    if (keyNeighborsMap != null && keyNeighborsMap.size() > 0) {
        session.getConsole().println("error: all BGP congiguration must be deleted before stopping the router instance");
        return;
    }
    bgpManager.stopBgp();
}
Also used : Neighbors(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.Neighbors) Bgp(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.Bgp) NeighborsKey(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.NeighborsKey)

Aggregations

Neighbors (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.Neighbors)12 NeighborsKey (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighborscontainer.NeighborsKey)9 Bgp (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.Bgp)7 TException (org.apache.thrift.TException)5 BgpRouterException (org.opendaylight.netvirt.bgpmanager.thrift.client.BgpRouterException)5 TApplicationException (org.apache.thrift.TApplicationException)3 Global (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.Global)3 Neighbors (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.Neighbors)3 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 SocketException (java.net.SocketException)2 ExecutionException (java.util.concurrent.ExecutionException)2 TimeoutException (java.util.concurrent.TimeoutException)2 TransactionCommitFailedException (org.opendaylight.mdsal.common.api.TransactionCommitFailedException)2 CandidateAlreadyRegisteredException (org.opendaylight.mdsal.eos.common.api.CandidateAlreadyRegisteredException)2 BgpRouter (org.opendaylight.netvirt.bgpmanager.thrift.client.BgpRouter)2 org.opendaylight.netvirt.bgpmanager.thrift.gen.af_afi (org.opendaylight.netvirt.bgpmanager.thrift.gen.af_afi)2 org.opendaylight.netvirt.bgpmanager.thrift.gen.af_safi (org.opendaylight.netvirt.bgpmanager.thrift.gen.af_safi)2 AsId (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.AsId)2 GracefulRestart (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.GracefulRestart)2