ipn/ipnlocal: shim in appc route subscriber plumbing

Just log the events for now.

Change-Id: I20e18306e0362a13210dbc90707acddb788c10ea
This commit is contained in:
M. J. Fromberger 2025-09-12 13:39:39 -07:00
parent ccbf115875
commit 16808bf297

View File

@ -208,7 +208,10 @@ type LocalBackend struct {
autoUpdateSub *eventbus.Subscriber[controlclient.AutoUpdate]
healthChangeSub *eventbus.Subscriber[health.Change]
changeDeltaSub *eventbus.Subscriber[netmon.ChangeDelta]
routeUpdateSub *eventbus.Subscriber[appc.RouteUpdate]
storeRoutesSub *eventbus.Subscriber[appc.RouteInfo]
subsDoneCh chan struct{} // closed when consumeEventbusTopics returns
health *health.Tracker // always non-nil
polc policyclient.Client // always non-nil
metrics metrics
@ -545,6 +548,8 @@ func NewLocalBackend(logf logger.Logf, logID logid.PublicID, sys *tsd.System, lo
b.autoUpdateSub = eventbus.Subscribe[controlclient.AutoUpdate](b.eventClient)
b.healthChangeSub = eventbus.Subscribe[health.Change](b.eventClient)
b.changeDeltaSub = eventbus.Subscribe[netmon.ChangeDelta](b.eventClient)
b.routeUpdateSub = eventbus.Subscribe[appc.RouteUpdate](b.eventClient)
b.storeRoutesSub = eventbus.Subscribe[appc.RouteInfo](b.eventClient)
nb := newNodeBackend(ctx, b.sys.Bus.Get())
b.currentNodeAtomic.Store(nb)
nb.ready()
@ -635,6 +640,10 @@ func (b *LocalBackend) consumeEventbusTopics() {
b.onHealthChange(change)
case changeDelta := <-b.changeDeltaSub.Events():
b.linkChange(&changeDelta)
case ru := <-b.routeUpdateSub.Events():
b.logf("TODO: received route update: %+v", ru)
case ri := <-b.storeRoutesSub.Events():
b.logf("TODO: received store routes: %+v", ri)
}
}
}