mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 14:03:17 -07:00
refact: refactored api.rest controller
This commit is contained in:
parent
0b51b6ebe4
commit
cc01a99579
2 changed files with 77 additions and 58 deletions
|
@ -156,6 +156,20 @@ func (w *WiFi) Get(mac string) (*AccessPoint, bool) {
|
|||
return ap, found
|
||||
}
|
||||
|
||||
func (w *WiFi) GetClient(mac string) (*Station, bool) {
|
||||
w.Lock()
|
||||
defer w.Unlock()
|
||||
|
||||
mac = NormalizeMac(mac)
|
||||
for _, ap := range w.aps {
|
||||
if client, found := ap.Get(mac); found == true {
|
||||
return client, true
|
||||
}
|
||||
}
|
||||
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func (w *WiFi) Clear() error {
|
||||
w.aps = make(map[string]*AccessPoint)
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue