Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

DNS::BL
Manage DNS black lists

DNS::BL - Manage DNS black lists



NAME

DNS::BL - Manage DNS black lists


SYNOPSIS


  use DNS::BL;


DESCRIPTION

This class provides the services required to manage DNSBL data using this module hierarchy. It does so by implementing a series of methods, that perform the required function and when called in array context, return a two-element list, whose first element is a return code and its second element, is a diagnostic message.

In scalar context, only the constant is returned.

The following constants are defined:

DNSBL_OK
Denotes a succesful operation.

DNSBL_ECONNECT
A problem related to the connection or lack of, to the backend.

DNSBL_ECOLLISSION
When inserting entries in the backend, a previous entry conflicts with this one.

DNSBL_ENOTFOUND
When looking up entries in the backend, no suitable entry has been found.

DNSBL_ESYNTAX
A syntax error was detected by a callback handler.

DNSBL_EOTHER
Some other kind of error.

The following methods are implemented by this module:

->new()
This method creates a new DNS::BL object. No parameters are required.

->parse($command)
This method tokenizes each line given in $command, loading and calling the appropiate modules to satisfy the request. As shipped, each command verb, usually the first word of a $command, will invoke a class from the DNS::BL::cmds::* hierarchy, which handles such commands. A summary of those is included in the DNS::BL::cmds manpage. Likely, you can provide your own commands by subclassing DNS::BL::cmds in your own classes.

Note that this method supports comments, by prepending a pound sign. Most Perl-ish way.

When a command is invoked for the first time, the class is use()d. For example, the ``foo'' command would involve loading the DNS::BL::cmds::foo class.

After this loading process, the class' execute() method is invoked. This is documented in the DNS::BL::cmds manpage.

->set($key, $value)
Set the value of a $key which is stored in the object itself, to the scalar $value.

->get($key)
Retrieve the scalar value associated to the given $key.

The following methods are really pointers meant to be replaced by the the DNS::BL::cmds::connect::* manpage classes invoked at runtime. The specific function of each function is discussed below (briefly) and in the DNS::BL::cmds::connect manpage.

The the DNS::BL::cmds::connect::* manpage classes must replace them by using the the accessors to store the reference to the function (or clusure), using the same name of the method, prepending an underscore.

->read($entry)
Given an $entry, retrieve all the the DNS::BL::Entry manpage objects contained in the IP address range denoted in its ->addr() method, stored in the connected backend. Its return value, is a list where the first element is the result code, the second is a message suitable for diagnostics. The rest of the elements, if any, are the matching entries found.

$entry should be a the DNS::BL::Entry manpage object.

->match($entry)
Given an $entry, retrieve all the the DNS::BL::Entry manpage objects that contain the IP address range denoted in its ->addr() method, stored in the connected backend. Its return value, is a list where the first element is the result code, the second is a message suitable for diagnostics. The rest of the elements, if any, are the matching entries found.

$entry should be a the DNS::BL::Entry manpage object.

->write($entry)
Store the given the DNS::BL::Entry manpage object in the connected backend.

->erase($entry)
Delete all the DNS::BL::Entries from the connected backend, whose ->addr() network range falls entirely within the one given in $entry.

->commit()
Commit all the changes to the backend. In some backends this is a no-op, but it should be invoked at the end of each command block.

EXPORT

None by default.


HISTORY

  1. 00_01
  2. Original version; created by h2xs 1.22

  3. 01
  4. First RC

  5. 02
  6. Added an index to db connection method. This improves performance. Minor changes to other components. Added regression testing for IO commands.


SEE ALSO

Perl(1), the DNS::BL::cmds manpage, the DNS::BL::Entry manpage, the DNS::BL::cmds::connect manpage, the DNS::BL::cmds::connect::* manpage.


AUTHOR

Luis Muņoz, <luismunoz@cpan.org>


COPYRIGHT AND LICENSE

Copyright 2004 by Luis Muņoz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy