go-cidr-manager/ipv4cidr
Naman Maheshwari 781046e185 Fixing test success condition 2020-07-08 22:26:32 +05:30
..
consts Initial code commit 2020-07-08 16:32:10 +05:30
utils Fixing test success condition 2020-07-08 22:26:32 +05:30
README.md Fixed missing quote in import statement in Readme 2020-07-08 16:48:14 +05:30
ipv4cidr.go Import path contains github URL 2020-07-08 16:59:07 +05:30
ipv4cidr_test.go Import path contains github URL 2020-07-08 16:59:07 +05:30

README.md

IPv4 CIDR Manager

The package IPv4CIDR contains utilities to perform the following operations:

  1. Parse a string representing the CIDR block
    • Take a single IP address as input
    • Take a CIDR block in a standard notation where the IP part of the IP/CIDR range is the first IP address in the CIDR block
    • Take a non-standard CIDR block and enable a standardize flag to convert it to the standard notation
  2. Split the CIDR block into two halves
  3. Get the following information from the CIDR block
    • Convert to string
    • Get the IP part of the block representation
    • Get the CIDR mask part of the block representation
    • Get the nth IP address in range
    • Get the netmask
    • Get the size of the CIDR block

To Use

Import the package into your code using:

import "github.com/microsoft/go-cidr-manager/ipv4cidr"