This shows you the differences between two versions of the page.
esmith:util:network [2015/05/22 08:29] stephdl [SYNOPSIS] |
esmith:util:network [2019/06/05 19:48] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== esmith:: | ||
- | esmith:: | ||
- | In a root terminal you can do the command below if you want to display the up-to-date content | ||
- | | ||
- | ===== SYNOPSIS ===== | ||
- | use esmith:: | ||
- | or | ||
- | use esmith:: | ||
- | | ||
- | my $ip = cleanIP($orig_ip); | ||
- | |||
- | ===== 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. | ||
- | |||
- | ==== isValidEmail ==== | ||
- | This validation function validates an email address, using the Mail:: | ||
- | |||
- | If you don't wish to permit local addresses, pass the permitlocal option as false. | ||
- | |||
- | | ||
- | esmith:: | ||
- | |||
- | ==== AUTHOR ==== | ||
- | Mitel Networks Corp. | ||
- | {{tag> neth-development sme-development }} | ||