Checks whether an IP address has version number 4.
is_v4(x:ip) -> boolDescription
Section titled “Description”The ipv4 function checks whether the version number of a given IP address x
is 4.
Examples
Section titled “Examples”Check if an IP is IPv4
Section titled “Check if an IP is IPv4”from { x: 1.2.3.4.is_v4(), y: ::1.is_v4(),}{ x: true, y: false,}See Also
Section titled “See Also”is_v6,
is_multicast,
is_loopback,
is_private,
is_global,
is_link_local,
ip_category