| 1 | ## Domain Registry Interface, .NO Result extension | ||||||||||||||||||||
| 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 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::Result; | ||||||||||||||||||||
| 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 | =pod | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | =head1 NAME | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | Net::DRI::Protocol::EPP::Extensions::NO::Result - .NO Result Condition EPP Mapping for Net::DRI | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | =head1 DESCRIPTION | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | Please see the README file for details. | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | =head1 SUPPORT | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | For now, support questions should be sent to: | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | =head1 SEE ALSO | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | =head1 AUTHOR | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | Trond Haugen, E<lt>info@norid.noE<gt> | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | =head1 COPYRIGHT | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | Copyright (c) 2008,2010,2013 UNINETT Norid AS, E<lt>http://www.norid.noE<gt>, | ||||||||||||||||||||
| 52 | Trond Haugen, E<lt>info@norid.noE<gt> | ||||||||||||||||||||
| 53 | Copyright (c) 2016 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 | 0 | ▶ | my ( $class, $version ) = @_; | ||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 69 | 0 | my %tmp = ( | |||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | check => [ undef, \&condition_parse ], | ||||||||||||||||||||
| 72 | info => [ undef, \&condition_parse ], | ||||||||||||||||||||
| 73 | create => [ undef, \&condition_parse ], | ||||||||||||||||||||
| 74 | delete => [ undef, \&condition_parse ], | ||||||||||||||||||||
| 75 | transfer_request => [ undef, \&condition_parse ], | ||||||||||||||||||||
| 76 | transfer_query => [ undef, \&condition_parse ], | ||||||||||||||||||||
| 77 | transfer_cancel => [ undef, \&condition_parse ], | ||||||||||||||||||||
| 78 | transfer_execute => [ undef, \&condition_parse ], | ||||||||||||||||||||
| 79 | update => [ undef, \&condition_parse ], | ||||||||||||||||||||
| 80 | renew => [ undef, \&condition_parse ], | ||||||||||||||||||||
| 81 | withdraw => [ undef, \&condition_parse ], | ||||||||||||||||||||
| 82 | nocommand => [ undef, \&condition_parse ], | ||||||||||||||||||||
| 83 | ); | ||||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | return { | ||||||||||||||||||||
| 86 | 0 | 'domain' => \%tmp, | |||||||||||||||||||
| 87 | 'contact' => \%tmp, | ||||||||||||||||||||
| 88 | 'host' => \%tmp, | ||||||||||||||||||||
| 89 | 'session' => { 'login' => [ undef, \&condition_parse ] }, | ||||||||||||||||||||
| 90 | }; | ||||||||||||||||||||
| 91 | } | ||||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | sub condition_parse { | ||||||||||||||||||||
| 94 | 0 | ▶ | my ( $po, $otype, $oaction, $oname, $rinfo ) = @_; | ||||||||||||||||||
|
Subroutine
condition_parse: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 95 | 0 | my $mes = $po->message(); | |||||||||||||||||||
| 96 | |||||||||||||||||||||
| 97 | 0 | my $condata = $mes->get_extension( 'no-ext-result', 'conditions' ); | |||||||||||||||||||
| 98 | 0 | ▶ | return unless $condata; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 99 | |||||||||||||||||||||
| 100 | 0 | parse( $mes, $otype, $oname, $rinfo, $condata ); | |||||||||||||||||||
| 101 | 0 | return 1; | |||||||||||||||||||
| 102 | } | ||||||||||||||||||||
| 103 | |||||||||||||||||||||
| 104 | sub parse { | ||||||||||||||||||||
| 105 | 0 | ▶ | my ( $mes, $otype, $oname, $rinfo, $node ) = @_; | ||||||||||||||||||
|
Subroutine
parse: not called CC=10 SCAR=47.0
Pod
undocumented
| |||||||||||||||||||||
| 106 | 0 | my $NS = $mes->ns('no-ext-result'); | |||||||||||||||||||
| 107 | 0 | my @conditions; | |||||||||||||||||||
| 108 | |||||||||||||||||||||
| 109 | 0 | foreach my $el ( $node->getElementsByTagNameNS( $NS, 'condition' ) ) { | |||||||||||||||||||
| 110 | 0 | my %con; | |||||||||||||||||||
| 111 | 0 | my $c = $el->getFirstChild(); | |||||||||||||||||||
| 112 | |||||||||||||||||||||
| 113 | 0 | ▶ | $con{code} = $el->getAttribute('code') if $el->getAttribute('code'); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 114 | 0 | ▶ | $con{severity} = $el->getAttribute('severity') | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 115 | if $el->getAttribute('severity'); | ||||||||||||||||||||
| 116 | |||||||||||||||||||||
| 117 | 0 | ▶ | while ($c) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 118 | 0 | ▶ | my $name = $c->localname() || $c->nodeName(); | ||||||||||||||||||
|
Condition0%0/3
$c->localname || $c->nodeName
MC/DC0%0/2
$c->localname || $c->nodeName
$c->localname
$c->nodeName
Truth table0%0/3
A || B
A= $c->localnameB= $c->nodeName
| |||||||||||||||||||||
| 119 | 0 | ▶ | next unless $name; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 120 | 0 | ▶ | if ( $name =~ m/^(msg|details)$/mx ) { | ||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||
| 121 | 0 | $con{$1} = $c->getFirstChild()->getData(); | |||||||||||||||||||
| 122 | } elsif ( $name =~ m/^attributes$/mx ) { | ||||||||||||||||||||
| 123 | 0 | foreach my $attr ( $c->getChildrenByTagNameNS( $NS, 'attr' ) ) | |||||||||||||||||||
| 124 | { | ||||||||||||||||||||
| 125 | 0 | my $attrname = $attr->getAttribute('name'); | |||||||||||||||||||
| 126 | 0 | $con{ "attr " . $attrname } | |||||||||||||||||||
| 127 | = $attr->getFirstChild()->getData(); | ||||||||||||||||||||
| 128 | } | ||||||||||||||||||||
| 129 | } | ||||||||||||||||||||
| 130 | 0 | $c = $c->getNextSibling(); | |||||||||||||||||||
| 131 | } | ||||||||||||||||||||
| 132 | 0 | push @conditions, \%con; | |||||||||||||||||||
| 133 | 0 | $mes->add_to_extra_info({from=>'no',type=>'text',message => $con{msg}, %con}); | |||||||||||||||||||
| 134 | } | ||||||||||||||||||||
| 135 | |||||||||||||||||||||
| 136 | # Extension results can be returned in all 3 object types | ||||||||||||||||||||
| 137 | 0 | $rinfo->{$otype}->{$oname}->{conditions} = \@conditions; | |||||||||||||||||||
| 138 | |||||||||||||||||||||
| 139 | 0 | return; | |||||||||||||||||||
| 140 | } | ||||||||||||||||||||
| 141 | ############################################################################## | ||||||||||||||||||||
| 142 | 1 | 1; | |||||||||||||||||||