vnetwork

package
v0.0.0-...-0b57644 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NetPrivate = []string{
		"10.0.0.0/8",
		"172.16.0.0/12",
		"192.168.0.0/16",
	}
)

Functions

func CalcIPv4Network

func CalcIPv4Network(ip string, masklen int64) string

func GetLocalIP

func GetLocalIP() (ips []string)

func GetLocalMacAddrs

func GetLocalMacAddrs() (macAddrs []string)

func GetMaskLen

func GetMaskLen(netmask string) int

获取Cidr的掩码

func IPv4ToInt

func IPv4ToInt(ip string) (intip uint64)

把IPv4转成10进制表示的数值

func IntIPv4ToStr

func IntIPv4ToStr(intip uint64) (ip string)

把10进制表示IP转成IPv4字符串表达

func IsIPv4

func IsIPv4(ip string) bool

判断是否为IPv4地址

func IsPrivate

func IsPrivate(ip string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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