@Service public class RouteManager extends java.lang.Object implements RouteService, RouteAdminService
| Modifier and Type | Field and Description |
|---|---|
protected org.onosproject.net.host.HostService |
hostService |
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() |
java.util.Map<RouteTableId,java.util.Collection<Route>> |
getAllRoutes()
Returns all routes for all route tables in the system.
|
java.util.Set<NextHop> |
getNextHops()
Returns all next hops in the route store.
|
java.util.Collection<RouteInfo> |
getRoutes(RouteTableId id)
Returns information about all routes in the given route table.
|
java.util.Collection<Route> |
getRoutesForNextHop(org.onlab.packet.IpAddress nextHop)
Returns the routes for the given next hop.
|
java.util.Collection<RouteTableId> |
getRouteTables()
Returns the set of route tables in the system.
|
java.util.Optional<ResolvedRoute> |
longestPrefixLookup(org.onlab.packet.IpAddress ip)
Performs a longest prefix lookup on the given IP address.
|
Route |
longestPrefixMatch(org.onlab.packet.IpAddress ip)
Performs a longest prefix match on the given IP address.
|
void |
removeListener(RouteListener listener) |
void |
update(java.util.Collection<Route> routes)
Updates the given routes in the route service.
|
void |
withdraw(java.util.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
@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 java.util.Map<RouteTableId,java.util.Collection<Route>> getAllRoutes()
RouteServicegetAllRoutes in interface RouteServicepublic java.util.Collection<RouteTableId> getRouteTables()
RouteServicegetRouteTables in interface RouteServicepublic java.util.Collection<RouteInfo> getRoutes(RouteTableId id)
RouteServicegetRoutes in interface RouteServiceid - route table IDpublic Route longestPrefixMatch(org.onlab.packet.IpAddress ip)
RouteServicelongestPrefixMatch in interface RouteServiceip - IP addresspublic java.util.Optional<ResolvedRoute> longestPrefixLookup(org.onlab.packet.IpAddress ip)
RouteServicelongestPrefixLookup in interface RouteServiceip - IP address to look uppublic java.util.Collection<Route> getRoutesForNextHop(org.onlab.packet.IpAddress nextHop)
RouteServicegetRoutesForNextHop in interface RouteServicenextHop - next hop IP addresspublic java.util.Set<NextHop> getNextHops()
RouteServicegetNextHops in interface RouteServicepublic void update(java.util.Collection<Route> routes)
RouteAdminServiceupdate in interface RouteAdminServiceroutes - collection of routes to updatepublic void withdraw(java.util.Collection<Route> routes)
RouteAdminServicewithdraw in interface RouteAdminServiceroutes - collection of routes to withdraw