systemd-resolved: answer with the generated contract's own types (review r1 C-6, C-8)

C-6: import noderesolver (mesh-networking's seat definition) at the zero
version; routes, route, unroute and uplink-names answer with its
RoutesAnswer, RouteAnswer, UnrouteAnswer and UplinkNamesAnswer, never a
map or a parallel struct, and uplink-names' input names is a JSON array
(arrayArg), never a comma- or space-split string.

C-8: the names file write's 15 s is the stated constant
WriteUplinkNamesBound, not an inline literal.

Builds: design 08 sign-in-page §2, §5, §6, §9, DQ-12, C-6, C-8
This commit is contained in:
jochen
2026-11-24 22:00:15 +01:00
parent ae7d0f874b
commit 717f8ec2e5
6 changed files with 121 additions and 45 deletions
@@ -552,8 +552,9 @@ func (g *Guard) Answer(ctx context.Context, req Request) Reply {
case "routes":
var routes *Routes
if routes, err = g.Resolver.Routes(ctx); err == nil {
result = map[string]any{"mesh": routes.Mesh, "links": routes.Links,
"uplink_names": g.Resolver.UplinkNamesAnswer(routes), "mesh_resolvers": g.Resolver.MeshResolversAnswer()}
// The machine's socket answers routes the same as the bus's (§5, DQ-5), with no outside_writes
// of its own list: a module on the machine reads displaced over its own verb.
result = g.Resolver.RoutesAnswer(routes, nil)
}
case "route":
var routed *Routed