Improving Mac discovery

This commit is contained in:
Cuong Manh Le
2023-07-14 16:53:17 +00:00
committed by Cuong Manh Le
parent 3007cb86ec
commit 76d2e2c226
22 changed files with 1229 additions and 291 deletions
+23
View File
@@ -0,0 +1,23 @@
package clientinfo
import (
"sync"
"testing"
)
func TestArpScan(t *testing.T) {
a := &arpDiscover{}
a.scan()
for _, table := range []*sync.Map{&a.mac, &a.ip} {
count := 0
table.Range(func(key, value any) bool {
count++
t.Logf("%s => %s", key, value)
return true
})
if count == 0 {
t.Error("empty result from arp scan")
}
}
}