line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## Domain Registry Interface, RRP Protocol |
2
|
|
|
|
|
|
|
## |
3
|
|
|
|
|
|
|
## Copyright (c) 2005,2008-2010,2013-2014 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::RRP; |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
|
835
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
63
|
|
18
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
45
|
|
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
8
|
use base qw(Net::DRI::Protocol); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
590
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
11
|
use Net::DRI::Exception; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
36
|
|
23
|
2
|
|
|
2
|
|
9
|
use Net::DRI::Util; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
39
|
|
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
2
|
|
549
|
use Net::DRI::Protocol::RRP::Message; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
15
|
|
26
|
2
|
|
|
2
|
|
684
|
use Net::DRI::Protocol::RRP::Core::Status; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
43
|
|
27
|
|
|
|
|
|
|
|
28
|
2
|
|
|
2
|
|
10
|
use DateTime; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
36
|
|
29
|
2
|
|
|
2
|
|
9
|
use DateTime::TimeZone; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
33
|
|
30
|
2
|
|
|
2
|
|
8
|
use DateTime::Format::Strptime; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1166
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=pod |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Net::DRI::Protocol::RRP - RRP 1.1/2.0 Protocol for Net::DRI |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 DESCRIPTION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Please see the README file for details. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SUPPORT |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
For now, support questions should be sent to: |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Enetdri@dotandco.comE |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Please also see the SUPPORT file in the distribution. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 SEE ALSO |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Ehttp://www.dotandco.com/services/software/Net-DRI/E |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 AUTHOR |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Patrick Mevzek, Enetdri@dotandco.comE |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 COPYRIGHT |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Copyright (c) 2005,2008-2010,2013-2014 Patrick Mevzek . |
61
|
|
|
|
|
|
|
All rights reserved. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
64
|
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by |
65
|
|
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or |
66
|
|
|
|
|
|
|
(at your option) any later version. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
See the LICENSE file that comes with this distribution for more details. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
our %DATES=('registration expiration date' => 'exDate', |
74
|
|
|
|
|
|
|
'created date' => 'crDate', |
75
|
|
|
|
|
|
|
'updated date' => 'upDate', |
76
|
|
|
|
|
|
|
'registrar transfer date' => 'trDate', |
77
|
|
|
|
|
|
|
); |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
our %IDS=('registrar' => 'clID', |
80
|
|
|
|
|
|
|
'created by' => 'crID', |
81
|
|
|
|
|
|
|
'updated by' => 'upID', |
82
|
|
|
|
|
|
|
); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
############################################################################### |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub new |
87
|
|
|
|
|
|
|
{ |
88
|
1
|
|
|
1
|
1
|
2
|
my ($c,$ctx,$rp)=@_; |
89
|
1
|
|
|
|
|
6
|
my $drd=$ctx->{registry}->driver(); |
90
|
1
|
|
|
|
|
12
|
my $self=$c->SUPER::new($ctx); |
91
|
1
|
|
|
|
|
3
|
$self->name('RRP'); |
92
|
1
|
|
|
|
|
9
|
my $version=Net::DRI::Util::check_equal($rp->{version},['1.1','2.0'],'2.0'); ## 1.1 (RFC #2832) or 2.0 (RFC #3632) |
93
|
1
|
|
|
|
|
7
|
$self->version($version); |
94
|
1
|
|
|
|
|
11
|
$self->capabilities('host_update','ip',['add','del']); |
95
|
1
|
|
|
|
|
4
|
$self->capabilities('host_update','name',['set']); |
96
|
1
|
|
|
|
|
3
|
$self->capabilities('domain_update','ns',['add','del']); |
97
|
1
|
|
|
|
|
4
|
$self->capabilities('domain_update','status',['add','del']); |
98
|
1
|
|
|
20
|
|
7
|
$self->factories('message',sub { my $m=Net::DRI::Protocol::RRP::Message->new(@_); $m->version($version); return $m; }); |
|
20
|
|
|
|
|
90
|
|
|
20
|
|
|
|
|
59
|
|
|
20
|
|
|
|
|
151
|
|
99
|
1
|
|
|
0
|
|
10
|
$self->factories('status',sub { return Net::DRI::Protocol::RRP::Core::Status->new(); }); |
|
0
|
|
|
|
|
0
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
## Verify that we have the timezone of the registry, since dates in RRP are local to registries |
102
|
1
|
|
|
|
|
11
|
my $tzname=$drd->info('tz'); |
103
|
1
|
50
|
|
|
|
5
|
Net::DRI::Exception::usererr_insufficient_parameters('no registry timezone') unless (defined($tzname)); |
104
|
1
|
|
|
|
|
1
|
my $tz; |
105
|
1
|
|
|
|
|
2
|
eval { $tz=DateTime::TimeZone->new(name => $tzname); }; |
|
1
|
|
|
|
|
9
|
|
106
|
1
|
50
|
33
|
|
|
19209
|
Net::DRI::Exception::usererr_invalid_parameters("invalid registry timezone ($tzname), unable to instantiate") unless (defined $tz && ref $tz); |
107
|
1
|
|
|
|
|
3
|
my $dtp; |
108
|
1
|
|
|
|
|
3
|
eval { $dtp=DateTime::Format::Strptime->new(time_zone=>$tz, pattern=>'%Y-%m-%d %H:%M:%S.0'); }; |
|
1
|
|
|
|
|
12
|
|
109
|
1
|
50
|
33
|
|
|
517
|
Net::DRI::Exception::usererr_invalid_parameters("invalid registry timezone ($tzname), unable to create parser") unless (defined $dtp && ref $dtp); |
110
|
1
|
|
|
|
|
4
|
$self->{dt_parse}=$dtp; |
111
|
|
|
|
|
|
|
|
112
|
1
|
|
|
|
|
6
|
$self->_load($rp); |
113
|
1
|
|
|
|
|
8
|
return $self; |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
my $BASE = 'Net::DRI::Protocol::RRP::Core::'; |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
sub _load |
119
|
|
|
|
|
|
|
{ |
120
|
1
|
|
|
1
|
|
2
|
my ($self,$rp)=@_; |
121
|
1
|
|
|
|
|
2
|
my $extramods=$rp->{extensions}; |
122
|
1
|
|
|
|
|
2
|
my @class=map { $BASE.$_ } qw/Session Domain Host/; |
|
3
|
|
|
|
|
7
|
|
123
|
1
|
0
|
33
|
|
|
5
|
push @class,map { my $f=$_; if ($f=~m/^([^+])(.+)$/) { $f = $1 eq '-' ? '-'.$BASE.$2 : $BASE.$1.$2; } $f; } (ref $extramods ? @$extramods : ($extramods)) if defined $extramods && $extramods; |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
50
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
124
|
|
|
|
|
|
|
|
125
|
1
|
|
|
|
|
23
|
return $self->SUPER::_load(@class); |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
sub transport_default |
129
|
|
|
|
|
|
|
{ |
130
|
1
|
|
|
1
|
0
|
3
|
my ($self)=@_; |
131
|
1
|
|
|
|
|
9
|
return (protocol_connection => 'Net::DRI::Protocol::RRP::Connection', protocol_version => 1); |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
############################################################################################### |
135
|
|
|
|
|
|
|
1; |