View Source esockd_cidr (esockd v5.9.3-rc.1)

CIDR Wiki: https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

The module is copied from inet_cidr.erl to avoid one file depencency.

Link to this section Summary

Functions

Return true if the value is an ipv4 address
Return true if the value is an ipv6 address
Check if the IP address is in the CIDR block.
Parse CIDR.

Link to this section Types

-type cidr() :: {inet:ip_address(), inet:ip_address(), 0..128}.
-type cidr_string() :: string().

Link to this section Functions

Return true if the value is an ipv4 address
Return true if the value is an ipv6 address
-spec match(inet:ip_address(), cidr()) -> boolean().
Check if the IP address is in the CIDR block.
-spec parse(string()) -> cidr().
Parse CIDR.
-spec parse(string(), boolean()) -> cidr().