protected synchronized void remove(InstanceIdentifier<Neighbors> iid, Neighbors val) { LOG.debug("received remove Neighbors config val {}", val.getAddress().getValue()); synchronized(BgpConfigurationManager.this) { BgpRouter br = getClient(yangObj); if (br == null) { return; } String peerIp = val.getAddress().getValue(); try { //itmProvider.deleteTunnelsToDCGW(new IpAddress(val.getAddress().getValue().toCharArray())); br.delNeighbor(peerIp); } catch (Exception e) { LOG.error(yangObj+" Delete received exception: \""+e+"\"; " +delWarn); } } }
public NeighborsBuilder(Neighbors base) { if (base.getKey() == null) { this._key = new NeighborsKey( base.getAddress() ); this._address = base.getAddress(); } else { this._key = base.getKey(); this._address = _key.getAddress(); } this._addressFamilies = base.getAddressFamilies(); this._ebgpMultihop = base.getEbgpMultihop(); this._remoteAs = base.getRemoteAs(); this._updateSource = base.getUpdateSource(); if (base instanceof NeighborsImpl) { NeighborsImpl impl = (NeighborsImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Neighbors> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.bgp.Neighbors>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
if (!Objects.equals(_address, other.getAddress())) { return false;
@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(); }
static private void replayNbrConfig(List<Neighbors> n, BgpRouter br) { for (Neighbors nbr : n) { try { br.addNeighbor(nbr.getAddress().getValue(), nbr.getRemoteAs().intValue());
protected synchronized void add(InstanceIdentifier<Neighbors> iid, Neighbors val) { LOG.debug("received add Neighbors config val {}", val.getAddress().getValue()); synchronized(BgpConfigurationManager.this) { BgpRouter br = getClient(yangObj); if (br == null) { return; } String peerIp = val.getAddress().getValue(); int as = val.getRemoteAs().intValue(); try { //itmProvider.buildTunnelsToDCGW(new IpAddress(peerIp.toCharArray())); br.addNeighbor(peerIp, as); } catch (Exception e) { LOG.error(yangObj+"Add received exception: \""+e+"\"; " +addWarn); } } }
static private void replayNbrConfig(List<Neighbors> n, BgpRouter br) { for (Neighbors nbr : n) { try { br.addNeighbor(nbr.getAddress().getValue(), nbr.getRemoteAs().intValue());
protected synchronized void remove(InstanceIdentifier<Neighbors> iid, Neighbors val) { if (ignoreClusterDcnEventForFollower()) { return; } LOG.debug("received remove Neighbors config val {}", val.getAddress().getValue()); synchronized (BgpConfigurationManager.this) { BgpRouter br = getClient(yangObj); if (br == null) { return; } String peerIp = val.getAddress().getValue(); try { //itmProvider.deleteTunnelsToDCGW(new IpAddress(val.getAddress().getValue().toCharArray())); br.delNeighbor(peerIp); } catch (Exception e) { LOG.error(yangObj + " Delete received exception: \"" + e + "\"; " + delWarn); } } }
ps.printf("\nNeighbors\n"); for (Neighbors nbr : n) { ps.printf("\t%s\n\t\t%-16s %d\n", nbr.getAddress().getValue(), ASSTR, nbr.getRemoteAs().intValue()); EbgpMultihop en = nbr.getEbgpMultihop();
@Override public String getDCGwIP() { Bgp conf = getConfig(); if (conf == null) { return null; } List<Neighbors> nbrs = conf.getNeighbors(); if (nbrs == null) { return null; } return nbrs.get(0).getAddress().getValue(); }
ps.printf("\nNeighbors\n"); for (Neighbors nbr : n) { ps.printf("\t%s\n\t\t%-16s %d\n", nbr.getAddress().getValue(), ASSTR, nbr.getRemoteAs().intValue()); EbgpMultihop en = nbr.getEbgpMultihop();
for (Neighbors nbr : nbrs) { alarmToRaise = true; if ((nbrStatusMap != null) && nbrStatusMap.containsKey(nbr.getAddress().getValue())) { nbrshipStatus = nbrStatusMap.get(nbr.getAddress().getValue()); logger.trace("nbr {} status {}", nbr.getAddress().getValue(), nbrshipStatus); try { if ((!nbrsRaisedAlarmStatusMap.containsKey(nbr.getAddress().getValue())) || (nbrsRaisedAlarmStatusMap.get(nbr.getAddress().getValue()) != BgpAlarmStatus.RAISED)) { logger.trace("alarm raised for {}.", nbr.getAddress().getValue()); raiseBgpNbrDownAlarm(nbr.getAddress().getValue()); nbrsRaisedAlarmStatusMap.put(nbr.getAddress().getValue(), BgpAlarmStatus.RAISED); } else { logger.trace("alarm raised already for {}", nbr.getAddress().getValue()); if ((!nbrsRaisedAlarmStatusMap.containsKey(nbr.getAddress().getValue())) || (nbrsRaisedAlarmStatusMap.get(nbr.getAddress().getValue()) != BgpAlarmStatus.CLEARED)) { clearBgpNbrDownAlarm(nbr.getAddress().getValue()); logger.trace("alarm cleared for {}", nbr.getAddress().getValue()); nbrsRaisedAlarmStatusMap.put(nbr.getAddress().getValue(), BgpAlarmStatus.CLEARED); } else { logger.trace("alarm cleared already for {}", nbr.getAddress().getValue());
protected synchronized void add(InstanceIdentifier<Neighbors> iid, Neighbors val) { if (ignoreClusterDcnEventForFollower()) { return; } LOG.debug("received add Neighbors config val {}", val.getAddress().getValue()); synchronized (BgpConfigurationManager.this) { BgpRouter br = getClient(yangObj); if (br == null) { return; } String peerIp = val.getAddress().getValue(); int as = val.getRemoteAs().intValue(); try { //itmProvider.buildTunnelsToDCGW(new IpAddress(peerIp.toCharArray())); br.addNeighbor(peerIp, as); } catch (Exception e) { LOG.error(yangObj + "Add received exception: \"" + e + "\"; " + addWarn); } } }
public BgpAlarms(BgpConfigurationManager bgpManager) { bgpMgr = bgpManager; alarmAgent.registerMbean(); if (bgpMgr != null && bgpMgr.getConfig() != null) { List<Neighbors> nbrs = bgpMgr.getConfig().getNeighbors(); if (nbrs != null) { for (Neighbors nbr: nbrs) { logger.trace( "Clearing Neighbor DOWN alarm at the startup for Neighbor {}", nbr.getAddress().getValue()); clearBgpNbrDownAlarm(nbr.getAddress().getValue()); neighborsRaisedAlarmStatusMap.put( nbr.getAddress().getValue(), BgpAlarmStatus.CLEARED); } } } }
public long getAsNumber(String nbrIp) { Bgp conf = bgpManager.getConfig(); if (conf == null) { return -1; } List<Neighbors> nbrs = conf.getNeighbors(); if (nbrs == null) { return -1; } for (Neighbors nbr : nbrs) { if (nbrIp.equals(nbr.getAddress().getValue())) { return nbr.getRemoteAs().longValue(); } } return -1; }
public long getAsNumber(String nbrIp) { Bgp conf = bgpManager.getConfig(); if (conf == null) { return -1; } List<Neighbors> nbrs = conf.getNeighbors(); if (nbrs == null) { return -1; } for (Neighbors nbr : nbrs) { if (nbrIp.equals(nbr.getAddress().getValue())) { return nbr.getRemoteAs().longValue(); } } return -1; }