[#20862] Add functions to validate ipv4 and ipv6 addresses

Plenty of software out there still supports IPv4 only, and it’s helpful to make sure that the bind addresses given to modules are of a certain class of IP.