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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user