| 1 | ## Domain Registry Interface, .NO message extensions | ||||||||||||||||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2008-2010,2013 UNINETT Norid AS, E<lt>http://www.norid.noE<gt>, | ||||||||||||||||||||||||||||||||||||||||||
| 4 | ## Trond Haugen E<lt>info@norid.noE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 5 | ## Copyright (c) 2016,2018 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||||||||||||||||
| 6 | ## All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 7 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 8 | ## This file is part of Net::DRI | ||||||||||||||||||||||||||||||||||||||||||
| 9 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 10 | ## Net::DRI is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||
| 11 | ## it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||
| 12 | ## the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||
| 13 | ## (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||
| 14 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 15 | ## See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||
| 16 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | package Net::DRI::Protocol::EPP::Extensions::NO::Message; | ||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | use Net::DRI::Util; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | ▶ | use Net::DRI::Exception; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 1 | ▶ | use Net::DRI::Protocol::EPP::Core::Domain; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | 1 | ▶ | use Net::DRI::Protocol::EPP::Extensions::NO::Contact; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 1 | ▶ | use Net::DRI::Protocol::EPP::Extensions::NO::Host; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 1 | ▶ | use Net::DRI::Protocol::EPP::Extensions::NO::Result; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 1 | ▶ | use Net::DRI::Protocol::EPP::Util; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | Net::DRI::Protocol::EPP::Extensions::NO::Message - .NO Mesage Extensions for Net::DRI | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | Please see the README file for details. | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | Trond Haugen, E<lt>info@norid.noE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | Copyright (c) 2008-2010,2013 UNINETT Norid AS, E<lt>http://www.norid.noE<gt>, | ||||||||||||||||||||||||||||||||||||||||||
| 60 | Trond Haugen E<lt>info@norid.noE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 61 | Copyright (c) 2016,2018 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||||||||||||||||
| 62 | All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||
| 65 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||
| 66 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||
| 67 | (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||
| 69 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | ################################################################################################ | ||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||
| 75 | sub register_commands { | ||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | my ( $class, $version ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | my %tmp = ( | |||||||||||||||||||||||||||||||||||||||||
| 79 | noretrieve => [ \&pollreq, \&parse_poll ], | ||||||||||||||||||||||||||||||||||||||||||
| 80 | nodelete => [ \&pollack, \&Net::DRI::Protocol::EPP::Extensions::NO::Result::condition_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 81 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | return { 'message' => \%tmp }; | |||||||||||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||
| 86 | sub facet { | ||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | my ( $epp, $rd ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
facet: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | return Net::DRI::Protocol::EPP::Extensions::NO::Host::build_facets( $epp, $rd ); | |||||||||||||||||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||
| 92 | sub pollack { | ||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | my ( $epp, $msgid, $rd ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pollack: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | my $mes = $epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | my $r = ( $mes->command( [ [ 'poll', { op => 'ack', msgID => $msgid } ] ] ) ); | |||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | if (defined($rd->{facets}) && $rd->{facets}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $rd->{"facets"} and $rd->{"facets"}
MC/DC0%0/2
defined $rd->{"facets"} and $rd->{"facets"}
defined $rd->{"facets"}
$rd->{"facets"}
Truth table0%0/3
A and B
A= defined $rd->{"facets"}B= $rd->{"facets"}
| |||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | $r = facet( $epp, $rd ); | |||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | return $r; | |||||||||||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | sub pollreq { | ||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | my ( $epp, $rd ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pollreq: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | my $mes = $epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | my $r = ( $mes->command( [ [ 'poll', { op => 'req' } ] ] ) ); | |||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | if (defined($rd->{facets}) && $rd->{facets}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $rd->{"facets"} and $rd->{"facets"}
MC/DC0%0/2
defined $rd->{"facets"} and $rd->{"facets"}
defined $rd->{"facets"}
$rd->{"facets"}
Truth table0%0/3
A and B
A= defined $rd->{"facets"}B= $rd->{"facets"}
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | $r = facet( $epp, $rd ); | |||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | return $r; | |||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||
| 118 | sub parse_resp_result | ||||||||||||||||||||||||||||||||||||||||||
| 119 | { | ||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | my ($node, $NS, $rinfo, $msgid)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_resp_result: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | push @{$rinfo->{message}->{$msgid}->{results}},Net::DRI::Protocol::EPP::Util::parse_node_result($node,$NS,'no'); | |||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | sub transfer_resp_parse { | ||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | ▶ | my ($po, $trndata, $oname, $rinfo, $msgid)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
transfer_resp_parse: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | ▶ | return unless $trndata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($trndata)) | |||||||||||||||||||||||||||||||||||||||||
| 132 | { | ||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | my ($name,$c)=@$el; | |||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | if ($name eq 'name') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | $oname=lc($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | $rinfo->{message}->{$msgid}->{domain}->{$oname}->{action}='transfer'; | |||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | $rinfo->{message}->{$msgid}->{domain}->{$oname}->{exist}=1; | |||||||||||||||||||||||||||||||||||||||||
| 140 | } elsif ($name=~m/^(trStatus|reID|acID)$/mx) { | ||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | ▶ | $rinfo->{message}->{$msgid}->{domain}->{$oname}->{$1}=$c->textContent() if ($c->getFirstChild()); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 142 | } elsif ($name=~m/^(reDate|acDate|exDate)$/mx) { | ||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | $rinfo->{message}->{$msgid}->{domain}->{$oname}->{$1}=$po->parse_iso8601($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||
| 149 | sub contact_resp_parse { | ||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | ▶ | my ($po, $credata, $oname, $rinfo, $msgid)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
contact_resp_parse: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | ▶ | return unless $credata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($credata)) | |||||||||||||||||||||||||||||||||||||||||
| 155 | { | ||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | my ($name,$c)=@$el; | |||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | ▶ | if ($name eq 'id') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 158 | { | ||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | my $new=$c->getFirstChild()->getData(); | |||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | $rinfo->{message}->{$msgid}->{contact}->{$oname}->{id}=$new if (defined($oname) && ($oname ne $new)); ## registry may give another id than the one we requested or not take ours into account at all ! | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $oname and $oname ne $new
MC/DC0%0/2
defined $oname and $oname ne $new
defined $oname
$oname ne $new
Truth table0%0/3
A and B
A= defined $onameB= $oname ne $new
| |||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | $oname=$new; | |||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | $rinfo->{message}->{$msgid}->{contact}->{$oname}->{id}=$oname; | |||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | $rinfo->{message}->{$msgid}->{contact}->{$oname}->{action}='create'; | |||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | $rinfo->{message}->{$msgid}->{contact}->{$oname}->{exist}=1; | |||||||||||||||||||||||||||||||||||||||||
| 165 | } elsif ($name=~m/^(crDate)$/) | ||||||||||||||||||||||||||||||||||||||||||
| 166 | { | ||||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | $rinfo->{message}->{$msgid}->{contact}->{$oname}->{$1}=$po->parse_iso8601($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 168 | } | ||||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||
| 173 | ## We take into account all parse functions, to be able to parse any result | ||||||||||||||||||||||||||||||||||||||||||
| 174 | sub parse_poll { | ||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | ▶ | my ( $po, $otype, $oaction, $oname, $rinfo ) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_poll: not called CC=34 SCAR=70.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | my $mes = $po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | my $eppNS = $mes->ns('epp'); | |||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||
| 180 | # both message and results are defined by the same no-ext-result schema | ||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | my $NS = $mes->ns('no-ext-result'); | |||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | ▶ | return if $mes->result_is('COMMAND_SUCCESSFUL_QUEUE_EMPTY'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | my $msgid = $mes->msg_id(); | |||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | $rinfo->{message}->{session}->{last_id} = $msgid; | |||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||
| 189 | ## Parse any message | ||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | my $mesdata = $mes->get_response('no-ext-result','message'); | |||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | $rinfo->{$otype}->{$oname}->{message} = $mesdata; | |||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | return unless $mesdata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | my ( $epp, $rep, $ext, $ctag, @conds, @tags ); | |||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | my $command = $mesdata->getAttribute('type'); | |||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | @tags = $mesdata->getElementsByTagNameNS( $NS, 'desc' ); | |||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||
| 200 | # We supplement the standard top desc with our more detailed one | ||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | ▶ | if (@tags && $tags[0]->getFirstChild() && $tags[0]->getFirstChild()->getData()) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
@tags and $tags[0]->getFirstChild and $tags[0]->getFirstChild->getData
@tags and $tags[0]->getFirstChild
MC/DC0%0/3
@tags and $tags[0]->getFirstChild and $tags[0]->getFirstChild->getData
@tags
$tags[0]->getFirstChild
$tags[0]->getFirstChild->getData
Truth table0%0/4
A and B and C
A= @tagsB= $tags[0]->getFirstChildC= $tags[0]->getFirstChild->getData
| |||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | $rinfo->{message}->{$msgid}->{nocontent} = $tags[0]->getFirstChild()->getData(); | |||||||||||||||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||
| 205 | # | ||||||||||||||||||||||||||||||||||||||||||
| 206 | # Now the data tag | ||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | @tags = $mesdata->getElementsByTagNameNS( $NS, 'data' ); | |||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | ▶ | return unless @tags; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | my $data = $tags[0]; | |||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||||
| 212 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 213 | # Inside a data we can have variants, | ||||||||||||||||||||||||||||||||||||||||||
| 214 | # a normal result block in the start, then an <entry ..> | ||||||||||||||||||||||||||||||||||||||||||
| 215 | # which is a sequence, the other is a late response which will contain | ||||||||||||||||||||||||||||||||||||||||||
| 216 | # a complete and ordinary EPP response, only delayed. | ||||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||
| 218 | # | ||||||||||||||||||||||||||||||||||||||||||
| 219 | # Parse any ordinary result block(s) | ||||||||||||||||||||||||||||||||||||||||||
| 220 | # | ||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | foreach my $result ($data->getElementsByTagNameNS($eppNS,'result')) { | |||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | parse_resp_result($result, $eppNS, $rinfo, $msgid); | |||||||||||||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||
| 225 | ### | ||||||||||||||||||||||||||||||||||||||||||
| 226 | # Parse entry | ||||||||||||||||||||||||||||||||||||||||||
| 227 | # | ||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | @tags = $data->getElementsByTagNameNS( $NS, 'entry' ); | |||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | foreach my $entry (@tags) { | |||||||||||||||||||||||||||||||||||||||||
| 231 | 0 | ▶ | next unless ( defined( $entry->getAttribute('name') ) ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||
| 233 | 0 | ▶ | if ( $entry->getAttribute('name') eq 'objecttype' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 234 | $rinfo->{message}->{$msgid}->{object_type} | ||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | = $entry->getFirstChild()->getData(); | |||||||||||||||||||||||||||||||||||||||||
| 236 | } elsif ( $entry->getAttribute('name') eq 'command' ) { | ||||||||||||||||||||||||||||||||||||||||||
| 237 | $rinfo->{message}->{$msgid}->{action} | ||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | = $entry->getFirstChild()->getData(); | |||||||||||||||||||||||||||||||||||||||||
| 239 | } elsif ( $entry->getAttribute('name') eq 'objectname' ) { | ||||||||||||||||||||||||||||||||||||||||||
| 240 | $rinfo->{message}->{$msgid}->{object_id} | ||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | = $entry->getFirstChild()->getData(); | |||||||||||||||||||||||||||||||||||||||||
| 242 | } elsif ( | ||||||||||||||||||||||||||||||||||||||||||
| 243 | $entry->getAttribute('name') =~ /^(domain|contact|host)$/mx ) | ||||||||||||||||||||||||||||||||||||||||||
| 244 | { | ||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | $rinfo->{message}->{$msgid}->{object_type} = $1; | |||||||||||||||||||||||||||||||||||||||||
| 246 | $rinfo->{message}->{$msgid}->{object_id} | ||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | = $entry->getFirstChild()->getData(); | |||||||||||||||||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||||||||||||||||
| 249 | } | ||||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | ▶ | $rinfo->{message}->{$msgid}->{action} ||= $command; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$rinfo->{"message"}{$msgid}{"action"} ||= $command
MC/DC0%0/2
$rinfo->{"message"}{$msgid}{"action"} ||= $command
$rinfo->{"message"}{$msgid}{"action"}
$command
Truth table0%0/3
A ||= B
A= $rinfo->{"message"}{$msgid}{"action"}B= $command
| |||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||
| 253 | ### | ||||||||||||||||||||||||||||||||||||||||||
| 254 | # The various EPP late response messages can be encapsulated in the service message data. | ||||||||||||||||||||||||||||||||||||||||||
| 255 | # There may in principle be any type of object response, so we try to parse all variants | ||||||||||||||||||||||||||||||||||||||||||
| 256 | # We try to use our various parse methods, copy the data and copy the data from it | ||||||||||||||||||||||||||||||||||||||||||
| 257 | # into our message structure. The delete the source data to hopefully not | ||||||||||||||||||||||||||||||||||||||||||
| 258 | # contaminate anything. | ||||||||||||||||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||||||||||||||||
| 260 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 261 | # inside a data and a late-responses, an inner TRID pair should exist. | ||||||||||||||||||||||||||||||||||||||||||
| 262 | # No more than one inner TRID pair is expected and handled | ||||||||||||||||||||||||||||||||||||||||||
| 263 | # In case more exist, the first one is used. | ||||||||||||||||||||||||||||||||||||||||||
| 264 | # Find the values and stash them in an $rinfo->{message}->{$msgid}->{trid} hash | ||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | ▶ | if (my $trid=(($data->getElementsByTagNameNS($eppNS,'trID'))[0])) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 267 | 0 | my $tmp=Net::DRI::Util::xml_child_content($trid,$eppNS,'clTRID'); | |||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | ▶ | $rinfo->{message}->{$msgid}->{trid}->{cltrid} = $tmp if defined($tmp); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 269 | 0 | $tmp = Net::DRI::Util::xml_child_content($trid,$eppNS,'svTRID'); | |||||||||||||||||||||||||||||||||||||||||
| 270 | 0 | ▶ | $rinfo->{message}->{$msgid}->{trid}->{svtrid} = $tmp if defined($tmp); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 271 | } | ||||||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||||||
| 273 | # Parse any domain command late response data | ||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | ▶ | if (my $infdata=$mes->get_response('domain','infData')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | Net::DRI::Protocol::EPP::Core::Domain::info_parse($po,'domain','info',$oname,$rinfo); | |||||||||||||||||||||||||||||||||||||||||
| 276 | |||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | ▶ | if (defined($rinfo->{domain}) && $rinfo->{domain}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $rinfo->{"domain"} and $rinfo->{"domain"}
MC/DC0%0/2
defined $rinfo->{"domain"} and $rinfo->{"domain"}
defined $rinfo->{"domain"}
$rinfo->{"domain"}
Truth table0%0/3
A and B
A= defined $rinfo->{"domain"}B= $rinfo->{"domain"}
| |||||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | $rinfo->{message}->{$msgid}->{domain} = $rinfo->{domain}; | |||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | delete($rinfo->{domain}); | |||||||||||||||||||||||||||||||||||||||||
| 280 | } | ||||||||||||||||||||||||||||||||||||||||||
| 281 | } | ||||||||||||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||||||||||||
| 283 | # Parse any domain transfer late response data | ||||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | ▶ | if (my $trndata = (($data->getElementsByTagNameNS($mes->ns('domain'), 'trnData'))[0])) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | transfer_resp_parse($po, $trndata, $oname, $rinfo, $msgid); | |||||||||||||||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||||||||||||
| 288 | # Parse any any contact create late response data | ||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | ▶ | if (my $credata = (($data->getElementsByTagNameNS($mes->ns('contact'), 'creData'))[0])) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | contact_resp_parse($po, $credata, $oname, $rinfo, $msgid); | |||||||||||||||||||||||||||||||||||||||||
| 291 | } | ||||||||||||||||||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||||||||||||||||
| 293 | # Parse any any contact info late response data | ||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | ▶ | if (my $condata = $mes->get_extension('no-ext-contact','infData')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | Net::DRI::Protocol::EPP::Extensions::NO::Contact::parse_info($po,'contact', 'info',$oname,$rinfo); | |||||||||||||||||||||||||||||||||||||||||
| 296 | 0 | ▶ | if (defined($rinfo->{contact}) && $rinfo->{contact}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $rinfo->{"contact"} and $rinfo->{"contact"}
MC/DC0%0/2
defined $rinfo->{"contact"} and $rinfo->{"contact"}
defined $rinfo->{"contact"}
$rinfo->{"contact"}
Truth table0%0/3
A and B
A= defined $rinfo->{"contact"}B= $rinfo->{"contact"}
| |||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | $rinfo->{message}->{$msgid}->{contact} = $rinfo->{contact}; | |||||||||||||||||||||||||||||||||||||||||
| 298 | 0 | delete ($rinfo->{contact}); | |||||||||||||||||||||||||||||||||||||||||
| 299 | } | ||||||||||||||||||||||||||||||||||||||||||
| 300 | } | ||||||||||||||||||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||||||||||||||||
| 302 | # Parse any any host info late response data | ||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | ▶ | if (my $condata = $mes->get_extension('no-ext-host','infData')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | Net::DRI::Protocol::EPP::Extensions::NO::Host::parse_info($po,'host','info',$oname,$rinfo); | |||||||||||||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | ▶ | if (defined($rinfo->{host}) && $rinfo->{host}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $rinfo->{"host"} and $rinfo->{"host"}
MC/DC0%0/2
defined $rinfo->{"host"} and $rinfo->{"host"}
defined $rinfo->{"host"}
$rinfo->{"host"}
Truth table0%0/3
A and B
A= defined $rinfo->{"host"}B= $rinfo->{"host"}
| |||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | $rinfo->{message}->{$msgid}->{host} = $rinfo->{host}; | |||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | delete($rinfo->{host}); | |||||||||||||||||||||||||||||||||||||||||
| 309 | } | ||||||||||||||||||||||||||||||||||||||||||
| 310 | } | ||||||||||||||||||||||||||||||||||||||||||
| 311 | |||||||||||||||||||||||||||||||||||||||||||
| 312 | # Parse any result extension conditions | ||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | my $innerepp=$data->getElementsByTagNameNS($eppNS,'epp')->shift(); | |||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | my $condata; | |||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | ▶ | if (defined($innerepp) && ($condata = $innerepp->getElementsByTagNameNS($NS,'conditions'))) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $innerepp and $condata = $innerepp->getElementsByTagNameNS($NS, "conditions")
MC/DC0%0/2
defined $innerepp and $condata = $innerepp->getElementsByTagNameNS($NS, "conditions")
defined $innerepp
$condata = $innerepp->getElementsByTagNameNS($NS, "conditions")
Truth table0%0/3
A and B
A= defined $innereppB= $condata = $innerepp->getElementsByTagNameNS($NS, "conditions")
| |||||||||||||||||||||||||||||||||||||||||||
| 316 | 0 | Net::DRI::Protocol::EPP::Extensions::NO::Result::parse($mes,$otype,$oname,$rinfo,$condata->shift()); | |||||||||||||||||||||||||||||||||||||||||
| 317 | |||||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | ▶ | if ((defined($rinfo->{$otype}->{$oname}->{conditions})) && | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $rinfo->{$otype}{$oname}{"conditions"} and $rinfo->{$otype}{$oname}{"conditions"}
MC/DC0%0/2
defined $rinfo->{$otype}{$oname}{"conditions"} and $rinfo->{$otype}{$oname}{"conditions"}
defined $rinfo->{$otype}{$oname}{"conditions"}
$rinfo->{$otype}{$oname}{"conditions"}
Truth table0%0/3
A and B
A= defined $rinfo->{$otype}{$oname}{"conditions"}B= $rinfo->{$otype}{$oname}{"conditions"}
| |||||||||||||||||||||||||||||||||||||||||||
| 319 | $rinfo->{$otype}->{$oname}->{conditions}) { | ||||||||||||||||||||||||||||||||||||||||||
| 320 | 0 | $rinfo->{message}->{$msgid}->{conditions} = $rinfo->{$otype}->{$oname}->{conditions}; | |||||||||||||||||||||||||||||||||||||||||
| 321 | #delete ($rinfo->{$otype}->{$oname}->{conditions}); | ||||||||||||||||||||||||||||||||||||||||||
| 322 | } | ||||||||||||||||||||||||||||||||||||||||||
| 323 | } | ||||||||||||||||||||||||||||||||||||||||||
| 324 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||
| 325 | } | ||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||
| 327 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 328 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||