fix: fixed compilation of macOS for wifi modules

This commit is contained in:
evilsocket 2019-01-20 18:30:22 +01:00
commit 79279126e6
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
3 changed files with 42 additions and 21 deletions

27
network/net_wifi.go Normal file
View file

@ -0,0 +1,27 @@
package network
import (
"sync"
)
const NO_CHANNEL = -1
var (
currChannels = make(map[string]int)
currChannelLock = sync.Mutex{}
)
func GetInterfaceChannel(iface string) int {
currChannelLock.Lock()
defer currChannelLock.Unlock()
if curr, found := currChannels[iface]; found {
return curr
}
return NO_CHANNEL
}
func SetInterfaceCurrentChannel(iface string, channel int) {
currChannelLock.Lock()
defer currChannelLock.Unlock()
currChannels[iface] = channel
}