line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## Domain Registry Interface, Whois commands for .EU (RFC3912) |
2
|
|
|
|
|
|
|
## |
3
|
|
|
|
|
|
|
## Copyright (c) 2007,2009,2010,2013 Patrick Mevzek . All rights reserved. |
4
|
|
|
|
|
|
|
## |
5
|
|
|
|
|
|
|
## This file is part of Net::DRI |
6
|
|
|
|
|
|
|
## |
7
|
|
|
|
|
|
|
## Net::DRI is free software; you can redistribute it and/or modify |
8
|
|
|
|
|
|
|
## it under the terms of the GNU General Public License as published by |
9
|
|
|
|
|
|
|
## the Free Software Foundation; either version 2 of the License, or |
10
|
|
|
|
|
|
|
## (at your option) any later version. |
11
|
|
|
|
|
|
|
## |
12
|
|
|
|
|
|
|
## See the LICENSE file that comes with this distribution for more details. |
13
|
|
|
|
|
|
|
#################################################################################################### |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package Net::DRI::Protocol::Whois::Domain::EU; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
808
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
18
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
3
|
use Net::DRI::Exception; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
15
|
|
21
|
1
|
|
|
1
|
|
3
|
use Net::DRI::Util; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
22
|
1
|
|
|
1
|
|
4
|
use Net::DRI::Protocol::ResultStatus; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
|
24
|
use Net::DRI::Protocol::EPP::Core::Status; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
703
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=pod |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 NAME |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Net::DRI::Protocol::Whois::Domain::EU - .EU Whois commands (RFC3912) for Net::DRI |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 DESCRIPTION |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Please see the README file for details. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 SUPPORT |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
For now, support questions should be sent to: |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Enetdri@dotandco.comE |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Please also see the SUPPORT file in the distribution. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 SEE ALSO |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Ehttp://www.dotandco.com/services/software/Net-DRI/E |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 AUTHOR |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Patrick Mevzek, Enetdri@dotandco.comE |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 COPYRIGHT |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Copyright (c) 2007,2009,2010,2013 Patrick Mevzek . |
55
|
|
|
|
|
|
|
All rights reserved. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
58
|
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by |
59
|
|
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or |
60
|
|
|
|
|
|
|
(at your option) any later version. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
See the LICENSE file that comes with this distribution for more details. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
#################################################################################################### |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub register_commands |
69
|
|
|
|
|
|
|
{ |
70
|
0
|
|
|
0
|
0
|
|
my ($class,$version)=@_; |
71
|
0
|
|
|
|
|
|
return { 'domain' => { info => [ \&info, \&info_parse ] } }; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub info |
75
|
|
|
|
|
|
|
{ |
76
|
0
|
|
|
0
|
0
|
|
my ($po,$domain,$rd)=@_; |
77
|
0
|
|
|
|
|
|
my $mes=$po->message(); |
78
|
0
|
0
|
|
|
|
|
Net::DRI::Exception->die(1,'protocol/whois',10,'Invalid domain name: '.$domain) unless Net::DRI::Util::is_hostname($domain); |
79
|
0
|
|
|
|
|
|
$mes->command(lc $domain); |
80
|
0
|
|
|
|
|
|
return; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub info_parse |
84
|
|
|
|
|
|
|
{ |
85
|
0
|
|
|
0
|
0
|
|
my ($po,$otype,$oaction,$oname,$rinfo)=@_; |
86
|
0
|
|
|
|
|
|
my $mes=$po->message(); |
87
|
0
|
0
|
|
|
|
|
return unless $mes->is_success(); |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
my $rr=$mes->response(); |
90
|
0
|
|
|
|
|
|
my $rd=$mes->response_raw(); |
91
|
0
|
0
|
|
|
|
|
die(Net::DRI::Protocol::ResultStatus->new_error('SESSION_LIMIT_EXCEEDED_CLOSING','Registry rate limiting','en')) if $rd=~m/Still in grace period, wait/; |
92
|
0
|
|
|
|
|
|
my ($domain,$exist)=parse_domain($po,$rr,$rd,$rinfo); |
93
|
0
|
|
|
|
|
|
$rinfo->{domain}->{$domain}->{exist}=$exist; |
94
|
0
|
|
|
|
|
|
$rinfo->{domain}->{$domain}->{action}='info'; |
95
|
0
|
0
|
|
|
|
|
$rinfo->{domain}->{$domain}->{ace}=$rr->{'IDNA Domain'}.'.eu' if exists $rr->{'IDNA Domain'}; |
96
|
|
|
|
|
|
|
|
97
|
0
|
0
|
|
|
|
|
return unless $exist; |
98
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
parse_registrars($po,$domain,$rr,$rinfo); |
100
|
0
|
|
|
|
|
|
parse_dates($po,$domain,$rr,$rinfo); |
101
|
0
|
|
|
|
|
|
parse_status($po,$domain,$rr,$rinfo); |
102
|
0
|
|
|
|
|
|
parse_ns($po,$domain,$rr,$rd,$rinfo); |
103
|
0
|
|
|
|
|
|
return; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub parse_domain |
107
|
|
|
|
|
|
|
{ |
108
|
0
|
|
|
0
|
0
|
|
my ($po,$rr,$rd,$rinfo)=@_; |
109
|
0
|
|
|
|
|
|
my $dom=lc($rr->{'Domain'}->[0]).'.eu'; |
110
|
0
|
0
|
0
|
|
|
|
my $e=(exists($rr->{'Status'}) && ($rr->{'Status'}->[0] eq 'AVAILABLE'))? 0 : 1; |
111
|
0
|
|
|
|
|
|
return ($dom,$e); |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub parse_registrars |
115
|
|
|
|
|
|
|
{ |
116
|
0
|
|
|
0
|
0
|
|
my ($po,$domain,$rr,$rinfo)=@_; |
117
|
0
|
|
|
|
|
|
$rinfo->{domain}->{$domain}->{clName}=$rr->{'Name'}->[-1]; |
118
|
0
|
0
|
|
|
|
|
$rinfo->{domain}->{$domain}->{clWebsite}=$rr->{'Website'}->[-1] if exists $rr->{'Website'}; |
119
|
0
|
|
|
|
|
|
return; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub parse_dates |
123
|
|
|
|
|
|
|
{ |
124
|
0
|
|
|
0
|
0
|
|
my ($po,$domain,$rr,$rinfo)=@_; |
125
|
0
|
0
|
|
|
|
|
return unless exists $rr->{'Registered'}; |
126
|
0
|
|
|
|
|
|
my $strp=$po->build_strptime_parser(pattern => '%a %b%n%d %Y', locale => 'en_US', time_zone => 'Europe/Brussels'); |
127
|
0
|
|
|
|
|
|
$rinfo->{domain}->{$domain}->{crDate}=$strp->parse_datetime($rr->{'Registered'}->[0]); |
128
|
0
|
|
|
|
|
|
return; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub parse_status |
132
|
|
|
|
|
|
|
{ |
133
|
0
|
|
|
0
|
0
|
|
my ($po,$domain,$rr,$rinfo)=@_; |
134
|
0
|
|
|
|
|
|
$rinfo->{domain}->{$domain}->{status}=Net::DRI::Protocol::EPP::Core::Status->new(['ok']); |
135
|
0
|
|
|
|
|
|
return; |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub parse_ns |
139
|
|
|
|
|
|
|
{ |
140
|
0
|
|
|
0
|
0
|
|
my ($po,$domain,$rr,$rd,$rinfo)=@_; |
141
|
0
|
|
|
|
|
|
my $ns=$po->create_local_object('hosts'); |
142
|
0
|
|
|
|
|
|
foreach my $l (@$rd) |
143
|
|
|
|
|
|
|
{ |
144
|
0
|
0
|
|
|
|
|
next unless (($l=~m/^Nameservers:/)..($l=~m/^\s*$/)); |
145
|
0
|
|
|
|
|
|
$l=~s/^\s+//; |
146
|
0
|
|
|
|
|
|
$l=~s/[)\s]+$//; |
147
|
0
|
0
|
|
|
|
|
next unless length($l); |
148
|
0
|
|
|
|
|
|
$ns->add(split(/ \(?/,$l)); |
149
|
|
|
|
|
|
|
} |
150
|
0
|
|
|
|
|
|
$rinfo->{domain}->{$domain}->{ns}=$ns; |
151
|
0
|
|
|
|
|
|
return; |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
#################################################################################################### |
155
|
|
|
|
|
|
|
1; |