Documentation ¶
Index ¶
- func GetAllHosts(lanIP string) (map[string]string, error)
- func GetGateway() (string, error)
- func GetGatewayOutsideIP() (string, error)
- func GetIPv4ByInterfaceName(name string) (net.IP, error)
- func GetIPv6ByInterfaceName(name string) (string, error)
- func GetIpv4MaskByInterfaceName(name string) (net.IPMask, error)
- func GetIpv6MaskByInterfaceName(name string) (net.IPMask, error)
- func GetLocalIP() (string, error)
- func GetMyWLANMAC() (string, error)
- func GetPublicIPV4() (string, error)
- func GetPublicIPV6() (string, error)
- func GetSavedWifi() (string, error)
- func GetWLANDefaultGateway() (string, error)
- func GetWifiName() (string, error)
- func GetWifiPassword(wifiname string) (string, error)
- func Get_client() (http.Client, error)
- func HexMaskToColonMask(hexMask string) string
- func HexMaskToDotMask(hexMask string) string
- func NetWorkStatus() bool
- func PingAll(srcIP string) error
- func PingToUpdateARP(ip string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllHosts ¶
获取局域网内所有主机IP与MAC地址(通过ping命令更新arp表,不包含自己), 通过LanIP获取局域网IP段,通过PingAll更新arp表。 返回map[ip]mac。 更好的通用方法https://studygolang.com/articles/1202 https://github.com/mnhkahn/go_code/blob/master/fing.go
func GetGateway ¶
获取网关地址 还可以通过构建ICMP报文实现路由追踪(traceroute),记录访问某个网站经过的路径,那么第一条路径就是访问路由器
func GetIPv4ByInterfaceName ¶
获取指定网卡的ipv4地址,如WLAN
func GetIPv6ByInterfaceName ¶
获取指定网卡的ipv6地址,如WLAN
func GetIpv4MaskByInterfaceName ¶
获取指定网卡的ipv4子网掩码
func GetIpv6MaskByInterfaceName ¶
获取指定网卡的ipv6子网掩码
func GetLocalIP ¶
func GetPublicIPV4 ¶
func GetPublicIPV6 ¶
func HexMaskToColonMask ¶
转换十六进制的子网掩码为冒号分隔的十六进制(请确保传入的是十六进制的子网掩码)
func HexMaskToDotMask ¶
转换十六进制的子网掩码为点分十进制(请确保传入的是十六进制的子网掩码)
func NetWorkStatus ¶
func NetWorkStatus() bool
func PingToUpdateARP ¶
func PingToUpdateARP(ip string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.