line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## Domain Registry Interface, Command Reversal Extension for EPP |
2
|
|
|
|
|
|
|
## |
3
|
|
|
|
|
|
|
## Copyright (c) 2016 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::EPP::Extensions::Reverse; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
826
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
42
|
|
18
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
37
|
|
19
|
1
|
|
|
1
|
|
4
|
use feature 'state'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
66
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
4
|
use Net::DRI::Util; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
16
|
|
22
|
1
|
|
|
1
|
|
4
|
use Net::DRI::Exception; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
489
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#################################################################################################### |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub register_commands |
27
|
|
|
|
|
|
|
{ |
28
|
0
|
|
|
0
|
0
|
|
my ($class,$version)=@_; |
29
|
0
|
|
|
|
|
|
state $rmcds = { 'command' => { 'reverse' => [ \&build, undef ], |
30
|
|
|
|
|
|
|
'review_reverse' => [ undef, \&parse ], |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
}; |
33
|
0
|
|
|
|
|
|
return $rmcds; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub setup |
37
|
|
|
|
|
|
|
{ |
38
|
0
|
|
|
0
|
0
|
|
my ($class,$po,$version)=@_; |
39
|
0
|
|
|
|
|
|
state $rns = { 'reverse' => [ 'urn:ietf:params:xml:ns:reverse-0.1', 'reverse-0.1.xsd' ]}; |
40
|
0
|
|
|
|
|
|
$po->ns($rns); |
41
|
0
|
|
|
|
|
|
return; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
0
|
0
|
|
sub implements { return 'https://tools.ietf.org/html/draft-brown-epp-reverse-00'; } |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
#################################################################################################### |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub build |
49
|
|
|
|
|
|
|
{ |
50
|
0
|
|
|
0
|
0
|
|
my ($epp,$svtrid,$rd)=@_; |
51
|
0
|
|
|
|
|
|
my $mes=$epp->message(); |
52
|
|
|
|
|
|
|
|
53
|
0
|
0
|
|
|
|
|
Net::DRI::Exception::usererr_insufficient_parameters('svtrid of command to reverse is mandatory') unless defined $svtrid; |
54
|
0
|
0
|
|
|
|
|
Net::DRI::Exception::usererr_invalid_parameters('svtrid must be of type epp:trIDStringType') unless Net::DRI::Util::xml_is_token($svtrid, 3, 64); |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
my @d; |
57
|
0
|
0
|
|
|
|
|
push @d, ['reverse:reason', $rd->{reason}] if Net::DRI::Util::has_key($rd, 'reason'); |
58
|
0
|
0
|
|
|
|
|
push @d, ['reverse:trID', Net::DRI::Util::has_key($rd, 'trid') ? ['reverse:clTRID', $rd->{trid}] : (), ['reverse:svTRID', $svtrid]]; |
59
|
0
|
|
|
|
|
|
push @d, ['reverse:clTRID', $mes->cltrid()]; |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
my $eid=$mes->command_extension_register('reverse', 'reverse'); |
62
|
0
|
|
|
|
|
|
$mes->command_extension($eid, \@d); |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
return; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub parse |
68
|
|
|
|
|
|
|
{ |
69
|
0
|
|
|
0
|
0
|
|
my ($po,$otype,$oaction,$oname,$rinfo)=@_; |
70
|
0
|
|
|
|
|
|
my $mes=$po->message(); |
71
|
0
|
0
|
|
|
|
|
return unless $mes->is_success(); |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
|
my $data=$mes->get_response('reverse','panData'); |
74
|
0
|
0
|
|
|
|
|
return unless defined $data; |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
foreach my $el (Net::DRI::Util::xml_list_children($data)) |
77
|
|
|
|
|
|
|
{ |
78
|
0
|
|
|
|
|
|
my ($name,$c)=@$el; |
79
|
0
|
0
|
|
|
|
|
if ($name eq 'paTRID') |
|
|
0
|
|
|
|
|
|
80
|
|
|
|
|
|
|
{ |
81
|
0
|
|
|
|
|
|
my $ns=$mes->ns('reverse'); |
82
|
0
|
|
|
|
|
|
$oname=Net::DRI::Util::xml_child_content($c,$ns,'svTRID'); |
83
|
0
|
|
|
|
|
|
$rinfo->{command}->{$oname}->{action}='review_reverse'; |
84
|
0
|
|
|
|
|
|
$rinfo->{command}->{$oname}->{result}=Net::DRI::Util::xml_parse_boolean($c->getAttribute('paResult')); |
85
|
0
|
|
|
|
|
|
$rinfo->{command}->{$oname}->{svtrid}=$oname; |
86
|
0
|
|
|
|
|
|
my $tmp=Net::DRI::Util::xml_child_content($c,$ns,'clTRID'); |
87
|
0
|
0
|
|
|
|
|
$rinfo->{command}->{$oname}->{trid}=$tmp if defined $tmp; |
88
|
|
|
|
|
|
|
} elsif ($name eq 'paDate') |
89
|
|
|
|
|
|
|
{ |
90
|
0
|
|
|
|
|
|
$rinfo->{command}->{$oname}->{date}=$po->parse_iso8601($c->textContent()); |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
0
|
|
|
|
|
|
return; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
#################################################################################################### |
98
|
|
|
|
|
|
|
1; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
__END__ |