IP Network functions

Introduced in release: 1.12.

A set of functions for common computations on IP network addresses.

Function Output Description
inet_aton() INT Converts an IPv4 address into an integer
inet_ntoa( ) VARCHAR Converts an integer IP into dotted decimal notation
in_network( , ) BOOLEAN Returns true if the IP address is in the given CIDR block
address_count( ) INT Returns the number of IPs in a given CIDR block
broadcast_address( ) VARCHAR Returns the broadcast address for a given CIDR block
netmask( ) VARCHAR Returns the netmask for a given CIDR block
low_address() VARCHAR Returns the first address in a given CIDR block
high_address() VARCHAR Returns the last address in a given CIDR block
url_encode( ) VARCHAR Returns a URL encoded string
url_decode( ) VARCHAR Decodes a URL encoded string
is_valid_IP() BOOLEAN Returns true if the IP is a valid IP address
is_private_ip() BOOLEAN Returns true if the IP is a private IPv4 address
is_valid_IPv4() BOOLEAN Returns true if the IP is a valid IPv4 address
is_valid_IPv6() BOOLEAN Returns true if the IP is a valid IPv6 address