utils

package
Version: v3.3.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressAndMaskToIPv4

func AddressAndMaskToIPv4(address uint32, mask uint32) string

AddressAndMaskToIPv4 converts an ipv4 address and a prefix (both uint32 values) into a string in format 'x.y.z.w/q'

func Ipv4CidrToAddressAndMask

func Ipv4CidrToAddressAndMask(ip string) (uint32, uint32, error)

Ipv4CidrToAddressAndMask converts an ipv4 CIDR address in form '1.2.3.4/12' to corresponding uint32 representations of the address and the mask

func Ipv4ToUint32

func Ipv4ToUint32(ipv4Address string) (uint32, error)

Ipv4ToUint32 converts an ipv4 address in form '1.2.3.4' to an uint32 representation of the address.

func MaskLength2Mask

func MaskLength2Mask(ml int) uint32

MaskLength2Mask will tank in an int and return the bit mask for the number given

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL