Documentation ¶
Overview ¶
Package netutil contains extensions to the net package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckRelayIP ¶
CheckRelayIP reports whether an IP relayed from the given sender IP is a valid connection target.
There are four rules:
- Special network addresses are never valid.
- Loopback addresses are OK if relayed by a loopback host.
- LAN addresses are OK if relayed by a LAN host.
- All other addresses are always acceptable.
func IsSpecialNetwork ¶
IsSpecialNetwork reports whether an IP is located in a special-use network range This includes broadcast, multicast and documentation addresses.
func IsTemporaryError ¶
IsTemporaryError checks whether the given error should be considered temporary.
Types ¶
type Netlist ¶
Netlist is a list of IP networks.
func ParseNetlist ¶
ParseNetlist parses a comma-separated list of CIDR masks. Whitespace and extra commas are ignored.
Click to show internal directories.
Click to hide internal directories.