« DRI/Protocol/EPP/Extensions/EURid/Notifications.pm
↑ Summary
DRI/Protocol/EPP/Extensions/CIRA/Agreement.pm »
| 1 | ## Domain Registry Interface, RRP Connection handling | ||||||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2005,2007-2010 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::RRP::Connection; | ||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||
| 17 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 18 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||
| 20 | 2 | ▶ | use Net::DRI::Protocol::RRP::Message; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 21 | 2 | ▶ | use Net::DRI::Protocol::ResultStatus; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 22 | 2 | ▶ | use Net::DRI::Data::Raw; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 23 | 2 | ▶ | use Net::DRI::Util; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||
| 25 | =pod | ||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||
| 27 | =head1 NAME | ||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||
| 29 | Net::DRI::Protocol::RRP::Connection - RRP Connection handling 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,2007-2010 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 login | ||||||||||||||||||||||||||||||||
| 68 | { | ||||||||||||||||||||||||||||||||
| 69 | 0 | ▶ | my ($class,$cm,$id,$pass,$cltrid,$dr,$newpass)=@_; | ||||||||||||||||||||||||||||||
|
Subroutine
login: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 70 | 0 | my %h=(Id => $id, Password => $pass); | |||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | $h{NewPassword}=$newpass if (defined($newpass) && $newpass); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $newpass and $newpass
MC/DC0%0/2
defined $newpass and $newpass
defined $newpass
$newpass
Truth table0%0/3
A and B
A= defined $newpassB= $newpass
| |||||||||||||||||||||||||||||||||
| 72 | 0 | my $mes=Net::DRI::Protocol::RRP::Message->new({ command => 'session', options => \%h}); | |||||||||||||||||||||||||||||||
| 73 | 0 | return $mes; | |||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||
| 76 | sub logout | ||||||||||||||||||||||||||||||||
| 77 | { | ||||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | my ($class,$cm,$cltrid)=@_; | ||||||||||||||||||||||||||||||
|
Subroutine
logout: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 79 | 0 | my $mes=Net::DRI::Protocol::RRP::Message->new({ command => 'quit' }); | |||||||||||||||||||||||||||||||
| 80 | 0 | return $mes; | |||||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||
| 83 | sub keepalive | ||||||||||||||||||||||||||||||||
| 84 | { | ||||||||||||||||||||||||||||||||
| 85 | 0 | ▶ | my ($class,$cm,$cltrid)=@_; | ||||||||||||||||||||||||||||||
|
Subroutine
keepalive: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 86 | 0 | my $mes=Net::DRI::Protocol::RRP::Message->new({ command => 'describe' }); | |||||||||||||||||||||||||||||||
| 87 | 0 | return $mes; | |||||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||
| 90 | #################################################################################################### | ||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||
| 92 | sub read_data | ||||||||||||||||||||||||||||||||
| 93 | { | ||||||||||||||||||||||||||||||||
| 94 | 0 | ▶ | my ($class,$to,$sock)=@_; | ||||||||||||||||||||||||||||||
|
Subroutine
read_data: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||
| 96 | 0 | my (@l); | |||||||||||||||||||||||||||||||
| 97 | 0 | ▶ | while(my $l=$sock->getline()) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 98 | { | ||||||||||||||||||||||||||||||||
| 99 | 0 | push @l,$l; | |||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | last if ($l=~m/^\.\s*\n?$/); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||
| 102 | 0 | @l=map { Net::DRI::Util::decode_ascii($_); } @l; | |||||||||||||||||||||||||||||||
| 103 | 0 | ▶ | die(Net::DRI::Protocol::ResultStatus->new_error('COMMAND_FAILED_CLOSING',@l? $l[0] : '<empty message from server>','en')) unless (@l && $l[-1]=~m/^\.\s*\n?$/); | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
@l and $l[-1] =~ /^\.\s*\n?$/
MC/DC0%0/2
@l and $l[-1] =~ /^\.\s*\n?$/
@l
$l[-1] =~ /^\.\s*\n?$/
Truth table0%0/3
A and B
A= @lB= $l[-1] =~ /^\.\s*\n?$/
| |||||||||||||||||||||||||||||||||
| 104 | 0 | return Net::DRI::Data::Raw->new_from_array(\@l); | |||||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||
| 107 | sub write_message | ||||||||||||||||||||||||||||||||
| 108 | { | ||||||||||||||||||||||||||||||||
| 109 | 0 | ▶ | my ($self,$to,$msg)=@_; | ||||||||||||||||||||||||||||||
|
Subroutine
write_message: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 110 | 0 | return Net::DRI::Util::encode_ascii($msg); | |||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||
| 113 | sub parse_greeting | ||||||||||||||||||||||||||||||||
| 114 | { | ||||||||||||||||||||||||||||||||
| 115 | 0 | ▶ | my ($class,$dc)=@_; | ||||||||||||||||||||||||||||||
|
Subroutine
parse_greeting: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 116 | 0 | my ($code,$msg)=find_code($dc); | |||||||||||||||||||||||||||||||
| 117 | 0 | ▶ | unless (defined($code) && ($code==0)) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $code and $code == 0
MC/DC0%0/2
defined $code and $code == 0
defined $code
$code == 0
Truth table0%0/3
A and B
A= defined $codeB= $code == 0
| |||||||||||||||||||||||||||||||||
| 118 | { | ||||||||||||||||||||||||||||||||
| 119 | 0 | ▶ | return Net::DRI::Protocol::ResultStatus->new_error('COMMAND_SYNTAX_ERROR',($msg || '?').' ('.($code || '?').')','en'); | ||||||||||||||||||||||||||||||
|
Condition0%0/4
$msg || '?'
$code || '?'
MC/DC0%0/1
$msg || '?'
$msg
MC/DC0%0/1
$code || '?'
$code
Truth table0%0/2
A
A= $msg
Truth table0%0/2
A
A= $code
| |||||||||||||||||||||||||||||||||
| 120 | } else | ||||||||||||||||||||||||||||||||
| 121 | { | ||||||||||||||||||||||||||||||||
| 122 | 0 | return Net::DRI::Protocol::ResultStatus->new_success('COMMAND_SUCCESSFUL','Greeting OK','en'); | |||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||
| 126 | sub parse_login | ||||||||||||||||||||||||||||||||
| 127 | { | ||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | my ($class,$dc)=@_; | ||||||||||||||||||||||||||||||
|
Subroutine
parse_login: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 129 | 0 | my ($code,$msg)=find_code($dc); | |||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | unless (defined($code) && ($code==200)) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $code and $code == 200
MC/DC0%0/2
defined $code and $code == 200
defined $code
$code == 200
Truth table0%0/3
A and B
A= defined $codeB= $code == 200
| |||||||||||||||||||||||||||||||||
| 131 | { | ||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | my $eppcode=(defined($code))? Net::DRI::Protocol::RRP::Message::_eppcode($code) : 'COMMAND_SYNTAX_ERROR'; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 133 | 0 | ▶ | return Net::DRI::Protocol::ResultStatus->new_error($eppcode,($msg || 'Login failed').' ('.($code || '?').')','en'); | ||||||||||||||||||||||||||||||
|
Condition0%0/4
$msg || 'Login failed'
$code || '?'
MC/DC0%0/1
$msg || 'Login failed'
$msg
MC/DC0%0/1
$code || '?'
$code
Truth table0%0/2
A
A= $msg
Truth table0%0/2
A
A= $code
| |||||||||||||||||||||||||||||||||
| 134 | } else | ||||||||||||||||||||||||||||||||
| 135 | { | ||||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | return Net::DRI::Protocol::ResultStatus->new_success('COMMAND_SUCCESSFUL',$msg || 'Login OK','en'); | ||||||||||||||||||||||||||||||
|
Condition0%0/2
$msg || 'Login OK'
MC/DC0%0/1
$msg || 'Login OK'
$msg
Truth table0%0/2
A
A= $msg
| |||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||
| 140 | sub parse_logout | ||||||||||||||||||||||||||||||||
| 141 | { | ||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | my ($class,$dc)=@_; | ||||||||||||||||||||||||||||||
|
Subroutine
parse_logout: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 143 | 0 | my ($code,$msg)=find_code($dc); | |||||||||||||||||||||||||||||||
| 144 | 0 | ▶ | unless (defined($code) && ($code==220)) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $code and $code == 220
MC/DC0%0/2
defined $code and $code == 220
defined $code
$code == 220
Truth table0%0/3
A and B
A= defined $codeB= $code == 220
| |||||||||||||||||||||||||||||||||
| 145 | { | ||||||||||||||||||||||||||||||||
| 146 | 0 | ▶ | my $eppcode=(defined($code))? Net::DRI::Protocol::RRP::Message::_eppcode($code) : 'COMMAND_SYNTAX_ERROR'; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 147 | 0 | ▶ | return Net::DRI::Protocol::ResultStatus->new_error($eppcode,($msg || 'Logout failed').' ('.($code || '?').')','en'); | ||||||||||||||||||||||||||||||
|
Condition0%0/4
$msg || 'Logout failed'
$code || '?'
MC/DC0%0/1
$msg || 'Logout failed'
$msg
MC/DC0%0/1
$code || '?'
$code
Truth table0%0/2
A
A= $msg
Truth table0%0/2
A
A= $code
| |||||||||||||||||||||||||||||||||
| 148 | } else | ||||||||||||||||||||||||||||||||
| 149 | { | ||||||||||||||||||||||||||||||||
| 150 | 0 | ▶ | return Net::DRI::Protocol::ResultStatus->new_success('COMMAND_SUCCESSFUL_END',$msg || 'Logout OK','en'); | ||||||||||||||||||||||||||||||
|
Condition0%0/2
$msg || 'Logout OK'
MC/DC0%0/1
$msg || 'Logout OK'
$msg
Truth table0%0/2
A
A= $msg
| |||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||
| 152 | } | ||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||
| 154 | sub find_code | ||||||||||||||||||||||||||||||||
| 155 | { | ||||||||||||||||||||||||||||||||
| 156 | 0 | ▶ | my $dc=shift; | ||||||||||||||||||||||||||||||
|
Subroutine
find_code: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 157 | 0 | my @a=$dc->as_array(); | |||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | return (0,'LOGIN') if ($a[0]=~m/^.+ RRP Server version/); ## initial login | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 159 | 0 | ▶ | return () unless $#a>0; ## at least 2 lines | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | return () unless $a[-1]=~m/^\.\s*\n?$/; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 161 | 0 | ▶ | return () unless $a[0]=~m/^(\d+) (\S.+)$/; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 162 | 0 | return (0+$1,$2); | |||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||
| 165 | sub transport_default | ||||||||||||||||||||||||||||||||
| 166 | { | ||||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | my ($self,$tname)=@_; | ||||||||||||||||||||||||||||||
|
Subroutine
transport_default: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 168 | 0 | return (defer => 0, socktype => 'ssl', ssl_version => 'TLSv1', remote_port => 648); | |||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||
| 171 | #################################################################################################### | ||||||||||||||||||||||||||||||||
| 172 | 2 | 1; | |||||||||||||||||||||||||||||||