ipcalc

package module
v0.0.0-...-c14ccfa Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

ipcalc

IP network calculator

Get Netmask Range from IP and Netmask

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrToBinary

func AddrToBinary(addr [4]byte) uint32

func BinaryToAddr

func BinaryToAddr(addr uint32) netip.Addr

func CIDRNetmask

func CIDRNetmask(maskBits int) netip.Addr

func MaximumAddresses

func MaximumAddresses(maskBits int) int

func MaximumSubnets

func MaximumSubnets(maskBits int) int

func NetmaskStringToBits

func NetmaskStringToBits(mask string) int

func NetmaskToBits

func NetmaskToBits(mask netip.Addr) int

func WildcardMask

func WildcardMask(maskBits int) netip.Addr

Types

type CIDR

type CIDR struct {
	Address          netip.Addr
	Bits             int
	Netmask          netip.Addr
	WildcardMask     netip.Addr
	MaximumSubnets   int
	MaximumAddresses int
	NetworkAddress   netip.Addr
	BroadcastAddress netip.Addr
}

func CIDRAddress

func CIDRAddress(addr string, bits int) CIDR

func CIDRAddressFromString

func CIDRAddressFromString(cidr string) CIDR

Jump to

Keyboard shortcuts

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