The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::ACL::Match::IP - Class matching IP addresses against an IP or network

SYNOPSIS

    use Net::ACL::Match::IP;

    # Constructor
    $match = new Net::ACL::Match::IP('10.0.0.0/8');
    $match = new Net::ACL::Match::IP('#1','10.0.0.0/8'); # $match->index(1);
                
    # Accessor Methods
    $netmaskobj = $match->net($netmaskobj);
    $netmaskobj = $match->net($net);
    $index = $match->index($index);
    $rc = $match->match($ip);

DESCRIPTION

This module is just a wrapper of the Net::Netmask module to allow it to operate automaticly with Net::ACL::Rule.

CONSTRUCTOR

new() - create a new Net::ACL::Match::IP object

    $match = new Net::ACL::Match::IP('10.0.0.0/8');

This is the constructor for Net::ACL::Match::IP objects. It returns a reference to the newly created object. Any arguments is parsed directly to the constructor of Net::Netmask. One exception is that if the first argument is number prefixed with a #, the number is interpreted as the index in the array given to the match method that should be matched.

ACCESSOR METHODS

net()

The net method returns the Net::Netmask object representing the network matched. If called with a Net::Netmask object, the net used for matching is changed to that object. If called with a anything else, the Net::Netmask constructor will be used to convert it to a Net::Netmask object.

index()

The index method returns the index of the argument that will be matched. If called with an argument, the index is changed to that argument.

match()

The match method invoke the match method of the Net::Netmask object constructed by new. The index value defines which argument is passed on to new.

SEE ALSO

Net::Netmask, Net::ACL, Net::ACL::Rule, Net::ACL::Match

AUTHOR

Martin Lorensen <bgp@martin.lorensen.dk>