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
@@ -100,6 +100,23 @@ func (d *dhcp) LookupHostnameByMac(mac string) string {
return val.(string)
}
func (d *dhcp) String() string {
return "dhcp"
}
func (d *dhcp) List() []string {
var ips []string
d.ip.Range(func(key, value any) bool {
ips = append(ips, value.(string))
return true
})
d.mac.Range(func(key, value any) bool {
ips = append(ips, key.(string))
return true
})
return ips
}
// AddLeaseFile adds given lease file for reading/watching clients info.
func (d *dhcp) addLeaseFile(name string, format ctrld.LeaseFileFormat) error {
if d.watcher == nil {