line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## Domain Registry Interface, EURid IDN EPP extension commands |
2
|
|
|
|
|
|
|
## |
3
|
|
|
|
|
|
|
## Copyright (c) 2010,2012,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::EPP::Extensions::EURid::IDN; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
655
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
18
|
1
|
|
|
1
|
|
2
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
17
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
3
|
use Net::DRI::Util; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
12
|
|
21
|
1
|
|
|
1
|
|
43
|
use Net::DRI::Exception; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
22
|
1
|
|
|
1
|
|
3
|
use Net::DRI::Protocol::EPP::Util; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
339
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#################################################################################################### |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub register_commands |
27
|
|
|
|
|
|
|
{ |
28
|
0
|
|
|
0
|
0
|
|
my ($class,$version)=@_; |
29
|
0
|
|
|
|
|
|
my %tmp=( |
30
|
|
|
|
|
|
|
create => [ undef, \&_parse ], |
31
|
|
|
|
|
|
|
info => [ undef, \&_parse ], |
32
|
|
|
|
|
|
|
check => [ undef, \&check_parse ], |
33
|
|
|
|
|
|
|
renew => [ undef, \&_parse ], |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
return { 'domain' => \%tmp }; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub setup |
40
|
|
|
|
|
|
|
{ |
41
|
0
|
|
|
0
|
0
|
|
my ($class,$po,$version)=@_; |
42
|
0
|
|
|
|
|
|
$po->ns({ 'idn' => [ 'http://www.eurid.eu/xml/epp/idn-1.0','idn-1.0.xsd' ] }); |
43
|
0
|
|
|
|
|
|
return; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
#################################################################################################### |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub get_names |
49
|
|
|
|
|
|
|
{ |
50
|
0
|
|
|
0
|
0
|
|
my ($mes,$node)=@_; |
51
|
0
|
|
|
|
|
|
my $ns=$mes->ns('idn'); |
52
|
0
|
|
|
|
|
|
my @r; |
53
|
0
|
|
|
|
|
|
foreach my $e (Net::DRI::Util::xml_traverse($node,$ns,'name')) |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
|
|
|
push @r,[Net::DRI::Util::xml_child_content($e,$ns,'ace'),Net::DRI::Util::xml_child_content($e,$ns,'unicode')]; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
return @r; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub _parse |
62
|
|
|
|
|
|
|
{ |
63
|
0
|
|
|
0
|
|
|
my ($po,$otype,$oaction,$oname,$rinfo)=@_; |
64
|
0
|
|
|
|
|
|
my $mes=$po->message(); |
65
|
0
|
0
|
|
|
|
|
return unless $mes->is_success(); |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
my $data=$mes->get_extension('idn','mapping'); |
68
|
0
|
0
|
|
|
|
|
return unless defined $data; |
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
($rinfo->{domain}->{$oname}->{ace},$rinfo->{domain}->{$oname}->{unicode})=@{(get_names($mes,$data))[0]}; |
|
0
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
return; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub check_parse |
75
|
|
|
|
|
|
|
{ |
76
|
0
|
|
|
0
|
0
|
|
my ($po,$otype,$oaction,$oname,$rinfo)=@_; |
77
|
0
|
|
|
|
|
|
my $mes=$po->message(); |
78
|
0
|
0
|
|
|
|
|
return unless $mes->is_success(); |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
my $chkdata=$mes->get_extension('idn','mapping'); |
81
|
0
|
0
|
|
|
|
|
return unless defined $chkdata; |
82
|
|
|
|
|
|
|
|
83
|
0
|
|
|
|
|
|
foreach my $ra (get_names($mes,$chkdata)) |
84
|
|
|
|
|
|
|
{ |
85
|
0
|
|
|
|
|
|
my ($a,$u)=@$ra; |
86
|
0
|
0
|
|
|
|
|
my $dom=exists $rinfo->{domain}->{$a} ? $a : $u; |
87
|
0
|
|
|
|
|
|
$rinfo->{domain}->{$dom}->{ace}=$a; |
88
|
0
|
|
|
|
|
|
$rinfo->{domain}->{$dom}->{unicode}=$u; |
89
|
|
|
|
|
|
|
} |
90
|
0
|
|
|
|
|
|
return; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
#################################################################################################### |
94
|
|
|
|
|
|
|
1; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
__END__ |