add per-node mac table populated from snmp and arp

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ian Gulliver
2026-01-18 14:54:06 -08:00
parent 2262e8d3bf
commit 54fc941728
4 changed files with 54 additions and 11 deletions

View File

@@ -97,6 +97,22 @@ func (t *Tendrils) populateLocalAddresses() {
}
}
func (t *Tendrils) getLocalNode() *Node {
interfaces, err := net.Interfaces()
if err != nil {
return nil
}
for _, iface := range interfaces {
if len(iface.HardwareAddr) > 0 {
if node := t.nodes.GetByMAC(iface.HardwareAddr); node != nil {
return node
}
}
}
return nil
}
func (t *Tendrils) listInterfaces() []net.Interface {
interfaces, err := net.Interfaces()
if err != nil {