Search in sources :

Example 1 with Neighbors

use of org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.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(Neighbors.class, new NeighborsKey(nbrAddr));
    InstanceIdentifier<Neighbors> iid = iib.build();
    delete(iid);
}
Also used : Neighbors(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Neighbors) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) 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.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.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(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.NeighborsBuilder) Neighbors(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Neighbors) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) 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.NeighborsKey) Ipv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)

Example 3 with Neighbors

use of org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.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.getNeighbors();
    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.Neighbors) Bgp(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.Bgp)

Example 4 with Neighbors

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

the class ConfigureBgpCli method stopBgp.

private void stopBgp() {
    Bgp conf = bgpManager.getConfig();
    if (conf == null) {
        return;
    }
    List<Neighbors> nbrs = conf.getNeighbors();
    if (nbrs != null && nbrs.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.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.Neighbors in project netvirt by opendaylight.

the class BgpAlarms method init.

public void init() {
    alarmAgent.registerMbean();
    if (bgpMgr.getConfig() != null) {
        List<Neighbors> nbrs = bgpMgr.getConfig().getNeighbors();
        if (nbrs != null) {
            for (Neighbors nbr : nbrs) {
                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.Neighbors)

Aggregations

Neighbors (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Neighbors)11 Bgp (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.Bgp)7 TException (org.apache.thrift.TException)2 BgpRouterException (org.opendaylight.netvirt.bgpmanager.thrift.client.BgpRouterException)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 Global (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.Global)2 Neighbors (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.Neighbors)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 Logging (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Logging)2 Multipath (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Multipath)2 NeighborsKey (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.NeighborsKey)2 Networks (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Networks)2 VrfMaxpath (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.VrfMaxpath)2 Vrfs (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Vrfs)2 AddressFamilies (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighbors.AddressFamilies)2 EbgpMultihop (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighbors.EbgpMultihop)2 UpdateSource (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.neighbors.UpdateSource)2 AddressFamiliesVrf (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.vrfs.AddressFamiliesVrf)2