Difference between revisions of "Esmith::util::network"

From SME Server
Jump to navigationJump to search
(Created page with "NAME esmith::util::network - miscellaneous network utilities SYNOPSIS use esmith::util::network qw(the functions you want); my $ip = cleanIP($orig...")
 
Line 1: Line 1:
NAME
+
== NAME ==
      esmith::util::network - miscellaneous network utilities
+
esmith::util::network - miscellaneous network utilities
  
SYNOPSIS
+
== SYNOPSIS ==
      use esmith::util::network qw(the functions you want);
+
use esmith::util::network qw(the functions you want);
  
      my $ip      = cleanIP($orig_ip); my $is_valid = isValidIP($ip); my $is_valid = isValidPort($port);
+
my $ip      = cleanIP($orig_ip); my $is_valid = isValidIP($ip); my $is_valid = isValidPort($port);
  
DESCRIPTION
+
== DESCRIPTION ==
      This is a collection of generally useful functions for working with IP addresses.
+
This is a collection of generally useful functions for working with IP addresses.
  
      Functions are exported only on request.
+
Functions are exported only on request.
  
      Functions
+
=== Functions ===
  
      cleanIP
+
==== cleanIP ====
 
           my $ip = cleanIP($orig_ip);
 
           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.
+
If the $orig_ip is valid it will be cleaned up into a cannonical form, stripping any padding zeros and such.
  
      isValidIP
+
==== isValidIP ====
 
           my $is_valid = isValidIP($ip);
 
           my $is_valid = isValidIP($ip);
  
          Returns the IP given if $ip is a properly formatted IP address, undef otherwise.
+
Returns the IP given if $ip is a properly formatted IP address, undef otherwise.
  
      isValidPort
+
==== isValidPort ====
 
           my $is_valid = isValidPort($port);
 
           my $is_valid = isValidPort($port);
  
          Returns true if $port is a properly formatted port, false otherwise.
+
Returns true if $port is a properly formatted port, false otherwise.
  
      cmpIP
+
==== cmpIP ====
          Performs a cmp operation on two IP addresses.
+
Performs a cmp operation on two IP addresses.
  
      isValidHostname
+
==== isValidHostname ====
          This function returns true if it is passed a valid RFC 921 hostname, false otherwise.
+
This function returns true if it is passed a valid RFC 921 hostname, false otherwise.
  
      isValidEmail
+
==== isValidEmail ====
          This validation function validates an email address, using the Mail::RFC822::Address module. Additionally, by default, it permits a local address instead of a fully-qualified remote address,
+
This validation function validates an email address, using the Mail::RFC822::Address module. Additionally, by default, it permits a local address instead of a fully-qualified remote address, even checking the existence of said user in the accounts db.
          even checking the existence of said user in the accounts db.
 
  
          If you don't wish to permit local addresses, pass the permitlocal option as false.
+
If you don't wish to permit local addresses, pass the permitlocal option as false.
  
          ie. esmith::util::isValidEmail($address, { permitlocal => 0 })
+
ie. esmith::util::isValidEmail($address, { permitlocal => 0 })
  
AUTHOR
+
== AUTHOR ==
      Mitel Networks Corp.
+
Mitel Networks Corp.
 
[[Category:Developer]]
 
[[Category:Developer]]
 
[[Category:SME Server Development Framework]]
 
[[Category:SME Server Development Framework]]
 
[[Category:Development Tools]]
 
[[Category:Development Tools]]

Revision as of 19:22, 31 December 2013

NAME

esmith::util::network - miscellaneous network utilities

SYNOPSIS

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.

isValidEmail

This validation function validates an email address, using the Mail::RFC822::Address module. Additionally, by default, it permits a local address instead of a fully-qualified remote address, even checking the existence of said user in the accounts db.

If you don't wish to permit local addresses, pass the permitlocal option as false.

ie. esmith::util::isValidEmail($address, { permitlocal => 0 })

AUTHOR

Mitel Networks Corp.