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);
}
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());
}
}
}
}
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);
}
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();
}
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();
}
Aggregations