mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
fix: fixed compilation of macOS for wifi modules
This commit is contained in:
parent
bf34561a19
commit
79279126e6
3 changed files with 42 additions and 21 deletions
27
network/net_wifi.go
Normal file
27
network/net_wifi.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue