mirror of
https://github.com/bettercap/bettercap
synced 2025-07-11 15:46:59 -07:00
new: several improvements to the new.show u
This commit is contained in:
parent
646c5d14c7
commit
7abb3cbb2c
5 changed files with 135 additions and 104 deletions
|
@ -8,9 +8,15 @@ import (
|
|||
|
||||
type ByAddressSorter []*net.Endpoint
|
||||
|
||||
func (a ByAddressSorter) Len() int { return len(a) }
|
||||
func (a ByAddressSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a ByAddressSorter) Less(i, j int) bool { return a[i].IpAddressUint32 < a[j].IpAddressUint32 }
|
||||
func (a ByAddressSorter) Len() int { return len(a) }
|
||||
func (a ByAddressSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a ByAddressSorter) Less(i, j int) bool {
|
||||
if a[i].IpAddressUint32 == a[j].IpAddressUint32 {
|
||||
return a[i].HwAddress < a[j].HwAddress
|
||||
} else {
|
||||
return a[i].IpAddressUint32 < a[j].IpAddressUint32
|
||||
}
|
||||
}
|
||||
|
||||
type BySeenSorter []*net.Endpoint
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue