nethelper

package
v1.11.0-RC1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CIDRSubnet

func CIDRSubnet(cidr string) (string, error)

CIDRSubnet will return the IPMask in decimal format e.g. 192.0.2.1/24 will return ("24", nil)

func GetAvailableIPs

func GetAvailableIPs(cidr string, reqdCount int) ([]string, error)

GetAvailableIPs provides IPs that are available in the passed cidr network address range.

The parameter `reqdCount` specifies the number of IP addresses to be returned.

TODO IMPORTANT Check if these channels leak ? Do we need to close them ?

func IPs

func IPs(cidr string) ([]string, error)

IPs accepts a network address in CIDR notation and returns a list of IP address.

NOTE:

The returned list removes the network & broadcast addresses

func IsCIDR

func IsCIDR(cidr string) bool

IsCIDR validates if passed argument i.e. cidr is actually in CIDR format

Types

type Pong

type Pong struct {
	IP    string
	Alive bool
}

Pong is a structure to hold the results of the network ping of an ip

Jump to

Keyboard shortcuts

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