cidrtool

package module
v0.0.0-...-1197bf1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2018 License: MIT Imports: 3 Imported by: 0

README

cidrtool

This project is a sample project that houses a few functions that make working with CIDR notation a little easier.

How to use

Install the command line tool using go's tool chain:

# optionally add go's bin path to your $PATH
export $PATH=$GOPATH/bin:$PATH

# install cidrc
go install github.com/chuckha/cidrtool/cmd/cidrc

$ cidrc 192.168.1.1/16
Input: 192.168.1.1/16
Lowest IP: 192.168.0.0
Highest IP: 192.168.255.255

Documentation

Overview

A package for exploring various ways to work with ipv4 ip addresses. All references to IP is implied ipv4.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPToInt

func IPToInt(ip string) (int, error)

IPToInt converts an IP address (x.x.x.x) to a decimal based integer.

func IPToString

func IPToString(ip int) string

IPToString converts an integer to a regular looking IP address.

func Lower

func Lower(ip, cidr int) int

Lower finds the lowest address in an ipv4 block.

func Upper

func Upper(ip, cidr int) int

Upper returns the highest address in an ipv4 block.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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