ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV-ADNS/ADNS.pm
(Generate patch)

Comparing EV-ADNS/ADNS.pm (file contents):
Revision 1.2 by root, Sat Dec 1 21:29:08 2007 UTC vs.
Revision 1.5 by root, Mon Dec 3 11:54:58 2007 UTC

1=head1 NAME 1=head1 NAME
2 2
3EV::ADNS - 3EV::ADNS - lightweight asynchronous dns queries using EV and libadns
4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 use EV;
7 use EV::ADNS; 8 use EV::ADNS;
8 9
9 EV::ADNS::submit "example.com", EV::ADNS::r_a, 0, sub { 10 EV::ADNS::submit "example.com", EV::ADNS::r_a, 0, sub {
10 my ($status, $expires, @a) = @_; 11 my ($status, $expires, @a) = @_;
11 warn $a[0]; # "127.13.166.3" etc. 12 warn $a[0]; # "127.13.166.3" etc.
12 }; 13 };
14
15 EV::loop;
13 16
14=head1 DESCRIPTION 17=head1 DESCRIPTION
15 18
16This is a simple interface to libadns (asynchronous dns) that 19This is a simple interface to libadns (asynchronous dns) that
17integrates well and automatically into the EV event loop. The 20integrates well and automatically into the EV event loop. The
60 63
61=item EV::ADNS::rr_a 64=item EV::ADNS::rr_a
62 65
63An IPv4 address in dotted quad (string) form. 66An IPv4 address in dotted quad (string) form.
64 67
65=item adns_r_ns_raw, adns_r_cname, adns_r_ptr, adns_r_ptr_raw 68=item EV::ADNS::r_ns_raw, EV::ADNS::r_cname, EV::ADNS::r_ptr, EV::ADNS::r_ptr_raw
66 69
67The resource record as a simple string. 70The resource record as a simple string.
68 71
69=item adns_r_txt 72=item EV::ADNS::r_txt
70 73
71An arrayref of strings. 74An arrayref of strings.
72 75
73=item adns_r_ns 76=item EV::ADNS::r_ns
74 77
75A "host address", a hostname with any number of addresses (hint records). 78A "host address", a hostname with any number of addresses (hint records).
76 79
77Currently only the hostname will be stored, so this is alway an arrayref 80Currently only the hostname will be stored, so this is alway an arrayref
78with a single element of the hostname. Future versions might add 81with a single element of the hostname. Future versions might add
79additional address entries. 82additional address entries.
80 83
81=item adns_r_hinfo 84=item EV::ADNS::r_hinfo
82 85
83An arrayref consisting of the two strings. 86An arrayref consisting of the two strings.
84 87
85=item adns_r_rp, adns_r_rp_raw 88=item EV::ADNS::r_rp, EV::ADNS::r_rp_raw
86 89
87An arrayref with two strings. 90An arrayref with two strings.
88 91
89=item adns_r_mx 92=item EV::ADNS::r_mx
90 93
91An arrayref consisting of the priority and a "host address" (see 94An arrayref consisting of the priority and a "host address" (see
92C<adns_r_ns>). Example: 95C<EV::ADNS::r_ns>). Example:
93 96
94 [10,"mail10.example.com"] 97 [10, "mail10.example.com"]
95 98
96=item adns_r_mx_raw: 99=item EV::ADNS::r_mx_raw
97 100
98An arrayref consisting of the priority and the hostname, e.g. C<[10, 101An arrayref consisting of the priority and the hostname, e.g. C<[10,
99"mail.example.com"]>. 102"mail.example.com"]>.
100 103
101=item adns_r_soa, adns_r_soa_raw 104=item EV::ADNS::r_soa, EV::ADNS::r_soa_raw
102 105
103An arrayref consisting of the primary nameserver, admin name, serial, 106An arrayref consisting of the primary nameserver, admin name, serial,
104refresh, retry expire and minimum times, e.g.: 107refresh, retry expire and minimum times, e.g.:
105 108
106 ["ns.example.net","hostmaster@example.net",2000001102,86400,21600,2592000,172800] 109 ["ns.example.net", "hostmaster@example.net", 2000001102, 86400, 21600, 2592000, 172800]
107 110
108The "raw" form doesn't mangle the e-mail address. 111The "raw" form doesn't mangle the e-mail address.
109 112
110=item adns_r_srv_raw 113=item EV::ADNS::r_srv_raw
111 114
112An arrayref consisting of the priority, weight, port and hostname, e.g.: 115An arrayref consisting of the priority, weight, port and hostname, e.g.:
113 116
114 [10,10,5060,"sip1.example.net"] 117 [10, 10, 5060, "sip1.example.net"]
115 118
116=item adns_r_srv 119=item EV::ADNS::r_srv
117 120
118The same as C<adns_r_srv_raw>, but the hostname is replaced by a "host 121The same as C<EV::ADNS::r_srv_raw>, but the hostname is replaced by a "host
119address" (see C<adns_r_ns>). 122address" (see C<EV::ADNS::r_ns>).
120 123
121=item adns_r_unknown 124=item EV::ADNS::r_unknown
122 125
123A single octet string with the raw contents. 126A single octet string with the raw contents.
124 127
125=item anything else 128=item anything else
126 129
140 143
141use Carp (); 144use Carp ();
142use EV (); 145use EV ();
143 146
144BEGIN { 147BEGIN {
145 $VERSION = '0.1'; 148 $VERSION = '0.2';
146 149
147 require XSLoader; 150 require XSLoader;
148 XSLoader::load (EV::ADNS, $VERSION); 151 XSLoader::load (EV::ADNS, $VERSION);
149} 152}
150 153

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines