Search in sources :

Example 6 with BgpPrefixIPv4LSNlriVer4

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);
            }
        }
    }
}
Also used : BgpPrefixLSIdentifier(org.onosproject.bgpio.protocol.linkstate.BgpPrefixLSIdentifier) BgpPrefixIPv4LSNlriVer4(org.onosproject.bgpio.protocol.linkstate.BgpPrefixIPv4LSNlriVer4) PathAttrNlriDetails(org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails) RouteDistinguisher(org.onosproject.bgpio.types.RouteDistinguisher)

Aggregations

BgpPrefixIPv4LSNlriVer4 (org.onosproject.bgpio.protocol.linkstate.BgpPrefixIPv4LSNlriVer4)6 BgpLinkLsNlriVer4 (org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4)3 BgpNodeLSNlriVer4 (org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4)3 BgpPrefixLSIdentifier (org.onosproject.bgpio.protocol.linkstate.BgpPrefixLSIdentifier)3 BgpPrefixListener (org.onosproject.bgp.controller.BgpPrefixListener)2 BgpLSNlri (org.onosproject.bgpio.protocol.BgpLSNlri)2 PathAttrNlriDetails (org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails)2 PathAttrNlriDetailsLocalRib (org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetailsLocalRib)2 ChannelBuffer (org.jboss.netty.buffer.ChannelBuffer)1 Test (org.junit.Test)1 BgpId (org.onosproject.bgp.controller.BgpId)1 BgpLinkListener (org.onosproject.bgp.controller.BgpLinkListener)1 BgpNodeListener (org.onosproject.bgp.controller.BgpNodeListener)1 BgpSessionInfo (org.onosproject.bgp.controller.BgpSessionInfo)1 BgpLinkLSIdentifier (org.onosproject.bgpio.protocol.linkstate.BgpLinkLSIdentifier)1 BgpNodeLSIdentifier (org.onosproject.bgpio.protocol.linkstate.BgpNodeLSIdentifier)1 BgpHeader (org.onosproject.bgpio.types.BgpHeader)1 BgpValueType (org.onosproject.bgpio.types.BgpValueType)1 IPReachabilityInformationTlv (org.onosproject.bgpio.types.IPReachabilityInformationTlv)1 LinkStateAttributes (org.onosproject.bgpio.types.LinkStateAttributes)1