use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.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);
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.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);
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.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();
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.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();
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.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());
}
}
}
}
Aggregations