mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-18 05:18:23 +00:00
Add the presist storage for control routes
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
type RouteCollector struct {
|
||||
routes []netip.Prefix
|
||||
removedRoutes []netip.Prefix
|
||||
routeInfo *routeinfo.RouteInfo
|
||||
}
|
||||
|
||||
func (rc *RouteCollector) AdvertiseRoute(pfx ...netip.Prefix) error {
|
||||
@@ -35,11 +36,15 @@ func (rc *RouteCollector) UnadvertiseRoute(toRemove ...netip.Prefix) error {
|
||||
}
|
||||
|
||||
func (rc *RouteCollector) StoreRouteInfo(ri *routeinfo.RouteInfo) error {
|
||||
rc.routeInfo = ri
|
||||
return nil
|
||||
}
|
||||
|
||||
func (rc *RouteCollector) ReadRouteInfo() (*routeinfo.RouteInfo, error) {
|
||||
return nil, nil
|
||||
if rc.routeInfo == nil {
|
||||
return routeinfo.NewRouteInfo(), nil
|
||||
}
|
||||
return rc.routeInfo, nil
|
||||
}
|
||||
|
||||
// RemovedRoutes returns the list of routes that were removed.
|
||||
|
Reference in New Issue
Block a user