@Service public class RouteManager extends Object implements org.onosproject.event.ListenerService<RouteEvent,RouteListener>, RouteService, RouteAdminService
| Modifier and Type | Field and Description |
|---|---|
protected org.onosproject.net.host.HostService |
hostService |
protected org.onosproject.net.config.NetworkConfigRegistry |
netcfgRegistry |
protected RouteStore |
routeStore |
| Constructor and Description |
|---|
RouteManager() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate() |
void |
addListener(RouteListener listener)
In a departure from other services in ONOS, calling addListener will
cause all current routes to be pushed to the listener before any new
events are sent.
|
protected void |
deactivate() |
Map<RouteTableId,Collection<Route>> |
getAllRoutes()
Returns all routes for all route tables in the system.
|
Set<NextHop> |
getNextHops()
Returns all next hops in the route store.
|
Collection<Route> |
getRoutesForNextHop(org.onlab.packet.IpAddress nextHop)
Returns the routes for the given next hop.
|
Route |
longestPrefixMatch(org.onlab.packet.IpAddress ip)
Performs a longest prefix match on the given IP address.
|
void |
removeListener(RouteListener listener) |
void |
update(Collection<Route> routes)
Updates the given routes in the route service.
|
void |
withdraw(Collection<Route> routes)
Withdraws the given routes from the route service.
|
@Reference(cardinality=MANDATORY_UNARY) protected RouteStore routeStore
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.net.host.HostService hostService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.net.config.NetworkConfigRegistry netcfgRegistry
@Activate protected void activate()
@Deactivate protected void deactivate()
public void addListener(RouteListener listener)
addListener in interface org.onosproject.event.ListenerService<RouteEvent,RouteListener>listener - listener to be addedpublic void removeListener(RouteListener listener)
removeListener in interface org.onosproject.event.ListenerService<RouteEvent,RouteListener>public Map<RouteTableId,Collection<Route>> getAllRoutes()
RouteServicegetAllRoutes in interface RouteServicepublic Route longestPrefixMatch(org.onlab.packet.IpAddress ip)
RouteServicelongestPrefixMatch in interface RouteServiceip - IP addresspublic Collection<Route> getRoutesForNextHop(org.onlab.packet.IpAddress nextHop)
RouteServicegetRoutesForNextHop in interface RouteServicenextHop - next hop IP addresspublic Set<NextHop> getNextHops()
RouteServicegetNextHops in interface RouteServicepublic void update(Collection<Route> routes)
RouteAdminServiceupdate in interface RouteAdminServiceroutes - collection of routes to updatepublic void withdraw(Collection<Route> routes)
RouteAdminServicewithdraw in interface RouteAdminServiceroutes - collection of routes to withdraw