iputils

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

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

Go to latest
Published: Nov 17, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToInt

func BytesToInt(bs []byte) (i int)

BytesToInt example [128 14 32 0] -> 2148409344

func BytesToIp4

func BytesToIp4(bs []byte) (s string)

BytesToIp4 example [128 14 32 0] -> 128.14.32.0

func BytesToIp6

func BytesToIp6(bs []byte) (s string)

BytesToIp6 example [254 128 0 0 9 130 42 92 0 0 0 0 0 0 255 255] -> fe80:0:982:2a5c:0:0:0:ffff

func Cidr4ToIps

func Cidr4ToIps(s string) (ips []string, err error)

Cidr4ToIps example 128.14.35.7/20 -> [128.14.32.0 ~ 128.14.47.255]

func Cidr4ToIpsClean

func Cidr4ToIpsClean(s string) (ips []string, err error)

Cidr4ToIpsClean example 128.14.35.7/20 -> [128.14.32.1 ~ 128.14.47.254]

func Cidr6ToIps

func Cidr6ToIps(s string) (ips []string, err error)

Cidr6ToIps example fe80:0:982:2a5c:0:0:0:ffff/127 -> [fe80:0:982:2a5c:0:0:0:fffe ~ fe80:0:982:2a5c:0:0:0:ffff]

func Cidr6ToIpsClean

func Cidr6ToIpsClean(s string) (ips []string, err error)

Cidr6ToIpsClean example fe80:0:982:2a5c:0:0:0:ffff/127 -> [fe80:0:982:2a5c:0:0:0:fffe]

func IntToBytes

func IntToBytes(n int) []byte

IntToBytes example 2148409344 -> [128 14 32 0]

func IntToIp4

func IntToIp4(i int) (s string)

IntToIp4 example 2148409344 -> 128.14.32.0

func Ip4ToBytes

func Ip4ToBytes(s string) (bs []byte)

Ip4ToBytes example 128.14.32.0 -> [128 14 32 0]

func Ip4ToInt

func Ip4ToInt(s string) (i int)

Ip4ToInt example 128.14.32.0 -> 2148409344

func Ip6ToBytes

func Ip6ToBytes(s string) (bs []byte)

Ip6ToBytes example fe80:0:982:2a5c:0:0:0:ffff -> [254 128 0 0 9 130 42 92 0 0 0 0 0 0 255 255]

Types

This section is empty.

Jump to

Keyboard shortcuts

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