finished the duckyscript parser

This commit is contained in:
evilsocket 2019-02-20 17:54:44 +01:00
commit 037d5cea22
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
11 changed files with 249 additions and 42 deletions

View 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) }