mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-16 13:17:19 +02:00
all: add clients list command to debug Mac discovery
This commit is contained in:
committed by
Cuong Manh Le
parent
61b6431b6e
commit
437fb1b16d
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user