utils

package
Version: v0.0.0-...-14a808c Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckStandardized

func CheckStandardized(ip uint32, netmask uint32) error

CheckStandardized checks if the IP stored in object is the first IP in range or not @input ip uint32: The IP address in integer representation @input netmask uint32: The netmask of the CIDR range @returns error: If not the first IP in range, an error is returned. Else, return value is nil

func ConvertIPToString

func ConvertIPToString(ip uint32) string

ConvertIPToString converts an integer IP address to its string representation @param ip uint32: IP address in integer representation @returns string: IP address in string representation

func GetCIDRRangeLength

func GetCIDRRangeLength(mask uint8) uint32

GetCIDRRangeLength calculates the number of IP addresses in that CIDR range @input mask uint8: The mask for the CIDR range @returns uint32: The length of the CIDR range

func GetNetmask

func GetNetmask(mask uint8) uint32

GetNetmask takes the mask number as input and creates the netmask from it @input mask uint8: The mask for the CIDR range @returns uint32: The integer representation of the netmask

func Standardize

func Standardize(ip uint32, netmask uint32) uint32

Standardize converts the IP to the first IP address of the CIDR range @input ip uint32: The IP address in integer representation @input netmask uint32: The netmask of the CIDR range @returns uint32: First IP in CIDR range

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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