mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
fix: wifi.AccessPoint and wifi.Station now export the Channel field via JSON
This commit is contained in:
parent
4ae1ffd171
commit
78c341c2b3
5 changed files with 13 additions and 16 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
type Station struct {
|
||||
*Endpoint
|
||||
Frequency int `json:"frequency"`
|
||||
Channel int `json:"channel"`
|
||||
RSSI int8 `json:"rssi"`
|
||||
Sent uint64 `json:"sent"`
|
||||
Received uint64 `json:"received"`
|
||||
|
@ -19,7 +20,6 @@ type Station struct {
|
|||
|
||||
func cleanESSID(essid string) string {
|
||||
res := ""
|
||||
|
||||
for _, c := range essid {
|
||||
if strconv.IsPrint(c) {
|
||||
res += string(c)
|
||||
|
@ -34,6 +34,7 @@ func NewStation(essid, bssid string, frequency int, rssi int8) *Station {
|
|||
return &Station{
|
||||
Endpoint: NewEndpointNoResolve(MonitorModeAddress, bssid, cleanESSID(essid), 0),
|
||||
Frequency: frequency,
|
||||
Channel: Dot11Freq2Chan(frequency),
|
||||
RSSI: rssi,
|
||||
WPS: make(map[string]string),
|
||||
Handshake: NewHandshake(),
|
||||
|
@ -48,10 +49,6 @@ func (s *Station) ESSID() string {
|
|||
return s.Hostname
|
||||
}
|
||||
|
||||
func (s *Station) Channel() int {
|
||||
return Dot11Freq2Chan(s.Frequency)
|
||||
}
|
||||
|
||||
func (s *Station) HasWPS() bool {
|
||||
return len(s.WPS) > 0
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue