This commit is contained in:
evilsocket 2018-01-13 14:42:21 +01:00
parent 383a293bf5
commit 7049cc1014
3 changed files with 13 additions and 6 deletions

6
net/arp_parser_darwin.go Normal file
View file

@ -0,0 +1,6 @@
package net
import "regexp"
var ArpTableParser = regexp.MustCompile("^[^\\d\\.]+([\\d\\.]+).+\\s+([a-f0-9:]{17})\\s+on\\s+(.+)\\s+.+$")
var ArpTableTokens = 4

6
net/arp_parser_linux.go Normal file
View file

@ -0,0 +1,6 @@
package net
import "regexp"
var ArpTableParser = regexp.MustCompile("^[^\\d\\.]+([\\d\\.]+).+\\s+([a-f0-9:]{17}).+\\s+(.+)$")
var ArpTableTokens = 4

View file

@ -1,15 +1,10 @@
package net package net
import ( import (
"regexp"
"strings"
"github.com/evilsocket/bettercap-ng/core" "github.com/evilsocket/bettercap-ng/core"
"strings"
) )
var ArpTableParser = regexp.MustCompile("^[^\\d\\.]+([\\d\\.]+).+\\s+([a-f0-9:]{17}).+\\s+(.+)$")
var ArpTableTokens = 4
func ArpUpdate(iface string) (ArpTable, error) { func ArpUpdate(iface string) (ArpTable, error) {
arp_lock.Lock() arp_lock.Lock()
defer arp_lock.Unlock() defer arp_lock.Unlock()