.TH "md_src_plugins_network_README" 3elektra "Sun May 29 2016" "Version 0.8.14" "Elektra" \" -*- nroff -*- .ad l .nh .SH NAME md_src_plugins_network_README \- README .IP "\(bu" 2 infos = Information about network plugin is in keys below .IP "\(bu" 2 infos/author = Markus Raab elektra@libelektra.org .IP "\(bu" 2 infos/licence = BSD .IP "\(bu" 2 infos/needs = .IP "\(bu" 2 infos/provides = check .IP "\(bu" 2 infos/placements = presetstorage .IP "\(bu" 2 infos/description = Checks keys if they contain a valid ip address .PP .PP This plugin is a check plugin that checks if a key contains a valid ip address\&. It uses the \fCPOSIX\&.1-2001\fP interface \fCgetaddrinfo()\fP in order to check if an ip address is valid\&. .PP .SS "Purpose" .PP While, in theory, a regular expression can express if a string is a network address, in practice, such an attempt does not work well\&. The reason is that an unmanageable number of valid shortenings for IPv6 addresses makes the regular expression hard to write and understand\&. .PP So the idea of building such a complicated regular expression was discarded, but instead a dedicated checker was introduced\&. The idea is to use the operating system facilities to resolve the network address\&. If this succeeds, it is guaranteed that this network address will be valid when it is resolved by the same interface afterwards\&. .PP Many network address translators coexist\&. In \fCPOSIX\&.1-2001\fP a powerful address translator is provided with the interface \fCgetaddrinfo()\fP\&. It is a common network address translation for both IPv4 and IPv6\&. We used it to implement this plugin\&.