iptools

package
v0.0.0-...-5a0bf87 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2016 License: Apache-2.0, MIT Imports: 2 Imported by: 0

README

iptools

Go library providing utilities for working with hosts' IP addresses.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PrivateNetworks = []string{
	"10.0.0.0/8",
	"172.16.0.0/12",
	"192.168.0.0/16",
}

Ranges of addresses allocated by IANA for private internets, as per RFC1918.

Functions

func GetHostIPs

func GetHostIPs() ([]net.IP, error)

GetHostIPs returns a list of IP addresses of all host's interfaces.

func GetPrivateHostIPs

func GetPrivateHostIPs() ([]net.IP, error)

GetPrivateHostIPs returns a list of host's private IP addresses.

func IsPrivate

func IsPrivate(ip net.IP) bool

IsPrivate determines whether a passed IP address is from one of private blocks or not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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