mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 05:53:20 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
5652d15426
commit
8446d66d12
2 changed files with 37 additions and 40 deletions
|
@ -16,7 +16,7 @@ func addIfMatches(to *[]string, prefix string, what string) {
|
|||
}
|
||||
}
|
||||
|
||||
func (s *Session) LANCompleter(prefix string) []string {
|
||||
func (s *Session) LANCompleterForMacs(prefix string) []string {
|
||||
macs := []string{""}
|
||||
s.Lan.EachHost(func(mac string, e *network.Endpoint) {
|
||||
addIfMatches(&macs, prefix, mac)
|
||||
|
@ -24,6 +24,14 @@ func (s *Session) LANCompleter(prefix string) []string {
|
|||
return macs
|
||||
}
|
||||
|
||||
func (s *Session) LANCompleterForIPs(prefix string) []string {
|
||||
ips := []string{""}
|
||||
s.Lan.EachHost(func(mac string, e *network.Endpoint) {
|
||||
addIfMatches(&ips, prefix, e.IpAddress)
|
||||
})
|
||||
return ips
|
||||
}
|
||||
|
||||
func (s *Session) WiFiCompleter(prefix string) []string {
|
||||
macs := []string{""}
|
||||
s.WiFi.EachAccessPoint(func(mac string, ap *network.AccessPoint) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue