refact: using global wifi objects in order to expose them from the api.rest module

This commit is contained in:
evilsocket 2018-02-17 05:44:25 +01:00
parent 9390a580fd
commit e895dc6ab2
5 changed files with 29 additions and 46 deletions

View file

@ -1,6 +1,10 @@
package modules
type ByRSSISorter []*WiFiStation
import (
"github.com/evilsocket/bettercap-ng/network"
)
type ByRSSISorter []*network.WiFiStation
func (a ByRSSISorter) Len() int { return len(a) }
func (a ByRSSISorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
@ -11,7 +15,7 @@ func (a ByRSSISorter) Less(i, j int) bool {
return a[i].RSSI > a[j].RSSI
}
type ByChannelSorter []*WiFiStation
type ByChannelSorter []*network.WiFiStation
func (a ByChannelSorter) Len() int { return len(a) }
func (a ByChannelSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
@ -22,7 +26,7 @@ func (a ByChannelSorter) Less(i, j int) bool {
return a[i].Channel < a[j].Channel
}
type ByEssidSorter []*WiFiStation
type ByEssidSorter []*network.WiFiStation
func (a ByEssidSorter) Len() int { return len(a) }
func (a ByEssidSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
@ -33,7 +37,7 @@ func (a ByEssidSorter) Less(i, j int) bool {
return a[i].ESSID() < a[j].ESSID()
}
type ByWiFiSeenSorter []*WiFiStation
type ByWiFiSeenSorter []*network.WiFiStation
func (a ByWiFiSeenSorter) Len() int { return len(a) }
func (a ByWiFiSeenSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }