networkutils

package
v0.0.0-...-bb0df7c Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SingleTenantPluginName  = "redhat/openshift-ovs-subnet"
	MultiTenantPluginName   = "redhat/openshift-ovs-multitenant"
	NetworkPolicyPluginName = "redhat/openshift-ovs-networkpolicy"
)

Variables

This section is empty.

Functions

func IsPrivateAddress

func IsPrivateAddress(addr string) bool

IsPrivateAddress returns true if given address in format "<host>[:<port>]" is a localhost or an ip from private network range (e.g. 172.30.0.1, 192.168.0.1).

func ParseCIDRMask

func ParseCIDRMask(cidr string) (*net.IPNet, error)

ParseCIDRMask parses a CIDR string and ensures that it has no bits set beyond the network mask length. Use this when the input is supposed to be either a description of a subnet (eg, "192.168.1.0/24", meaning "192.168.1.0 to 192.168.1.255"), or a mask for matching against (eg, "192.168.1.15/32", meaning "must match all 32 bits of the address "192.168.1.15"). Use net.ParseCIDR() when the input is a host address that also describes the subnet that it is on (eg, "192.168.1.15/24", meaning "the address 192.168.1.15 on the network 192.168.1.0/24").

Types

This section is empty.

Jump to

Keyboard shortcuts

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