network

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaskRegex = "" /* 193-byte string literal not displayed */
)

Variables

This section is empty.

Functions

func CheckCidrContain

func CheckCidrContain(cidr1, cidr2 string) (contain bool, err error)

func GetExternalIPFromIPSB

func GetExternalIPFromIPSB() string

GetExternalIPFromIPSB get external ip to ip.sb

func IP4toInt

func IP4toInt(IPv4Address net.IP) int64

func MasktoInt

func MasktoInt(mask net.IPMask) int64

Converts IP mask to 16 bit int.

func ValidateIPAndMask

func ValidateIPAndMask(ipAndMask string) error

Types

type DeviceInfo

type DeviceInfo struct {
	DeviceName        string
	DeviceDescription string
	IPAddr            []string
}

DeviceInfo device info list all network interface on host

func ListDeviceNames

func ListDeviceNames() (devList []DeviceInfo, err error)

ListDeviceNames returns the list of adapters available for sniffing on this computer. If the withDescription parameter is set to true, a human readable version of the adapter name is added. If the withIP parameter is set to true, IP address of the adapter is added.

Jump to

Keyboard shortcuts

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