mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
refact: renamed package net to network to avoid collision with golang net package.
This commit is contained in:
parent
21236c257e
commit
48d27f274a
28 changed files with 298 additions and 298 deletions
|
@ -1,28 +0,0 @@
|
|||
package net
|
||||
|
||||
import (
|
||||
"net"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
var IPv4RouteParser = regexp.MustCompile("^([a-z]+)+\\s+(\\d+\\.+\\d+.\\d.+\\d)+\\s+([a-zA-z]+)+\\s+(\\d+)+\\s+(\\d+)+\\s+([a-zA-Z]+\\d+)$")
|
||||
var IPv4RouteTokens = 7
|
||||
var IPv4RouteCmd = "netstat"
|
||||
var IPv4RouteCmdOpts = []string{"-n", "-r"}
|
||||
|
||||
func IPv4RouteIsGateway(ifname string, tokens []string, f func(gateway string) (*Endpoint, error)) (*Endpoint, error) {
|
||||
ifname2 := tokens[6]
|
||||
flags := tokens[3]
|
||||
|
||||
if ifname == ifname2 && flags == "UGSc" {
|
||||
gateway := tokens[2]
|
||||
return f(gateway)
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// see Windows version to understand why ....
|
||||
func getInterfaceName(iface net.Interface) string {
|
||||
return iface.Name
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue