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

5
arp.go
View File

@@ -36,6 +36,8 @@ type arpEntry struct {
func (t *Tendrils) readARPTable() {
entries := t.parseARPTable()
localNode := t.getLocalNode()
for _, entry := range entries {
if t.Interface != "" && entry.iface != t.Interface {
continue
@@ -49,6 +51,9 @@ func (t *Tendrils) readARPTable() {
}
t.nodes.Update(nil, entry.mac, []net.IP{entry.ip}, "", "", "arp")
if localNode != nil {
t.nodes.UpdateMACTable(localNode, entry.mac, entry.iface)
}
}
}