Priyanka B
Committed by Gerrit Code Review

[Goldeneye] [ONOS-4161] BGP L3 Topology

Change-Id: I81ae4e88f6ab75202b98ed03cbe1597d0f6ddd1e
......@@ -128,4 +128,25 @@ public interface BgpController {
* @return node listener
*/
Set<BgpNodeListener> listener();
/**
* Register a listener for BGP message events.
*
* @param listener the listener to notify
*/
void addLinkListener(BgpLinkListener listener);
/**
* Unregister a listener.
*
* @param listener the listener to unregister
*/
void removeLinkListener(BgpLinkListener listener);
/**
* Return BGP link listener.
*
* @return link listener
*/
Set<BgpLinkListener> linkListener();
}
......
......@@ -20,12 +20,9 @@ import java.net.URISyntaxException;
import java.util.List;
import java.util.ListIterator;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4;
import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSIdentifier;
import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4;
import org.onosproject.bgpio.protocol.linkstate.NodeDescriptors;
import org.onosproject.bgpio.types.AreaIDTlv;
import org.onosproject.bgpio.types.AutonomousSystemTlv;
import org.onosproject.bgpio.types.BgpLSIdentifierTlv;
import org.onosproject.bgpio.types.BgpValueType;
......@@ -49,9 +46,9 @@ public final class BgpDpid {
public static final int NODE_DESCRIPTOR_REMOTE = 2;
/**
* Initialize bgp id to generate URI.
* Initialize BGP id to generate URI.
*
* @param linkNlri node Nlri.
* @param linkNlri node NLRI.
* @param nodeDescriptorType node descriptor type, local/remote
*/
public BgpDpid(final BgpLinkLsNlriVer4 linkNlri, int nodeDescriptorType) {
......@@ -61,26 +58,13 @@ public final class BgpDpid {
this.stringBuilder.append("RD=").append(linkNlri.getRouteDistinguisher()
.getRouteDistinguisher()).append(":");
}
try {
if ((linkNlri.getProtocolId() == BgpNodeLSNlriVer4.ProtocolType.ISIS_LEVEL_ONE)
|| (linkNlri.getProtocolId() == BgpNodeLSNlriVer4.ProtocolType.ISIS_LEVEL_TWO)) {
this.stringBuilder.append("PROTO=").append("ISIS").append(":ID=")
.append(linkNlri.getIdentifier());
} else {
this.stringBuilder.append("PROTO=").append(linkNlri.getProtocolId()).append(":ID=")
.append(linkNlri.getIdentifier());
}
this.stringBuilder.append(":ROUTINGUNIVERSE=").append(((BgpLinkLsNlriVer4) linkNlri).getIdentifier());
if (nodeDescriptorType == NODE_DESCRIPTOR_LOCAL) {
add(linkNlri.localNodeDescriptors());
} else if (nodeDescriptorType == NODE_DESCRIPTOR_REMOTE) {
add(linkNlri.remoteNodeDescriptors());
}
} catch (BgpParseException e) {
log.info("Exception BgpId string: " + e.toString());
}
}
/*
......@@ -96,72 +80,52 @@ public final class BgpDpid {
}
/**
* Initialize bgp id to generate URI.
* Initialize BGP id to generate URI.
*
* @param nodeNlri node Nlri.
* @param nlri node NLRI.
*/
public BgpDpid(final BgpNodeLSNlriVer4 nodeNlri) {
public BgpDpid(final BgpNodeLSNlriVer4 nlri) {
this.stringBuilder = new StringBuilder("");
if (nodeNlri.getRouteDistinguisher() != null) {
this.stringBuilder.append("RD=").append(nodeNlri.getRouteDistinguisher()
.getRouteDistinguisher()).append(":");
if (((BgpNodeLSNlriVer4) nlri).getRouteDistinguisher() != null) {
this.stringBuilder.append("RD=")
.append(((BgpNodeLSNlriVer4) nlri).getRouteDistinguisher().getRouteDistinguisher()).append(":");
}
try {
if ((nodeNlri.getProtocolId() == BgpNodeLSNlriVer4.ProtocolType.ISIS_LEVEL_ONE)
|| (nodeNlri.getProtocolId() == BgpNodeLSNlriVer4.ProtocolType.ISIS_LEVEL_TWO)) {
this.stringBuilder.append("PROTO=").append("ISIS").append(":ID=")
.append(nodeNlri.getIdentifier());
} else {
this.stringBuilder.append("PROTO=").append(nodeNlri.getProtocolId()).append(":ID=")
.append(nodeNlri.getIdentifier());
this.stringBuilder.append(":ROUTINGUNIVERSE=").append(((BgpNodeLSNlriVer4) nlri).getIdentifier());
add(((BgpNodeLSNlriVer4) nlri).getLocalNodeDescriptors().getNodedescriptors());
log.info("BgpDpid :: add");
}
add(nodeNlri.getLocalNodeDescriptors());
} catch (BgpParseException e) {
log.info("Exception node string: " + e.toString());
}
}
BgpDpid add(final Object value) {
NodeDescriptors nodeDescriptors = null;
if (value instanceof BgpNodeLSIdentifier) {
BgpNodeLSIdentifier nodeLsIdentifier = (BgpNodeLSIdentifier) value;
nodeDescriptors = nodeLsIdentifier.getNodedescriptors();
} else if (value instanceof NodeDescriptors) {
nodeDescriptors = (NodeDescriptors) value;
}
if (nodeDescriptors != null) {
List<BgpValueType> subTlvs = nodeDescriptors.getSubTlvs();
/**
* Obtains instance of this class by appending stringBuilder with node descriptor value.
*
* @param value node descriptor
* @return instance of this class
*/
public BgpDpid add(final NodeDescriptors value) {
log.info("BgpDpid :: add function");
if (value != null) {
List<BgpValueType> subTlvs = value.getSubTlvs();
ListIterator<BgpValueType> listIterator = subTlvs.listIterator();
while (listIterator.hasNext()) {
BgpValueType tlv = listIterator.next();
if (tlv.getType() == AutonomousSystemTlv.TYPE) {
AutonomousSystemTlv autonomousSystem = (AutonomousSystemTlv) tlv;
this.stringBuilder.append(":AS=").append(autonomousSystem.getAsNum());
this.stringBuilder.append(":ASN=").append(((AutonomousSystemTlv) tlv).getAsNum());
} else if (tlv.getType() == BgpLSIdentifierTlv.TYPE) {
BgpLSIdentifierTlv lsIdentifierTlv = (BgpLSIdentifierTlv) tlv;
this.stringBuilder.append(":LSID=").append(lsIdentifierTlv.getBgpLsIdentifier());
} else if (tlv.getType() == AreaIDTlv.TYPE) {
AreaIDTlv areaIdTlv = (AreaIDTlv) tlv;
this.stringBuilder.append(":AREA=").append(areaIdTlv.getAreaID());
this.stringBuilder.append(":DOMAINID=").append(((BgpLSIdentifierTlv) tlv).getBgpLsIdentifier());
} else if (tlv.getType() == NodeDescriptors.IGP_ROUTERID_TYPE) {
if (tlv instanceof IsIsNonPseudonode) {
IsIsNonPseudonode isisNonPseudonode = (IsIsNonPseudonode) tlv;
this.stringBuilder.append(":ISOID=").append(isoNodeIdString(isisNonPseudonode.getIsoNodeId()));
this.stringBuilder.append(":ISOID=").append(
isoNodeIdString(((IsIsNonPseudonode) tlv).getIsoNodeId()));
} else if (tlv instanceof IsIsPseudonode) {
IsIsPseudonode isisPseudonode = (IsIsPseudonode) tlv;
this.stringBuilder.append(":ISOID=").append(isoNodeIdString(isisPseudonode.getIsoNodeId()));
IsIsPseudonode isisPseudonode = ((IsIsPseudonode) tlv);
this.stringBuilder.append(":ISOID=").append(
isoNodeIdString(((IsIsPseudonode) tlv).getIsoNodeId()));
this.stringBuilder.append(":PSN=").append(isisPseudonode.getPsnIdentifier());
} else if (tlv instanceof OspfNonPseudonode) {
OspfNonPseudonode ospfNonPseudonode = (OspfNonPseudonode) tlv;
this.stringBuilder.append(":RID=").append(ospfNonPseudonode.getrouterID());
this.stringBuilder.append(":RID=").append(((OspfNonPseudonode) tlv).getrouterID());
} else if (tlv instanceof OspfPseudonode) {
OspfPseudonode ospfPseudonode = (OspfPseudonode) tlv;
this.stringBuilder.append(":RID=").append(ospfPseudonode.getrouterID());
this.stringBuilder.append(":RID=").append(((OspfPseudonode) tlv).getrouterID());
}
}
}
......
......@@ -12,24 +12,29 @@
*/
package org.onosproject.bgp.controller;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4;
import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails;
/**
* Allows for providers interested in Link events to be notified.
* Allows for providers interested in link events to be notified.
*/
public interface BgpLinkListener {
/**
* Notify that got a packet of link from network and need do processing.
* Notify that got a packet of link from network and adds link.
*
* @param linkNlri bgp link
* @param linkNlri BGP link NLRI
* @param details path attributes and NLRI information
* @throws BgpParseException BGP parse exception
*/
void addLink(BgpLinkLsNlriVer4 linkNlri);
void addLink(BgpLinkLsNlriVer4 linkNlri, PathAttrNlriDetails details) throws BgpParseException;
/**
* Notify that got a packet of link from network and need do processing.
* Notify that got a packet of link from network and remove link.
*
* @param linkNlri bgp link
* @param linkNlri BGP link NLRI
* @throws BgpParseException BGP parse exception
*/
void deleteLink(BgpLinkLsNlriVer4 linkNlri);
void deleteLink(BgpLinkLsNlriVer4 linkNlri) throws BgpParseException;
}
......
......@@ -13,6 +13,7 @@
package org.onosproject.bgp.controller;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.protocol.BgpLSNlri;
import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails;
import org.onosproject.bgpio.types.RouteDistinguisher;
......@@ -27,16 +28,18 @@ public interface BgpLocalRib {
*
* @param sessionInfo session info
* @param nlri network layer reach info
* @param details nlri details
* @param details path attributes and NLRI information
* @throws BgpParseException while adding NLRI to local rib
*/
void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details);
void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details) throws BgpParseException;
/**
* Removes NLRI identifier if it exists.
*
* @param nlri info
* @throws BgpParseException while deleting NLRI from local rib
*/
void delete(BgpLSNlri nlri);
void delete(BgpLSNlri nlri) throws BgpParseException;
/**
* Update NLRI identifier mapped with route distinguisher if it exists in tree otherwise add NLRI infomation mapped
......@@ -46,15 +49,17 @@ public interface BgpLocalRib {
* @param nlri info
* @param details has pathattribute, protocol id and identifier
* @param routeDistinguisher unique for each VPN
* @throws BgpParseException while adding NLRI updation
*/
void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details,
RouteDistinguisher routeDistinguisher);
RouteDistinguisher routeDistinguisher) throws BgpParseException;
/**
* Removes VPN NLRI identifier mapped to route distinguisher if it exists.
*
* @param nlri info
* @param routeDistinguisher unique for each VPN
* @throws BgpParseException while deleting NLRI from local rib
*/
void delete(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher);
void delete(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher) throws BgpParseException;
}
......
......@@ -13,6 +13,7 @@
package org.onosproject.bgp.controller;
import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4;
import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails;
/**
* Allows for providers interested in node events to be notified.
......@@ -22,14 +23,15 @@ public interface BgpNodeListener {
/**
* Notifies that the node was added.
*
* @param nodeNlri node rechability info
* @param nodeNlri node reachability info
* @param details attributes and nlri details
*/
void addNode(BgpNodeLSNlriVer4 nodeNlri);
void addNode(BgpNodeLSNlriVer4 nodeNlri, PathAttrNlriDetails details);
/**
* Notifies that the node was removed.
*
* @param nodeNlri node rechability info
* @param nodeNlri node reachability info
*/
void deleteNode(BgpNodeLSNlriVer4 nodeNlri);
}
......
......@@ -260,6 +260,14 @@ public class NodeDescriptors {
log.debug("NodeDescriptor compare subtlv's");
for (BgpValueType tlv : ((NodeDescriptors) o).subTlvs) {
if (tlv.getType() == tlv1.getType()) {
if (tlv.getType() == IGP_ROUTERID_TYPE) {
if ((tlv1 instanceof IsIsNonPseudonode && tlv instanceof IsIsPseudonode)
|| (tlv1 instanceof IsIsPseudonode && tlv instanceof IsIsNonPseudonode)
|| (tlv1 instanceof OspfNonPseudonode && tlv instanceof OspfPseudonode)
|| (tlv1 instanceof OspfPseudonode && tlv instanceof OspfNonPseudonode)) {
continue;
}
}
int result = subTlvs.get(subTlvs.indexOf(tlv1)).compareTo(
((NodeDescriptors) o).subTlvs.get(((NodeDescriptors) o).subTlvs.indexOf(tlv)));
if (result != 0) {
......
......@@ -23,6 +23,7 @@ import org.apache.felix.scr.annotations.Service;
import org.onosproject.bgp.controller.BgpCfg;
import org.onosproject.bgp.controller.BgpController;
import org.onosproject.bgp.controller.BgpId;
import org.onosproject.bgp.controller.BgpLinkListener;
import org.onosproject.bgp.controller.BgpLocalRib;
import org.onosproject.bgp.controller.BgpNodeListener;
import org.onosproject.bgp.controller.BgpPeer;
......@@ -58,6 +59,7 @@ public class BgpControllerImpl implements BgpController {
private BgpLocalRib bgplocalRibVpn = new BgpLocalRibImpl(this);
protected Set<BgpNodeListener> bgpNodeListener = new CopyOnWriteArraySet<>();
protected Set<BgpLinkListener> bgpLinkListener = new CopyOnWriteArraySet<>();
final Controller ctrl = new Controller(this);
......@@ -278,4 +280,19 @@ public class BgpControllerImpl implements BgpController {
public BgpLocalRib bgpLocalRibVpn() {
return bgplocalRibVpn;
}
@Override
public void addLinkListener(BgpLinkListener listener) {
this.bgpLinkListener.add(listener);
}
@Override
public void removeLinkListener(BgpLinkListener listener) {
this.bgpLinkListener.remove(listener);
}
@Override
public Set<BgpLinkListener> linkListener() {
return bgpLinkListener;
}
}
......
......@@ -14,11 +14,14 @@
package org.onosproject.bgp.controller.impl;
import com.google.common.base.MoreObjects;
import org.onosproject.bgp.controller.BgpController;
import org.onosproject.bgp.controller.BgpId;
import org.onosproject.bgp.controller.BgpLinkListener;
import org.onosproject.bgp.controller.BgpLocalRib;
import org.onosproject.bgp.controller.BgpNodeListener;
import org.onosproject.bgp.controller.BgpSessionInfo;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.protocol.BgpLSNlri;
import org.onosproject.bgpio.protocol.linkstate.BgpLinkLSIdentifier;
import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4;
......@@ -116,7 +119,7 @@ public class BgpLocalRibImpl implements BgpLocalRib {
}
@Override
public void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details) {
public void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details) throws BgpParseException {
int decisionResult;
log.debug("Add to local RIB {}", details.toString());
......@@ -133,13 +136,16 @@ public class BgpLocalRibImpl implements BgpLocalRib {
// Compare local RIB entry with the current attribute
decisionResult = selectionAlgo.compare(nodeTree.get(nodeLsIdentifier), detailsLocRib);
if (decisionResult < 0) {
for (BgpNodeListener l : bgpController.listener()) {
l.addNode((BgpNodeLSNlriVer4) nlri, details);
}
nodeTree.replace(nodeLsIdentifier, detailsLocRib);
log.debug("Local RIB update node: {}", detailsLocRib.toString());
}
} else {
nodeTree.put(nodeLsIdentifier, detailsLocRib);
for (BgpNodeListener l : bgpController.listener()) {
l.addNode((BgpNodeLSNlriVer4) nlri);
l.addNode((BgpNodeLSNlriVer4) nlri, details);
}
log.debug("Local RIB ad node: {}", detailsLocRib.toString());
}
......@@ -151,10 +157,16 @@ public class BgpLocalRibImpl implements BgpLocalRib {
decisionResult = selectionAlgo.compare(linkTree.get(linkLsIdentifier), detailsLocRib);
if (decisionResult < 0) {
linkTree.replace(linkLsIdentifier, detailsLocRib);
for (BgpLinkListener l : bgpController.linkListener()) {
l.addLink((BgpLinkLsNlriVer4) nlri, details);
}
log.debug("Local RIB update link: {}", detailsLocRib.toString());
}
} else {
linkTree.put(linkLsIdentifier, detailsLocRib);
for (BgpLinkListener l : bgpController.linkListener()) {
l.addLink((BgpLinkLsNlriVer4) nlri, details);
}
log.debug("Local RIB add link: {}", detailsLocRib.toString());
}
} else if (nlri instanceof BgpPrefixIPv4LSNlriVer4) {
......@@ -175,7 +187,7 @@ public class BgpLocalRibImpl implements BgpLocalRib {
}
@Override
public void delete(BgpLSNlri nlri) {
public void delete(BgpLSNlri nlri) throws BgpParseException {
log.debug("Delete from local RIB.");
// Update local RIB
......@@ -186,8 +198,9 @@ public class BgpLocalRibImpl implements BgpLocalRib {
* Update local RIB based on selection algorithm.
*
* @param nlri NLRI to update
* @throws BgpParseException while updating to local RIB
*/
public void decisionProcess(BgpLSNlri nlri) {
public void decisionProcess(BgpLSNlri nlri) throws BgpParseException {
checkNotNull(nlri);
if (nlri instanceof BgpNodeLSNlriVer4) {
selectionProcessNode(nlri, false);
......@@ -203,8 +216,9 @@ public class BgpLocalRibImpl implements BgpLocalRib {
*
* @param nlri NLRI to update
* @param routeDistinguisher VPN id to update
* @throws BgpParseException BGP parse exception
*/
public void decisionProcess(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher) {
public void decisionProcess(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher) throws BgpParseException {
checkNotNull(nlri);
if (nlri instanceof BgpNodeLSNlriVer4) {
if (vpnNodeTree.containsKey(routeDistinguisher)) {
......@@ -235,8 +249,9 @@ public class BgpLocalRibImpl implements BgpLocalRib {
*
* @param nlri NLRI to update
* @param isVpnRib true if VPN local RIB, otherwise false
* @throws BgpParseException throws BGP parse exception
*/
public void selectionProcessNode(BgpLSNlri nlri, boolean isVpnRib) {
public void selectionProcessNode(BgpLSNlri nlri, boolean isVpnRib) throws BgpParseException {
BgpPeerImpl peer;
BgpSessionInfo sessionInfo;
int decisionResult;
......@@ -298,8 +313,9 @@ public class BgpLocalRibImpl implements BgpLocalRib {
*
* @param nlri NLRI to update
* @param isVpnRib true if VPN local RIB, otherwise false
* @throws BgpParseException BGP parse exception
*/
public void selectionProcessLink(BgpLSNlri nlri, boolean isVpnRib) {
public void selectionProcessLink(BgpLSNlri nlri, boolean isVpnRib) throws BgpParseException {
BgpPeerImpl peer;
BgpSessionInfo sessionInfo;
int decisionResult;
......@@ -309,6 +325,9 @@ public class BgpLocalRibImpl implements BgpLocalRib {
if (linkTree.containsKey(linkLsIdentifier)) {
log.debug("Local RIB remove link: {}", linkLsIdentifier.toString());
for (BgpLinkListener l : bgpController.linkListener()) {
l.deleteLink((BgpLinkLsNlriVer4) nlri);
}
linkTree.remove(linkLsIdentifier);
}
......@@ -361,8 +380,9 @@ public class BgpLocalRibImpl implements BgpLocalRib {
*
* @param nlri NLRI to update
* @param isVpnRib true if VPN local RIB, otherwise false
* @throws BgpParseException BGP parse exception
*/
public void selectionProcessPrefix(BgpLSNlri nlri, boolean isVpnRib) {
public void selectionProcessPrefix(BgpLSNlri nlri, boolean isVpnRib) throws BgpParseException {
BgpPeerImpl peer;
BgpSessionInfo sessionInfo;
int decisionResult;
......@@ -419,7 +439,7 @@ public class BgpLocalRibImpl implements BgpLocalRib {
@Override
public void add(BgpSessionInfo sessionInfo, BgpLSNlri nlri, PathAttrNlriDetails details,
RouteDistinguisher routeDistinguisher) {
RouteDistinguisher routeDistinguisher) throws BgpParseException {
add(sessionInfo, nlri, details);
if (nlri instanceof BgpNodeLSNlriVer4) {
if (!vpnNodeTree.containsKey(routeDistinguisher)) {
......@@ -437,7 +457,7 @@ public class BgpLocalRibImpl implements BgpLocalRib {
}
@Override
public void delete(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher) {
public void delete(BgpLSNlri nlri, RouteDistinguisher routeDistinguisher) throws BgpParseException {
// Update local RIB
decisionProcess(nlri, routeDistinguisher);
}
......@@ -446,8 +466,9 @@ public class BgpLocalRibImpl implements BgpLocalRib {
* Update local RIB node based on avaliable peer adjacency RIB.
*
* @param o adjacency-in/VPN adjacency-in
* @throws BgpParseException BGP parse exception
*/
public void localRibUpdateNode(Object o) {
public void localRibUpdateNode(Object o) throws BgpParseException {
if (o instanceof AdjRibIn) {
AdjRibIn adjRib = (AdjRibIn) o;
......@@ -487,8 +508,9 @@ public class BgpLocalRibImpl implements BgpLocalRib {
* Update localRIB link based on avaliable peer adjacency RIB.
*
* @param o adjacency-in/VPN adjacency-in
* @throws BgpParseException BGP parse exceptions
*/
public void localRibUpdateLink(Object o) {
public void localRibUpdateLink(Object o) throws BgpParseException {
if (o instanceof AdjRibIn) {
AdjRibIn adjRib = (AdjRibIn) o;
......@@ -528,8 +550,9 @@ public class BgpLocalRibImpl implements BgpLocalRib {
* Update localRIB prefix based on avaliable peer adjacency RIB.
*
* @param o instance of adjacency-in/VPN adjacency-in
* @throws BgpParseException BGP parse exception
*/
public void localRibUpdatePrefix(Object o) {
public void localRibUpdatePrefix(Object o) throws BgpParseException {
if (o instanceof AdjRibIn) {
AdjRibIn adjRib = (AdjRibIn) o;
......@@ -572,8 +595,9 @@ public class BgpLocalRibImpl implements BgpLocalRib {
* Update localRIB.
*
* @param adjRibIn adjacency RIB-in
* @throws BgpParseException BGP parse exception
*/
public void localRibUpdate(AdjRibIn adjRibIn) {
public void localRibUpdate(AdjRibIn adjRibIn) throws BgpParseException {
log.debug("Update local RIB.");
localRibUpdateNode(adjRibIn);
......@@ -585,8 +609,9 @@ public class BgpLocalRibImpl implements BgpLocalRib {
* Update localRIB.
*
* @param vpnAdjRibIn VPN adjacency RIB-in
* @throws BgpParseException BGP parse exception
*/
public void localRibUpdate(VpnAdjRibIn vpnAdjRibIn) {
public void localRibUpdate(VpnAdjRibIn vpnAdjRibIn) throws BgpParseException {
log.debug("Update VPN local RIB.");
localRibUpdateNode(vpnAdjRibIn);
......
......@@ -425,8 +425,9 @@ public class BgpPeerImpl implements BgpPeer {
*
* @param peerImpl BGP peer instance
* @param nlri NLRI information
* @throws BgpParseException BGP parse exception
*/
public void callRemove(BgpPeerImpl peerImpl, List<BgpLSNlri> nlri) {
public void callRemove(BgpPeerImpl peerImpl, List<BgpLSNlri> nlri) throws BgpParseException {
ListIterator<BgpLSNlri> listIterator = nlri.listIterator();
while (listIterator.hasNext()) {
BgpLSNlri nlriInfo = listIterator.next();
......@@ -479,8 +480,9 @@ public class BgpPeerImpl implements BgpPeer {
/**
* Update localRIB on peer disconnect.
*
* @throws BgpParseException while updating local RIB
*/
public void updateLocalRibOnPeerDisconnect() {
public void updateLocalRibOnPeerDisconnect() throws BgpParseException {
BgpLocalRibImpl localRib = (BgpLocalRibImpl) bgplocalRib;
BgpLocalRibImpl localRibVpn = (BgpLocalRibImpl) bgplocalRibVpn;
......@@ -490,7 +492,6 @@ public class BgpPeerImpl implements BgpPeer {
/**
* Update peer flow specification RIB on peer disconnect.
*
*/
public void updateFlowSpecOnPeerDisconnect() {
......
/*
* Copyright 2016 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.provider.bgp.topology.impl;
import org.onosproject.bgp.controller.BgpCfg;
import org.onosproject.bgp.controller.BgpController;
import org.onosproject.bgp.controller.BgpId;
import org.onosproject.bgp.controller.BgpLinkListener;
import org.onosproject.bgp.controller.BgpLocalRib;
import org.onosproject.bgp.controller.BgpNodeListener;
import org.onosproject.bgp.controller.BgpPeer;
import org.onosproject.bgp.controller.BgpPeerManager;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.protocol.BgpMessage;
import java.util.Map;
import java.util.Set;
/**
* Adapter implementation for BGP controller.
*/
public class BgpControllerAdapter implements BgpController {
@Override
public Iterable<BgpPeer> getPeers() {
// TODO Auto-generated method stub
return null;
}
@Override
public BgpPeer getPeer(BgpId bgpId) {
// TODO Auto-generated method stub
return null;
}
@Override
public void writeMsg(BgpId bgpId, BgpMessage msg) {
// TODO Auto-generated method stub
}
@Override
public void processBgpPacket(BgpId bgpId, BgpMessage msg) throws BgpParseException {
// TODO Auto-generated method stub
}
@Override
public void closeConnectedPeers() {
// TODO Auto-generated method stub
}
@Override
public BgpCfg getConfig() {
// TODO Auto-generated method stub
return null;
}
@Override
public int connectedPeerCount() {
// TODO Auto-generated method stub
return 0;
}
@Override
public BgpLocalRib bgpLocalRibVpn() {
// TODO Auto-generated method stub
return null;
}
@Override
public BgpLocalRib bgpLocalRib() {
// TODO Auto-generated method stub
return null;
}
@Override
public BgpPeerManager peerManager() {
// TODO Auto-generated method stub
return null;
}
@Override
public Map<BgpId, BgpPeer> connectedPeers() {
// TODO Auto-generated method stub
return null;
}
@Override
public Set<BgpNodeListener> listener() {
// TODO Auto-generated method stub
return null;
}
@Override
public Set<BgpLinkListener> linkListener() {
// TODO Auto-generated method stub
return null;
}
@Override
public void addListener(BgpNodeListener listener) {
// TODO Auto-generated method stub
}
@Override
public void removeListener(BgpNodeListener listener) {
// TODO Auto-generated method stub
}
@Override
public void addLinkListener(BgpLinkListener listener) {
// TODO Auto-generated method stub
}
@Override
public void removeLinkListener(BgpLinkListener listener) {
// TODO Auto-generated method stub
}
}