new: added interface name and channel on wifi.show

This commit is contained in:
evilsocket 2019-01-19 18:03:31 +01:00
parent f71df54950
commit bf34561a19
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
2 changed files with 13 additions and 1 deletions

View file

@ -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("↓"),

View file

@ -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()