| Net-DNS-Method documentation | view source | Contained in the Net-DNS-Method distribution. |
Net::DNS::Method - Base class for Net::DNS::Server methods
use Net::DNS::Method;
package Net::DNS::Method::Sample;
our @ISA = qw( ... Net::DNS::Method ... );
sub new { ... }
sub A { ... }
This is a base class to help in the creation of method classes for use within the Net::DNS::Server package. This class provides specific methods to do nothing to particular DNS questions. In general, this class consists of a number of methods that are called like in the following example.
->A($q, $ans)This would be invoked by Net::DNS::Server upon the arrival of a query of type 'A'.
The method can check the question, passed as a Net::DNS::Qustion
object in $q. Usually, the method will then modify the
Net::DNS::Packet object in $ans to provide an answer.
Net::DNS::Server will call sequentially all of the registered Net::DNS::Method::* objects for a given question. After this sequence of calls ends, the response can be sent depending on what the methods have requsted.
The return value of the method is given as an OR of the following values.
NS_IGNORERequests that the current question be ignored.
NS_STOPRequests that no further objects be invoked.
NS_OKIndicates that the current method matched the question and presumably,
altered the answer. Control is passed to the next method in
sequence. After the last method is invoked, the answer will be sent to
the client unless NS_IGNORE is returned by this or a later method.
NS_FAILIndicates that the current method did not match the packet.
NS_SPLITIndicates that the response must be splitted in individual answers and sent accordingly. This is used for AXFR requests.
There is one such method for each type of RR supported by
Net::DNS. Additionally, the ->ANY method is provided, which
calls all the defined RRs in succession.
NS_* constants used for the return values.
$Id: Method.pm,v 1.2 2002/10/23 04:43:58 lem Exp $
NS_SPLIT.
Luis E. Munoz <luismunoz@cpan.org>
perl(1), Net::DNS(3), Net::DNS::Server(3), Net::DNS::Question(3), Net::DNS::Packet(3).
| Net-DNS-Method documentation | view source | Contained in the Net-DNS-Method distribution. |