Show pagesourceOld revisionsBacklinksBack to top Share via Share via... Twitter LinkedIn Facebook Pinterest Telegram WhatsApp Yammer RedditRecent ChangesSend via e-MailPrintPermalink × Table of Contents esmith::util::network SYNOPSIS DESCRIPTION Functions cleanIP isValidIP isValidPort cmpIP isValidHostname AUTHOR esmith::util::network esmith::util::network - miscellaneous network utilities In a root terminal you can do the command below if you want to display the up-to-date content perldoc esmith::util::network SYNOPSIS use esmith::util::network qw(:all); or use esmith::util::network qw(the functions you want); my $ip = cleanIP($orig_ip); my $is_valid = isValidIP($ip); my $is_valid = isValidPort($port); DESCRIPTION This is a collection of generally useful functions for working with IP addresses. Functions are exported only on request. Functions cleanIP my $ip = cleanIP($orig_ip); If the $orig_ip is valid it will be cleaned up into a cannonical form, stripping any padding zeros and such. isValidIP my $is_valid = isValidIP($ip); Returns the IP given if $ip is a properly formatted IP address, undef otherwise. isValidPort my $is_valid = isValidPort($port); Returns true if $port is a properly formatted port, false otherwise. cmpIP Performs a cmp operation on two IP addresses. isValidHostname This function returns true if it is passed a valid RFC 921 hostname, false otherwise. AUTHOR Mitel Networks Corp. developer, esmith esmith/util/network.txt Last modified: 2016/01/27 16:50by Stephane de Labrusse