utilsNetworkConvert

package
v0.0.0-...-7ec6a99 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DelimiterDash  = "-"
	DelimiterColon = ":"
)

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 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

func MadAddressSplit

func MadAddressSplit(mac string, deli string) string

func NetmaskToBitlen

func NetmaskToBitlen(netmask string) int

func ReverseIPv4

func ReverseIPv4(ip string) string

把IPV4地址进行反转

func ReverseIPv4Int

func ReverseIPv4Int(intip int64) string

把IPV4地址进行反转

Types

This section is empty.

Jump to

Keyboard shortcuts

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