netdevice

package
v0.0.0-...-b51443a Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoopListenARP

func LoopListenARP(exitSig chan int, ipInfos chan<- *IPInfo, localIP *NetDevice)

context 信号参数,output 参数

func SendARP

func SendARP(localIP *NetDevice)

Types

type IP

type IP uint32

func IPRange

func IPRange(ipNet *net.IPNet) []IP

根据IP和mask换算内网IP范围

func NewIPByBytes

func NewIPByBytes(b []byte) IP

[]byte --> IP

func NewIPByString

func NewIPByString(s string) IP

string --> IP

func (IP) String

func (ip IP) String() string

将 IP(uint32) 转换成 可读性IP字符串

type IPInfo

type IPInfo struct {
	IP       string
	Mac      net.HardwareAddr
	Hostname string
	Manuf    string
}

type IPList

type IPList []IP

IPList ,实现了sort的排序接口

func (IPList) Len

func (ip IPList) Len() int

func (IPList) Less

func (ip IPList) Less(i, j int) bool

func (IPList) Swap

func (ip IPList) Swap(i, j int)

type NetDevice

type NetDevice struct {
	// contains filtered or unexported fields
}

func LocalNetDevice

func LocalNetDevice() (*NetDevice, error)

func (*NetDevice) IPv4

func (n *NetDevice) IPv4() string

Jump to

Keyboard shortcuts

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