line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# You may distribute under the terms of either the GNU General Public License |
2
|
|
|
|
|
|
|
# or the Artistic License (the same terms as Perl itself) |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# (C) Paul Evans, 2011 -- leonerd@leonerd.org.uk |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package IO::Async::Resolver::DNS::LibResolvImpl; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
63
|
|
9
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
105
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
801
|
use Net::LibResolv 0.03 qw( res_query res_search class_name2value type_name2value $h_errno ); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _resolve |
16
|
|
|
|
|
|
|
{ |
17
|
|
|
|
|
|
|
my ( $func, $dname, $class, $type ) = @_; |
18
|
|
|
|
|
|
|
my $pkt = $func->( $dname, class_name2value($class), type_name2value($type) ); |
19
|
|
|
|
|
|
|
# We can't easily detect NODATA errors here, so we'll have to let the |
20
|
|
|
|
|
|
|
# higher-level function do it |
21
|
|
|
|
|
|
|
die "$h_errno\n" if !defined $pkt; |
22
|
|
|
|
|
|
|
return $pkt; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub IO::Async::Resolver::DNS::res_query { _resolve( \&res_query, @_ ) } |
26
|
|
|
|
|
|
|
sub IO::Async::Resolver::DNS::res_search { _resolve( \&res_search, @_ ) } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
0x55AA; |