mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
new: added interface name and channel on wifi.show
This commit is contained in:
parent
f71df54950
commit
bf34561a19
2 changed files with 13 additions and 1 deletions
|
@ -159,7 +159,9 @@ func (w *WiFiModule) Show(by string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
w.Session.Queue.Stats.RLock()
|
w.Session.Queue.Stats.RLock()
|
||||||
fmt.Printf("\n%s %s / %s %s / %d pkts / %d errs\n\n",
|
fmt.Printf("\n%s (ch. %d) / %s %s / %s %s / %d pkts / %d errs\n\n",
|
||||||
|
w.Session.Interface.Name(),
|
||||||
|
network.GetInterfaceChannel(w.Session.Interface.Name()),
|
||||||
tui.Red("↑"),
|
tui.Red("↑"),
|
||||||
humanize.Bytes(w.Session.Queue.Stats.Sent),
|
humanize.Bytes(w.Session.Queue.Stats.Sent),
|
||||||
tui.Green("↓"),
|
tui.Green("↓"),
|
||||||
|
|
|
@ -38,6 +38,16 @@ func getInterfaceName(iface net.Interface) string {
|
||||||
return iface.Name
|
return iface.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetInterfaceChannel(iface string) int {
|
||||||
|
currChannelLock.Lock()
|
||||||
|
defer currChannelLock.Unlock()
|
||||||
|
|
||||||
|
if curr, found := currChannels[iface]; found {
|
||||||
|
return curr
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
func SetInterfaceChannel(iface string, channel int) error {
|
func SetInterfaceChannel(iface string, channel int) error {
|
||||||
currChannelLock.Lock()
|
currChannelLock.Lock()
|
||||||
defer currChannelLock.Unlock()
|
defer currChannelLock.Unlock()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue