NAME

Net::ACL::File - Access-lists constructed from configuration file like syntax.

SYNOPSIS

use Net::ACL::File;

Net::ACL::File->add_listtype('community-list', __PACKAGE__,'ip community-list');

# Construction
$config = "ip community-list 4 permit 65001:1\n";
$list_hr = load Net::ACL::File($config);

$list = renew Net::ACL(Type => 'community-list', Name => 4);
$config = $list->asconfig;

DESCRIPTION

This module extends the Net::ACL class with a load constructor that loads one or more objects from a Cisco-like configuration file using Cisco::Reconfig.

CONSTRUCTOR

load() - Load one or more Net::ACL objects from a configuration string.
$list_hr = load Net::ACL::File($config);

This special constructor parses a Cisco-like router configuration.

The constructor takes one argument which should either be a string or a Cisco::Reconfig object.

It returns a hash reference. The hash is indexed on list-types. Currently supporting the following:

community-list
as-path-list
prefix-list
access-list
route-map

Each list-type hash value contains a new hash reference indexed on list names or numbers.

CLASS METHODS

add_listtype()

The add_listtype() class method registers a new class of access-lists.

The first argument is the type-string of the new class. The second argument is the class to be registered. The class should be a sub-class of Net::BGP::File::Standard. Normally this should be __PACKAGE__.

The third argument is used to match the lines in the configuration file using Cisco::Reconfig's get() method. If match argument is not defined, the type string will be used.

The forth argument is used to load the class with a "use" statement. This should only be needed if the class is located in a different package. Default is the class name from the second argument.

ACCESSOR METHODS

asconfig()

This function tries to generate a configuration matching the one the load constructer got. It can read from any access-list. The resulting configuration is returned as a string.

All ACL's which rules support the asconfig method may be used. To do so, use:

$conf = Net::ACL::File->asconfig($acl);

SEE ALSO

Net::ACL, Cisco::Reconfig, Net::ACL::File::Standard

AUTHOR

Martin Lorensen <bgp@martin.lorensen.dk>