all: add clients list command to debug Mac discovery

This commit is contained in:
Cuong Manh Le
2023-07-21 16:28:08 +00:00
committed by Cuong Manh Le
parent 61b6431b6e
commit 437fb1b16d
10 changed files with 236 additions and 6 deletions
+17
View File
@@ -27,3 +27,20 @@ func (a *arpDiscover) LookupMac(ip string) string {
}
return val.(string)
}
func (a *arpDiscover) String() string {
return "arp"
}
func (a *arpDiscover) List() []string {
var ips []string
a.ip.Range(func(key, value any) bool {
ips = append(ips, value.(string))
return true
})
a.mac.Range(func(key, value any) bool {
ips = append(ips, key.(string))
return true
})
return ips
}