network

package
v0.0.0-...-6064506 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteArrToStr

func ByteArrToStr(byteArr []byte) string

Types

type Mask

type Mask struct {
	Decimal uint8
	Dotted  []byte
}

Mask is just a tidy way of storing a netmask

func CidrToMask

func CidrToMask(cidr uint8) Mask

CidrToMask converts a slash netmask to a Mask struct

func DottedToMask

func DottedToMask(dotted []byte) Mask

DottedToMask converts a dotted netmask to a Mask struct

type NetworkInfo

type NetworkInfo struct {
	Address        []uint8
	Netmask        Mask
	Wildcard       []uint8
	Network        []uint8
	Broadcast      []uint8
	HostMinAddress []uint8
	HostMaxAddress []uint8
	HostsQuantity  uint32
}

NetworkInfo contains the result of the CalculateNetwork function

func CalculateNetwork

func CalculateNetwork(ip string, subnet string) NetworkInfo

CalculateNetwork calculates all the infos of a given network

Jump to

Keyboard shortcuts

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