package
0.0.0-20241210054802-24370beab758
Repository: https://github.com/kubernetes/utils.git
Documentation: pkg.go.dev
# Packages
Package ebtables allows to control the ebtables Linux-based bridging firewall.
# Functions
AddIPOffset adds the provided integer offset to a base big.Int representing a net.IP NOTE: If you started with a v4 address and overflow it, you get a v6 result.
BigForIP creates a big.Int based on the provided net.IP.
GetIndexedIP returns a net.IP that is subnet.IP + index in the contiguous IP space.
IPFamilyOf returns the IP family of ip, or IPFamilyUnknown if it is invalid.
IPFamilyOfCIDR returns the IP family of cidr.
IPFamilyOfCIDRString returns the IP family of cidr.
IPFamilyOfString returns the IP family of ip, or IPFamilyUnknown if ip cannot be parsed as an IP.
IsDualStackCIDRs returns true if: - all elements of cidrs are non-nil - at least one CIDR from each family (v4 and v6) is present.
IsDualStackCIDRStrings returns if - all elements of cidrs can be parsed as CIDRs - at least one CIDR from each family (v4 and v6) is present.
IsDualStackIPs returns true if: - all elements of ips are valid - at least one IP from each family (v4 and v6) is present.
IsDualStackIPStrings returns true if: - all elements of ips can be parsed as IPs - at least one IP from each family (v4 and v6) is present.
IsIPv4 returns true if netIP is IPv4 (and false if it is IPv6, nil, or invalid).
IsIPv4CIDR returns true if cidr is a valid IPv4 CIDR.
IsIPv4CIDRString returns true if cidr contains a single IPv4 CIDR and nothing else.
IsIPv4String returns true if ip contains a single IPv4 address and nothing else.
IsIPv6 returns true if netIP is IPv6 (and false if it is IPv4, nil, or invalid).
IsIPv6CIDR returns true if a cidr is a valid IPv6 CIDR.
IsIPv6CIDRString returns true if cidr contains a single IPv6 CIDR and nothing else.
IsIPv6String returns true if ip contains a single IPv6 address and nothing else.
MultiListen returns net.Listener which can listen on and accept connections for the given network on multiple addresses.
NewLocalPort returns a LocalPort instance and ensures IPFamily and IP are consistent and that the given protocol is valid.
ParseCIDRs parses a list of cidrs and return error if any is invalid.
ParseIPNets parses string slice to IPNetSet.
ParseIPSet parses string slice to IPSet.
ParsePort parses a string representing an IP port.
RangeSize returns the size of a range in valid addresses.
# Constants
Constants for valid IPFamilys:.
Constants for valid IPFamilys:.
Constants for valid IPFamilys:.
Constants for valid protocols:.
Constants for valid protocols:.
# Variables
ListenPortOpener opens ports by calling bind() and listen().
ParseCIDRSloppy is identical to Go's standard net.ParseCIDR, except that it allows leading '0' characters on numbers.
ParseIPSloppy is identical to Go's standard net.ParseIP, except that it allows leading '0' characters on numbers.
# Structs
LocalPort represents an IP address and port pair along with a protocol and potentially a specific IP family.
# Interfaces
Closeable closes an opened LocalPort.
PortOpener can open a LocalPort and allows later closing it.