v0.0.0-...-4693a02 Latest Latest

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

Go to latest
Published: Mar 10, 2024 License: Apache-2.0, BSD-3-Clause Imports: 1 Imported by: 0




View Source
const IPv4len = stdnet.IPv4len
View Source
const IPv6len = stdnet.IPv6len


View Source
var CIDRMask = stdnet.CIDRMask
View Source
var IPv4 = stdnet.IPv4


func ParseCIDR

func ParseCIDR(s string) (IP, *IPNet, error)

ParseCIDR parses s as a CIDR notation IP address and prefix length, like "" or "2001:db8::/32", as defined in RFC 4632 and RFC 4291.

It returns the IP address and the network implied by the IP and prefix length. For example, ParseCIDR("") returns the IP address and the network


type IP

type IP = stdnet.IP

func ParseIP

func ParseIP(s string) IP

ParseIP parses s as an IP address, returning the result. The string s can be in IPv4 dotted decimal (""), IPv6 ("2001:db8::68"), or IPv4-mapped IPv6 ("::ffff:") form. If s is not a valid textual representation of an IP address, ParseIP returns nil.

type IPNet

type IPNet = stdnet.IPNet

type ParseError

type ParseError = stdnet.ParseError

Jump to

Keyboard shortcuts

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