ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/EV/DNS.pm
Revision: 1.7
Committed: Sat Dec 1 22:51:34 2007 UTC (16 years, 5 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +0 -0 lines
State: FILE REMOVED
Log Message:
*** empty log message ***

File Contents

# Content
1 =head1 NAME
2
3 EV::DNS - perl interface to libevent's evdns module
4
5 =head1 SYNOPSIS
6
7 use EV::DNS;
8
9 EV::DNS::resolve_reverse +(Socket::inet_aton "129.13.162.95"), 0, sub {
10 my ($result, $type, $ttl, @ptrs) = @_;
11 warn "resolves to @ptrs";
12 };
13
14 EV::DNS::resolve_ipv4 "www.goof.com", 0, sub {
15 my ($result, $type, $ttl, @ptrs) = @_;
16 warn "resolves to " . Socket::inet_ntoa $ptrs[0]
17 if @ptrs;
18 };
19
20 =head1 DESCRIPTION
21
22 This module provides an interface to libevent's evdns module, see
23 (L<http://monkey.org/~provos/libevent/>).
24
25 =cut
26
27 package EV::DNS;
28
29 use strict;
30
31 use EV;
32
33 =head1 FUNCTIONAL INTERFACE
34
35 TODO
36
37 =over 4
38
39 =item EV::DNS::init
40
41 Called automatically when the module is firts used. Uses resolv.conf
42 and/or some obscure win32 ibterface to initialise the nameservers and
43 other parameters.
44
45 =item EV::DNS::shutdown $fail_requests = 1
46
47 Shuts the DNS client down.
48
49 =item $str = EV::DNS::err_to_string $errnum
50
51 =item EV::DNS::nameserver_add $adress_as_unteger
52
53 Use unpack "N", Socket::inet_aton "address".
54
55 =item $count = EV::DNS::count_nameservers
56
57 =item int EV::DNS::clear_nameservers_and_suspend
58
59 =item int EV::DNS::resume
60
61 =item int EV::DNS::nameserver_ip_add $address
62
63 =item int EV::DNS::resolve_ipv4 $hostname, $flags, $cb->($result, $type, $ttl, @addrs);
64
65 =item int EV::DNS::resolve_ipv6 $hostname, $flags, $cb->($result, $type, $ttl, @addrs);
66
67 resolve ipv6 crashes your program in libevent versions up and including at leats 1.3e.
68
69 =item int EV::DNS::resolve_reverse $4_or_6_bytes, $flagsm $cb->($result, $type, $ttl, @domains)
70
71 =item int EV::DNS::set_option $optionname, $value, $flags
72
73 EV::DNS::set_option "ndots:", "4"
74
75 =item int EV::DNS::resolv_conf_parse $flags, $filename
76
77 =item int EV::DNS::config_windows_nameservers
78
79 =item EV::DNS::search_clear
80
81 =item EV::DNS::search_add $domain
82
83 =item EV::DNS::search_ndots_set $ndots
84
85 =back
86
87 =cut
88
89 init;
90
91 1;
92
93 =head1 SEE ALSO
94
95 L<EV>, have a look at adnshost, too, which is nice to pipe in and out of :)
96
97 =head1 AUTHOR
98
99 Marc Lehmann <schmorp@schmorp.de>
100 http://home.schmorp.de/
101
102 =cut
103