@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()
RouteService
getAllRoutes
in interface RouteService
public Route longestPrefixMatch(org.onlab.packet.IpAddress ip)
RouteService
longestPrefixMatch
in interface RouteService
ip
- IP addresspublic Collection<Route> getRoutesForNextHop(org.onlab.packet.IpAddress nextHop)
RouteService
getRoutesForNextHop
in interface RouteService
nextHop
- next hop IP addresspublic Set<NextHop> getNextHops()
RouteService
getNextHops
in interface RouteService
public void update(Collection<Route> routes)
RouteAdminService
update
in interface RouteAdminService
routes
- collection of routes to updatepublic void withdraw(Collection<Route> routes)
RouteAdminService
withdraw
in interface RouteAdminService
routes
- collection of routes to withdraw