netutil

package
v1.3.5-alpha0802 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DarwinGetawayExtractorRe   = regexp2.MustCompile(`gateway: ([\[\]0-9a-fA-TaskFunc:\.]+)`, regexp2.IgnoreCase|regexp2.Multiline)
	DarwinInterfaceExtractorRe = regexp2.MustCompile(`interface: ([^\s]+)`, regexp2.IgnoreCase|regexp2.Multiline)
)

Functions

func FindInterfaceByIP

func FindInterfaceByIP(ip string) (net.Interface, error)

func GetPublicRoute added in v1.2.5

func GetPublicRoute() (*net.Interface, net.IP, net.IP, error)

func IsPrivateIPString

func IsPrivateIPString(target string) bool

func Route

func Route(timeout time.Duration, target string) (iface *net.Interface, gateway, preferredSrc net.IP, err error)

Types

type GrokResult

type GrokResult map[string][]string

func Grok

func Grok(line string, rule string) GrokResult

func (GrokResult) Get

func (g GrokResult) Get(key string) string

func (GrokResult) GetAll

func (g GrokResult) GetAll(key string) []string

func (GrokResult) GetOr

func (g GrokResult) GetOr(key string, value string) string

Directories

Path Synopsis
Originally found in https://github.com/google/gopacket/blob/master/routing/routing.go
Originally found in https://github.com/google/gopacket/blob/master/routing/routing.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL