Documentation ¶
Index ¶
- func AddrAdd(name string, addr string) error
- func AddrDel(name string, addr string) error
- func GetAllIps() (cidrs []*net.IPNet, err error)
- func GetInterface(name string) (iface net.Interface, err error)
- func GetIps(name string) (cidrs []*net.IPNet, err error)
- func GetLocalInterface(ifname string) (ip net.IP, mask net.IPMask, mac net.HardwareAddr, err error)
- func GetMac(ifname string) (mac net.HardwareAddr, err error)
- func LinkDel(name string) error
- func LinkSetHardwareAddr(name string, mac net.HardwareAddr) error
- func LinkSetUp(name string) error
- func LoAddrClear() error
- func RandAddrAdd(iface string) (out *net.IPNet, err error)
- func RandomCIDR() (cidr *net.IPNet, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInterface ¶ added in v0.0.3
获取本地网卡
func GetLocalInterface ¶
根据网卡名,获取网卡的ip、mask、mac。其中ip、mask默认只获取第一个。
func GetMac ¶ added in v0.0.2
func GetMac(ifname string) (mac net.HardwareAddr, err error)
根据网卡名,获取网卡的mac。
func LinkSetHardwareAddr ¶ added in v0.0.3
func LinkSetHardwareAddr(name string, mac net.HardwareAddr) error
修改网卡mac
func RandAddrAdd ¶ added in v0.0.3
给网卡添加一个随机的cidr
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.