use of org.onosproject.routing.bgp.BgpInfoService in project onos by opennetworkinglab.
the class BgpNeighborsListCommand method doExecute.
@Override
protected void doExecute() {
BgpInfoService service = AbstractShellCommand.get(BgpInfoService.class);
Collection<BgpSession> bgpSessions = service.getBgpSessions();
if (bgpNeighbor != null) {
// Print a single neighbor (if found)
BgpSession foundBgpSession = null;
for (BgpSession bgpSession : bgpSessions) {
if (bgpSession.remoteInfo().bgpId().toString().equals(bgpNeighbor)) {
foundBgpSession = bgpSession;
break;
}
}
if (foundBgpSession != null) {
printNeighbor(foundBgpSession);
} else {
print("BGP neighbor %s not found", bgpNeighbor);
}
return;
}
// Print all neighbors
printNeighbors(bgpSessions);
}
use of org.onosproject.routing.bgp.BgpInfoService in project onos by opennetworkinglab.
the class ArtemisDeaggregatorImpl method activate.
@Activate
protected void activate() {
rulesInstalled = false;
// FIXME: add other type of BGP Speakers when Dynamic Configuration is available
bgpSpeakers.add(new QuaggaBgpSpeakers(bgpInfoService));
moasServer = new MoasServerController();
moasServer.start(moasAgent, packetProcessor);
deviceService.addListener(deviceListener);
appId = coreService.getAppId("org.onosproject.artemis");
// enable OVSDB for the switches that we will install the GRE tunnel
artemisService.getConfig().ifPresent(config -> config.moasInfo().getTunnelPoints().forEach(tunnelPoint -> ovsdbController.connect(tunnelPoint.getOvsdbIp(), TpPort.tpPort(6640))));
artemisService.addListener(artemisEventListener);
log.info("Artemis Deaggregator Service Started");
/*
log.info("interfaces {}", interfaceService.getInterfaces());
[{
"name": "",
"connectPoint": "of:000000000000000a/2",
"ipAddresses": "[1.1.1.1/30]",
"macAddress": "00:00:00:00:00:01"
},
{
"name": "",
"connectPoint": "of:000000000000000a/3",
"ipAddresses": "[10.0.0.1/8]",
"macAddress": "00:00:00:00:00:01"
}]
*/
}
use of org.onosproject.routing.bgp.BgpInfoService in project onos by opennetworkinglab.
the class BgpRoutesListCommand method doExecute.
@Override
protected void doExecute() {
BgpInfoService service = AbstractShellCommand.get(BgpInfoService.class);
// Print summary of the routes
if (routesSummary) {
printSummary(service.getBgpRoutes4(), service.getBgpRoutes6());
return;
}
BgpSession foundBgpSession = null;
if (bgpNeighbor != null) {
// Print the routes from a single neighbor (if found)
for (BgpSession bgpSession : service.getBgpSessions()) {
if (bgpSession.remoteInfo().bgpId().toString().equals(bgpNeighbor)) {
foundBgpSession = bgpSession;
break;
}
}
if (foundBgpSession == null) {
print("BGP neighbor %s not found", bgpNeighbor);
return;
}
}
// Print the routes
if (foundBgpSession != null) {
printRoutes(foundBgpSession.getBgpRibIn4(), foundBgpSession.getBgpRibIn6());
} else {
printRoutes(service.getBgpRoutes4(), service.getBgpRoutes6());
}
}
Aggregations