use of org.onosproject.bgpio.protocol.linkstate.BgpPrefixIPv4LSNlriVer4 in project onos by opennetworkinglab.
the class BgpLocalRibImpl method localRibUpdatePrefix.
/**
* Update localRIB prefix based on available peer adjacency RIB.
*
* @param o instance of adjacency-in/VPN adjacency-in
* @throws BgpParseException BGP parse exception
*/
public void localRibUpdatePrefix(Object o) throws BgpParseException {
if (o instanceof AdjRibIn) {
AdjRibIn adjRib = (AdjRibIn) o;
log.debug("Update local RIB prefix.");
Set<BgpPrefixLSIdentifier> prefixKeys = adjRib.prefixTree().keySet();
for (BgpPrefixLSIdentifier key : prefixKeys) {
PathAttrNlriDetails pathAttrNlri = adjRib.prefixTree().get(key);
BgpPrefixIPv4LSNlriVer4 prefixNlri = new BgpPrefixIPv4LSNlriVer4(pathAttrNlri.identifier(), pathAttrNlri.protocolID().getType(), key, null, false);
decisionProcess(prefixNlri);
}
}
if (o instanceof VpnAdjRibIn) {
VpnAdjRibIn vpnAdjRib = (VpnAdjRibIn) o;
log.debug("Update local RIB VPN prefix.");
Set<RouteDistinguisher> prefixKeysVpn = vpnAdjRib.vpnPrefixTree().keySet();
Map<BgpPrefixLSIdentifier, PathAttrNlriDetails> prefix;
for (RouteDistinguisher keyVpnPrefix : prefixKeysVpn) {
prefix = vpnAdjRib.vpnPrefixTree().get(keyVpnPrefix);
Set<BgpPrefixLSIdentifier> vpnPrefixKeys = prefix.keySet();
for (BgpPrefixLSIdentifier key : vpnPrefixKeys) {
PathAttrNlriDetails pathAttrNlri = vpnAdjRib.prefixTree().get(key);
BgpPrefixIPv4LSNlriVer4 prefixNlri = new BgpPrefixIPv4LSNlriVer4(pathAttrNlri.identifier(), pathAttrNlri.protocolID().getType(), key, keyVpnPrefix, true);
decisionProcess(prefixNlri, keyVpnPrefix);
}
}
}
}
Aggregations