package
module
Version:
v0.1.1
Opens a new window with list of versions in this module.
Published: Apr 19, 2024
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
README
¶
netmath
Helper functions and methods built on top of the net/netip standard Go libraries for sub/network based calculations
netmath documentation
Use netmath from the CLI: snet-cli
Documentation
¶
Network stuct based on netip.Prefix to add custom methods
Create a new Subnet from a netip.Prefix
Parse an IP and Subnet Mask in the long <ip-address>, <subnet-mask> format
Parse an abbreviated IP and Subnet mask in the <ip-address>/<bits> format
Get the Broadcast address of the network ex. 192.168.20.15/23 -> 192.168.21.255
Count the number of total hosts in the subnet. (You can subtract two from the result for the usable hosts)
List all of the neighboring subnets that use the same mask
Get the Network mask of the network
Get the Network address of the network ex. 192.168.20.15/23 -> 192.168.20.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.