mirror of
https://github.com/bettercap/bettercap
synced 2025-08-22 14:24:38 -07:00
finished the duckyscript parser
This commit is contained in:
parent
055ba917a1
commit
037d5cea22
11 changed files with 249 additions and 42 deletions
19
modules/hid/hid_show_sort.go
Normal file
19
modules/hid/hid_show_sort.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package hid
|
||||
|
||||
import (
|
||||
"github.com/bettercap/bettercap/network"
|
||||
)
|
||||
|
||||
type ByHIDMacSorter []*network.HIDDevice
|
||||
|
||||
func (a ByHIDMacSorter) Len() int { return len(a) }
|
||||
func (a ByHIDMacSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a ByHIDMacSorter) Less(i, j int) bool {
|
||||
return a[i].Address < a[j].Address
|
||||
}
|
||||
|
||||
type ByHIDSeenSorter []*network.HIDDevice
|
||||
|
||||
func (a ByHIDSeenSorter) Len() int { return len(a) }
|
||||
func (a ByHIDSeenSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a ByHIDSeenSorter) Less(i, j int) bool { return a[i].LastSeen.Before(a[j].LastSeen) }
|
Loading…
Add table
Add a link
Reference in a new issue