@@ -1182,6 +1182,11 @@ func (d *Daemon) Addr() protocol.Addr {
11821182}
11831183
11841184// DaemonInfo holds status information about the running daemon.
1185+ type NetworkMembership struct {
1186+ NetworkID uint16 `json:"network_id"`
1187+ Address string `json:"address"`
1188+ }
1189+
11851190type DaemonInfo struct {
11861191 NodeID uint32
11871192 Address string
@@ -1203,6 +1208,7 @@ type DaemonInfo struct {
12031208 EncryptOK uint64
12041209 EncryptFail uint64
12051210 HandshakePendingCount int
1211+ Networks []NetworkMembership
12061212 PeerList []PeerInfo
12071213 ConnList []ConnectionInfo
12081214}
@@ -1246,6 +1252,19 @@ func (d *Daemon) Info() *DaemonInfo {
12461252 hostname := d .config .Hostname
12471253 d .addrMu .RUnlock ()
12481254
1255+ // Collect network memberships from registry
1256+ var networks []NetworkMembership
1257+ for _ , netID := range d .nodeNetworks () {
1258+ if netID == 0 {
1259+ continue // backbone is already shown as primary address
1260+ }
1261+ addr := protocol.Addr {Network : netID , Node : nid }
1262+ networks = append (networks , NetworkMembership {
1263+ NetworkID : netID ,
1264+ Address : addr .String (),
1265+ })
1266+ }
1267+
12491268 return & DaemonInfo {
12501269 NodeID : nid ,
12511270 Address : addrStr ,
@@ -1267,6 +1286,7 @@ func (d *Daemon) Info() *DaemonInfo {
12671286 EncryptOK : atomic .LoadUint64 (& d .tunnels .EncryptOK ),
12681287 EncryptFail : atomic .LoadUint64 (& d .tunnels .EncryptFail ),
12691288 HandshakePendingCount : d .handshakes .PendingCount (),
1289+ Networks : networks ,
12701290 PeerList : peerList ,
12711291 ConnList : d .ports .ConnectionList (),
12721292 }
0 commit comments