mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 05:53:20 -07:00
new: wifi.recon now reports wifi.client.new and wifi.client.lost events
This commit is contained in:
parent
44629f62ca
commit
4c5a776f86
4 changed files with 73 additions and 24 deletions
|
@ -59,7 +59,7 @@ func (ap *AccessPoint) RemoveClient(mac string) {
|
|||
}
|
||||
}
|
||||
|
||||
func (ap *AccessPoint) AddClient(bssid string, frequency int, rssi int8) *Station {
|
||||
func (ap *AccessPoint) AddClientIfNew(bssid string, frequency int, rssi int8) (*Station, bool) {
|
||||
ap.Lock()
|
||||
defer ap.Unlock()
|
||||
|
||||
|
@ -71,13 +71,13 @@ func (ap *AccessPoint) AddClient(bssid string, frequency int, rssi int8) *Statio
|
|||
s.RSSI = rssi
|
||||
s.LastSeen = time.Now()
|
||||
|
||||
return s
|
||||
return s, false
|
||||
}
|
||||
|
||||
s := NewStation("", bssid, frequency, rssi)
|
||||
ap.clients[bssid] = s
|
||||
|
||||
return s
|
||||
return s, true
|
||||
}
|
||||
|
||||
func (ap *AccessPoint) NumClients() int {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue