« DRI/Protocol/EPP/Extensions/ServiceMessage.pm
↑ Summary
DRI/Protocol/EPP/Extensions/VeriSign/EmailFwd.pm »
| 1 | ## Domain Registry Interface, EPP Host commands (RFC5732) | ||||||||||||||||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2005-2013,2018 Patrick Mevzek <netdri@dotandco.com>. 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::Core::Host; | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | use Net::DRI::Util; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | ▶ | use Net::DRI::Exception; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | use Net::DRI::Protocol::EPP::Util; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | Net::DRI::Protocol::EPP::Core::Host - EPP Host commands (RFC5732) for Net::DRI | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | Please see the README file for details. | ||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | Copyright (c) 2005-2013,2018 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||||||||||||||||
| 54 | All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||
| 57 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||
| 58 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||
| 59 | (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||
| 67 | sub register_commands | ||||||||||||||||||||||||||||||||||||||||||
| 68 | { | ||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | ▶ | my ($class,$version)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | my %tmp=( create => [ \&create, \&create_parse ], | |||||||||||||||||||||||||||||||||||||||||
| 71 | check => [ \&check, \&check_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 72 | info => [ \&info, \&info_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 73 | delete => [ \&delete ], | ||||||||||||||||||||||||||||||||||||||||||
| 74 | update => [ \&update ], | ||||||||||||||||||||||||||||||||||||||||||
| 75 | review_complete => [ undef, \&pandata_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 76 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | $tmp{check_multi}=$tmp{check}; | |||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | return { 'host' => \%tmp }; | |||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||
| 82 | sub build_command | ||||||||||||||||||||||||||||||||||||||||||
| 83 | { | ||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | my ($msg,$command,$hostname)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_command: not called CC=9 SCAR=45.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | ▶ | my @n=map { Net::DRI::Util::isa_hosts($_)? $_->get_names() : $_ } ((ref($hostname) eq 'ARRAY')? @$hostname : ($hostname)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | Net::DRI::Exception->die(1,'protocol/EPP',2,'Host name needed') unless @n; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | foreach my $n (@n) | |||||||||||||||||||||||||||||||||||||||||
| 89 | { | ||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | Net::DRI::Exception->die(1,'protocol/EPP',2,'Host name needed') unless (defined($n) && $n && !ref($n)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
defined $n and $n and not ref $n
defined $n and $n
MC/DC0%0/3
defined $n and $n and not ref $n
defined $n
$n
not ref $n
Truth table0%0/4
A and B and not(C)
A= defined $nB= $nC= not ref $n
| |||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | ▶ | Net::DRI::Exception->die(1,'protocol/EPP',10,'Invalid host name: '.$n) unless Net::DRI::Util::is_hostname($n); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | $msg->command([$command,'host:'.$command, $msg->nsattrs('host')]); | |||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | my @d=map { ['host:name',$_] } @n; | |||||||||||||||||||||||||||||||||||||||||
| 97 | 0 | return @d; | |||||||||||||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||
| 100 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 101 | ########### Query commands | ||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||
| 103 | sub check | ||||||||||||||||||||||||||||||||||||||||||
| 104 | { | ||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | my ($epp,$ns)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | my @d=build_command($mes,'check',$ns); | |||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | $mes->command_body(\@d); | |||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||
| 112 | sub check_parse | ||||||||||||||||||||||||||||||||||||||||||
| 113 | { | ||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check_parse: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | my $chkdata=$mes->get_response('host','chkData'); | |||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | ▶ | return unless defined $chkdata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | foreach my $cd ($chkdata->getChildrenByTagNameNS($mes->ns('host'),'cd')) | |||||||||||||||||||||||||||||||||||||||||
| 121 | { | ||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | my $host; | |||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($cd)) | |||||||||||||||||||||||||||||||||||||||||
| 124 | { | ||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | my ($n,$c)=@$el; | |||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | if ($n eq 'name') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 127 | { | ||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | $host=lc($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | $rinfo->{host}->{$host}->{action}='check'; | |||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | $rinfo->{host}->{$host}->{exist}=1-Net::DRI::Util::xml_parse_boolean($c->getAttribute('avail')); | |||||||||||||||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | if ($n eq 'reason') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | { | ||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | $rinfo->{host}->{$host}->{exist_reason}=$c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||
| 141 | sub info | ||||||||||||||||||||||||||||||||||||||||||
| 142 | { | ||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | my ($epp,$ns)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | my @d=build_command($mes,'info',$ns); | |||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | $mes->command_body(\@d); | |||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||
| 150 | sub info_parse | ||||||||||||||||||||||||||||||||||||||||||
| 151 | { | ||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info_parse: not called CC=14 SCAR=53.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | my $infdata=$mes->get_response('host','infData'); | |||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | ▶ | return unless defined $infdata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | my (@s,@ip4,@ip6); | |||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($infdata)) | |||||||||||||||||||||||||||||||||||||||||
| 161 | { | ||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | my ($name,$c)=@$el; | |||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | ▶ | if ($name eq 'name') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 164 | { | ||||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | $oname=lc($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | $oname =~ s/\.$//; # remove trailing . | |||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | $rinfo->{host}->{$oname}->{action}='info'; | |||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | $rinfo->{host}->{$oname}->{exist}=1; | |||||||||||||||||||||||||||||||||||||||||
| 169 | } elsif ($name=~m/^(clID|crID|upID)$/) | ||||||||||||||||||||||||||||||||||||||||||
| 170 | { | ||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | $rinfo->{host}->{$oname}->{$1}=$c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 172 | } elsif ($name=~m/^(crDate|upDate|trDate)$/) | ||||||||||||||||||||||||||||||||||||||||||
| 173 | { | ||||||||||||||||||||||||||||||||||||||||||
| 174 | 0 | $rinfo->{host}->{$oname}->{$1}=$po->parse_iso8601($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 175 | } elsif ($name eq 'roid') | ||||||||||||||||||||||||||||||||||||||||||
| 176 | { | ||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | $rinfo->{host}->{$oname}->{roid}=$c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 178 | } elsif ($name eq 'status') | ||||||||||||||||||||||||||||||||||||||||||
| 179 | { | ||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | push @s,Net::DRI::Protocol::EPP::Util::parse_node_status($c); | |||||||||||||||||||||||||||||||||||||||||
| 181 | } elsif ($name eq 'addr') | ||||||||||||||||||||||||||||||||||||||||||
| 182 | { | ||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | my $ip=$c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | my $ipv=$c->getAttribute('ip'); | |||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | ▶ | $ipv='v4' unless (defined($ipv) && $ipv); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $ipv and $ipv
MC/DC0%0/2
defined $ipv and $ipv
defined $ipv
$ipv
Truth table0%0/3
A and B
A= defined $ipvB= $ipv
| |||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | ▶ | push @ip4,$ip if ($ipv eq 'v4'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | ▶ | push @ip6,$ip if ($ipv eq 'v6'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | $rinfo->{host}->{$oname}->{status}=$po->create_local_object('status')->add(@s); | |||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | $rinfo->{host}->{$oname}->{self}=$po->create_local_object('hosts',$oname,\@ip4,\@ip6,1); | |||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||
| 196 | ############ Transform commands | ||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||
| 198 | sub create | ||||||||||||||||||||||||||||||||||||||||||
| 199 | { | ||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | my ($epp,$ns)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | my @d=build_command($mes,'create',$ns); | |||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | ▶ | push @d,add_ip($ns) if Net::DRI::Util::isa_hosts($ns); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | $mes->command_body(\@d); | |||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||||||||||||||||
| 208 | sub create_parse | ||||||||||||||||||||||||||||||||||||||||||
| 209 | { | ||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_parse: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | my $credata=$mes->get_response('host','creData'); | |||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | ▶ | return unless defined $credata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($credata)) | |||||||||||||||||||||||||||||||||||||||||
| 218 | { | ||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | my ($name,$c)=@$el; | |||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | if ($name eq 'name') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 221 | { | ||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | $oname=lc($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | $rinfo->{host}->{$oname}->{action}='create'; | |||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | $rinfo->{host}->{$oname}->{exist}=1; | |||||||||||||||||||||||||||||||||||||||||
| 225 | } elsif ($name=~m/^(crDate)$/) | ||||||||||||||||||||||||||||||||||||||||||
| 226 | { | ||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | $rinfo->{host}->{$oname}->{$1}=$po->parse_iso8601($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 228 | } | ||||||||||||||||||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||
| 233 | sub delete ## no critic (Subroutines::ProhibitBuiltinHomonyms) | ||||||||||||||||||||||||||||||||||||||||||
| 234 | { | ||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | ▶ | my ($epp,$ns)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 237 | 0 | my @d=build_command($mes,'delete',$ns); | |||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | $mes->command_body(\@d); | |||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 240 | } | ||||||||||||||||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||||||||||||||||
| 242 | sub update | ||||||||||||||||||||||||||||||||||||||||||
| 243 | { | ||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | ▶ | my ($epp,$ns,$todo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update: not called CC=15 SCAR=54.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters($todo.' must be a non empty Net::DRI::Data::Changes object') unless Net::DRI::Util::isa_changes($todo); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | my $nsadd=$todo->add('ip'); | |||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | my $nsdel=$todo->del('ip'); | |||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | my $sadd=$todo->add('status'); | |||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | my $sdel=$todo->del('status'); | |||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | my $newname=$todo->set('name'); | |||||||||||||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | ▶ | unless (defined($ns) && $ns) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $ns and $ns
MC/DC0%0/2
defined $ns and $ns
defined $ns
$ns
Truth table0%0/3
A and B
A= defined $nsB= $ns
| |||||||||||||||||||||||||||||||||||||||||||
| 256 | { | ||||||||||||||||||||||||||||||||||||||||||
| 257 | 0 | ▶ | $ns=$nsadd->get_names(1) if Net::DRI::Util::isa_hosts($nsadd); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | ▶ | $ns=$nsdel->get_names(1) if Net::DRI::Util::isa_hosts($nsdel); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | my (@add,@rem); | |||||||||||||||||||||||||||||||||||||||||
| 262 | 0 | ▶ | push @add,add_ip($nsadd) if Net::DRI::Util::isa_hosts($nsadd); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | ▶ | push @add,$sadd->build_xml('host:status') if Net::DRI::Util::isa_statuslist($sadd); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | ▶ | push @rem,add_ip($nsdel) if Net::DRI::Util::isa_hosts($nsdel); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | push @rem,$sdel->build_xml('host:status') if Net::DRI::Util::isa_statuslist($sdel); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||
| 267 | 0 | my @d=build_command($mes,'update',$ns); | |||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | ▶ | push @d,['host:add',@add] if @add; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 269 | 0 | ▶ | push @d,['host:rem',@rem] if @rem; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | ▶ | if (defined($newname) && length $newname) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $newname and length $newname
MC/DC0%0/2
defined $newname and length $newname
defined $newname
length $newname
Truth table0%0/3
A and B
A= defined $newnameB= length $newname
| |||||||||||||||||||||||||||||||||||||||||||
| 272 | { | ||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | ▶ | Net::DRI::Exception->die(1,'protocol/EPP',10,'Invalid host name: '.$newname) unless Net::DRI::Util::is_hostname($newname); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | push @d,['host:chg',['host:name',$newname]]; | |||||||||||||||||||||||||||||||||||||||||
| 275 | } | ||||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | $mes->command_body(\@d); | |||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||||||||||
| 280 | sub add_ip | ||||||||||||||||||||||||||||||||||||||||||
| 281 | { | ||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | ▶ | my ($ns)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_ip: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | my @ip; | |||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | my ($name,$r4,$r6)=$ns->get_details(1); | |||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | ▶ | push @ip,map { ['host:addr',$_,{ip=>'v4'}] } @$r4 if @$r4; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 286 | 0 | ▶ | push @ip,map { ['host:addr',$_,{ip=>'v6'}] } @$r6 if @$r6; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | return @ip; | |||||||||||||||||||||||||||||||||||||||||
| 288 | } | ||||||||||||||||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||||||||||||||||
| 290 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 291 | ## RFC4932 §3.3 Offline Review of Requested Actions | ||||||||||||||||||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||||||||||||||||
| 293 | sub pandata_parse | ||||||||||||||||||||||||||||||||||||||||||
| 294 | { | ||||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pandata_parse: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 296 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | my $pandata=$mes->get_response('host','panData'); | |||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | ▶ | return unless defined $pandata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($pandata)) | |||||||||||||||||||||||||||||||||||||||||
| 303 | { | ||||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | my ($name,$c)=@$el; | |||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | ▶ | if ($name eq 'name') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 306 | { | ||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | $oname=lc($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | $rinfo->{host}->{$oname}->{action}='review'; | |||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | $rinfo->{host}->{$oname}->{result}=Net::DRI::Util::xml_parse_boolean($c->getAttribute('paResult')); | |||||||||||||||||||||||||||||||||||||||||
| 310 | } elsif ($name eq 'paTRID') | ||||||||||||||||||||||||||||||||||||||||||
| 311 | { | ||||||||||||||||||||||||||||||||||||||||||
| 312 | 0 | my $ns=$mes->ns('epp'); | |||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | my $tmp=Net::DRI::Util::xml_child_content($c,$ns,'clTRID'); | |||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | ▶ | $rinfo->{host}->{$oname}->{trid}=$tmp if defined $tmp; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | $rinfo->{host}->{$oname}->{svtrid}=Net::DRI::Util::xml_child_content($c,$ns,'svTRID'); | |||||||||||||||||||||||||||||||||||||||||
| 316 | } elsif ($name eq 'paDate') | ||||||||||||||||||||||||||||||||||||||||||
| 317 | { | ||||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | $rinfo->{host}->{$oname}->{date}=$po->parse_iso8601($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 319 | } | ||||||||||||||||||||||||||||||||||||||||||
| 320 | } | ||||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 322 | } | ||||||||||||||||||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||||||||||||||||
| 324 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 325 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||