Files
mesh-catalog/modules/networkmanager/cmd/uplink-tools/main.go
T
jschoubben 700b37890b
mesh/delivery merged: source.main moved to novox/mesh-catalog@0ec8347786f4
mesh/check checking 700b37890bfd on 0ec8347786f4
node-uplink links answers each link's mac, master and parent (S1a links-mac, issue 1965)
Both holders' uplink-tools copies read address, master, link and
link_index/link_netnsid from the existing ip -j address show call. Fields
are left out where a link has none (L3); a parent in another namespace is
{index, namespace} (L2); the form lives in uplink.go only (L4); only the
tool description changes, not seat.json (L5); bridge fdb MACs are not
answered (L6); names mac, master, parent (L1).

Builds: design 48 10, design 08 code:, issue 1965 note 11 L1-L6
2026-11-12 17:30:17 +01:00

36 lines
1.6 KiB
Go

// The uplink holder's tools bundle: the node-uplink seat's verbs (novox/hq ADR 0241), served by the node's
// runtime as the operator account. uplink.go is every holder's; manager.go is this holder's own. stdout is
// the MCP channel; this says nothing else.
package main
import (
"context"
"fmt"
"os"
stdio "git.novox.be/novox/mesh-sdk/go"
)
func tools(m Machine) []stdio.Tool {
return []stdio.Tool{
{Name: seat + ".resolvers",
Description: "The machine's resolver file as it is now: the resolvers, search domains and options it lists, " +
"whether it is the file the mesh declares, and when it is not, who wrote it as far as the machine shows " +
"— its header, a backup a VPN client left beside it, a link in its place, a known writer running. (r)",
Run: func(map[string]any) (any, error) { return m.ReadResolvers() }},
{Name: seat + ".links",
Description: "Every network link on the machine: its state, its addresses, its mac, the bridge or bond it is enslaved to (master), the link it rides on (parent: its name, or an index and namespace when that link is in another network namespace), whether the default route " +
"leaves through it, and the resolvers and search domains the network manager knows for it — a VPN's " +
"tunnel included. (r)",
Run: func(map[string]any) (any, error) { return m.Links(context.Background()) }},
}
}
func main() {
m := Machine{ResolvPath: ResolvConf, Run: execRunner, Running: running, LinkDNS: managerDNS}
if err := stdio.Serve("", tools(m)); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}