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.4 by root, Sat Dec 1 22:36:10 2007 UTC vs.
Revision 1.9 by root, Sat Dec 8 23:14:19 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;
8 use EV::ADNS; 8 use EV::ADNS;
49 49
50 sub adns_cb { 50 sub adns_cb {
51 my ($status, $expires, @rr) = @_; 51 my ($status, $expires, @rr) = @_;
52 if ($status == EV::ADNS::s_ok) { 52 if ($status == EV::ADNS::s_ok) {
53 use JSON::XS; 53 use JSON::XS;
54 warn to_json \@rr; 54 warn encode_json \@rr;
55 } 55 }
56 } 56 }
57 57
58The format of result records varies considerably, here is some cursory 58The format of result records varies considerably, here is some cursory
59documentation of how each record will look like, depending on the query 59documentation of how each record will look like, depending on the query
63 63
64=item EV::ADNS::rr_a 64=item EV::ADNS::rr_a
65 65
66An IPv4 address in dotted quad (string) form. 66An IPv4 address in dotted quad (string) form.
67 67
68=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
69 69
70The resource record as a simple string. 70The resource record as a simple string.
71 71
72=item adns_r_txt 72=item EV::ADNS::r_txt
73 73
74An arrayref of strings. 74An arrayref of strings.
75 75
76=item adns_r_ns 76=item EV::ADNS::r_ns
77 77
78A "host address", a hostname with any number of addresses (hint records). 78A "host address", a hostname with any number of addresses (hint records).
79 79
80Currently 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
81with a single element of the hostname. Future versions might add 81with a single element of the hostname. Future versions might add
82additional address entries. 82additional address entries.
83 83
84=item adns_r_hinfo 84=item EV::ADNS::r_hinfo
85 85
86An arrayref consisting of the two strings. 86An arrayref consisting of the two strings.
87 87
88=item adns_r_rp, adns_r_rp_raw 88=item EV::ADNS::r_rp, EV::ADNS::r_rp_raw
89 89
90An arrayref with two strings. 90An arrayref with two strings.
91 91
92=item adns_r_mx 92=item EV::ADNS::r_mx
93 93
94An arrayref consisting of the priority and a "host address" (see 94An arrayref consisting of the priority and a "host address" (see
95C<adns_r_ns>). Example: 95C<EV::ADNS::r_ns>). Example:
96 96
97 [10,"mail10.example.com"] 97 [10, "mail10.example.com"]
98 98
99=item adns_r_mx_raw: 99=item EV::ADNS::r_mx_raw
100 100
101An 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,
102"mail.example.com"]>. 102"mail.example.com"]>.
103 103
104=item adns_r_soa, adns_r_soa_raw 104=item EV::ADNS::r_soa, EV::ADNS::r_soa_raw
105 105
106An arrayref consisting of the primary nameserver, admin name, serial, 106An arrayref consisting of the primary nameserver, admin name, serial,
107refresh, retry expire and minimum times, e.g.: 107refresh, retry expire and minimum times, e.g.:
108 108
109 ["ns.example.net","hostmaster@example.net",2000001102,86400,21600,2592000,172800] 109 ["ns.example.net", "hostmaster@example.net", 2000001102, 86400, 21600, 2592000, 172800]
110 110
111The "raw" form doesn't mangle the e-mail address. 111The "raw" form doesn't mangle the e-mail address.
112 112
113=item adns_r_srv_raw 113=item EV::ADNS::r_srv_raw
114 114
115An arrayref consisting of the priority, weight, port and hostname, e.g.: 115An arrayref consisting of the priority, weight, port and hostname, e.g.:
116 116
117 [10,10,5060,"sip1.example.net"] 117 [10, 10, 5060, "sip1.example.net"]
118 118
119=item adns_r_srv 119=item EV::ADNS::r_srv
120 120
121The 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
122address" (see C<adns_r_ns>). 122address" (see C<EV::ADNS::r_ns>).
123 123
124=item adns_r_unknown 124=item EV::ADNS::r_unknown
125 125
126A single octet string with the raw contents. 126A single octet string with the raw contents.
127 127
128=item anything else 128=item anything else
129 129
143 143
144use Carp (); 144use Carp ();
145use EV (); 145use EV ();
146 146
147BEGIN { 147BEGIN {
148 $VERSION = '0.2'; 148 $VERSION = '1.0';
149 149
150 require XSLoader; 150 require XSLoader;
151 XSLoader::load (EV::ADNS, $VERSION); 151 XSLoader::load (EV::ADNS, $VERSION);
152} 152}
153 153

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines