mirror of
https://github.com/bettercap/bettercap
synced 2025-07-15 01:23:42 -07:00
new: centralized logging and implemented DELETE /api/events route, closes #5
This commit is contained in:
parent
269d7d845b
commit
f1f146d3d7
21 changed files with 144 additions and 184 deletions
10
net/oui.go
10
net/oui.go
|
@ -17,7 +17,7 @@ func OuiInit() {
|
|||
data := string(bytes)
|
||||
lines := strings.Split(data, "\n")
|
||||
|
||||
for lineno, line := range lines {
|
||||
for _, line := range lines {
|
||||
line = strings.Trim(line, " \n\r\t")
|
||||
if len(line) == 0 || line[0] == '#' {
|
||||
continue
|
||||
|
@ -25,7 +25,6 @@ func OuiInit() {
|
|||
|
||||
parts := strings.SplitN(line, " ", 2)
|
||||
if len(parts) != 2 {
|
||||
log.Warningf("Skipping line %d '%s'\n", lineno+1, line)
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -34,8 +33,6 @@ func OuiInit() {
|
|||
|
||||
oui[prefix] = vendor
|
||||
}
|
||||
|
||||
log.Debugf("Loaded %d vendors signatures.\n", len(oui))
|
||||
}
|
||||
|
||||
func OuiLookup(mac string) string {
|
||||
|
@ -46,9 +43,6 @@ func OuiLookup(mac string) string {
|
|||
if vendor, found := oui[prefix]; found == true {
|
||||
return vendor
|
||||
}
|
||||
} else {
|
||||
log.Warningf("Unexpected mac '%s' in net.OuiLookup\n", mac)
|
||||
}
|
||||
|
||||
return "???"
|
||||
return ""
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue