| 1 | package Net::EPP::ResponseCodes; | ||||||||||
| 2 | 1 | ▶ | use base qw(Exporter); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use vars qw(@EXPORT); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | =head1 NAME | ||||||||||
| 7 | |||||||||||
| 8 | Net::EPP::ResponseCodes - a module to export some constants that correspond to | ||||||||||
| 9 | EPP response codes. | ||||||||||
| 10 | |||||||||||
| 11 | =head1 SYNOPSIS | ||||||||||
| 12 | |||||||||||
| 13 | use Net::EPP::ResponseCodes; | ||||||||||
| 14 | use Net::EPP::Simple; | ||||||||||
| 15 | use strict; | ||||||||||
| 16 | |||||||||||
| 17 | my $epp = Net::EPP::Simple->new( | ||||||||||
| 18 | host => 'epp.nic.tld', | ||||||||||
| 19 | user => 'my-id', | ||||||||||
| 20 | pass => 'my-password', | ||||||||||
| 21 | ); | ||||||||||
| 22 | |||||||||||
| 23 | my $result = $epp->domain_transfer_request('example.tld', 'foobar', 1); | ||||||||||
| 24 | |||||||||||
| 25 | if ($result) { | ||||||||||
| 26 | print "Transfer initiated OK\n"; | ||||||||||
| 27 | |||||||||||
| 28 | } else { | ||||||||||
| 29 | if ($Net::EPP::Simple::Code == OBJECT_PENDING_TRANSFER) { | ||||||||||
| 30 | print "Error: domain is already pending transfer\n"; | ||||||||||
| 31 | |||||||||||
| 32 | } elsif ($Net::EPP::Simple::Code == INVALID_AUTH_INFO) { | ||||||||||
| 33 | print "Error: invalid authcode provided\n"; | ||||||||||
| 34 | |||||||||||
| 35 | } elsif ($Net::EPP::Simple::Code == OBJECT_DOES_NOT_EXIST) { | ||||||||||
| 36 | print "Error: domain not found\n"; | ||||||||||
| 37 | |||||||||||
| 38 | } elsif ($Net::EPP::Simple::Code == STATUS_PROHIBITS_OP) { | ||||||||||
| 39 | print "Error: domain cannot be transferred\n"; | ||||||||||
| 40 | |||||||||||
| 41 | } else { | ||||||||||
| 42 | print "Error code $Net::EPP::Simple::Code\n"; | ||||||||||
| 43 | |||||||||||
| 44 | } | ||||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | =head1 DESCRIPTION | ||||||||||
| 48 | |||||||||||
| 49 | Every response sent to the client by an EPP server contains at least one | ||||||||||
| 50 | C<E<lt>resultE<gt>> element that has a C<code> attribute. This is a four-digit | ||||||||||
| 51 | numeric code that describes the result of the request. This module exports a set | ||||||||||
| 52 | of constants that provide handy mnemonics for each of the defined codes. | ||||||||||
| 53 | |||||||||||
| 54 | =head1 EXPORTS | ||||||||||
| 55 | |||||||||||
| 56 | C<Net::EPP::ResponseCodes> exports the following constants. The number in | ||||||||||
| 57 | brackets is the integer value associated with the constant. | ||||||||||
| 58 | |||||||||||
| 59 | =head2 Successful command completion responses (1nnn) | ||||||||||
| 60 | |||||||||||
| 61 | =over | ||||||||||
| 62 | |||||||||||
| 63 | =item OK (1000) | ||||||||||
| 64 | |||||||||||
| 65 | =item OK_PENDING (1001) | ||||||||||
| 66 | |||||||||||
| 67 | =item OK_NO_MESSAGES (1300) | ||||||||||
| 68 | |||||||||||
| 69 | =item OK_MESSAGES (1301) | ||||||||||
| 70 | |||||||||||
| 71 | =item OK_BYE (1500) | ||||||||||
| 72 | |||||||||||
| 73 | =back | ||||||||||
| 74 | |||||||||||
| 75 | =head2 Command error responses (2nnn) | ||||||||||
| 76 | |||||||||||
| 77 | =head3 Protocol Syntax | ||||||||||
| 78 | |||||||||||
| 79 | =over | ||||||||||
| 80 | |||||||||||
| 81 | =item UNKNOWN_COMMAND (2000) | ||||||||||
| 82 | |||||||||||
| 83 | =item SYNTAX_ERROR (2001) | ||||||||||
| 84 | |||||||||||
| 85 | =item USE_ERROR (2002) | ||||||||||
| 86 | |||||||||||
| 87 | =item MISSING_PARAM (2003) | ||||||||||
| 88 | |||||||||||
| 89 | =item PARAM_RANGE_ERROR (2004) | ||||||||||
| 90 | |||||||||||
| 91 | =item PARAM_SYNTAX_ERROR (2005) | ||||||||||
| 92 | |||||||||||
| 93 | =back | ||||||||||
| 94 | |||||||||||
| 95 | =head3 Implementation-specific Rules | ||||||||||
| 96 | |||||||||||
| 97 | =over | ||||||||||
| 98 | |||||||||||
| 99 | =item UNIMPLEMENTED_VERSION (2100) | ||||||||||
| 100 | |||||||||||
| 101 | =item UNIMPLEMENTED_COMMAND (2101) | ||||||||||
| 102 | |||||||||||
| 103 | =item UNIMPLEMENTED_OPTION (2102) | ||||||||||
| 104 | |||||||||||
| 105 | =item UNIMPLEMENTED_EXTENSION (2103) | ||||||||||
| 106 | |||||||||||
| 107 | =item BILLING_FAILURE (2104) | ||||||||||
| 108 | |||||||||||
| 109 | =item NOT_RENEWABLE (2105) | ||||||||||
| 110 | |||||||||||
| 111 | =item NOT_TRANSFERRABLE (2106) | ||||||||||
| 112 | |||||||||||
| 113 | =back | ||||||||||
| 114 | |||||||||||
| 115 | =head3 Security (22nn) | ||||||||||
| 116 | |||||||||||
| 117 | =over | ||||||||||
| 118 | |||||||||||
| 119 | =item AUTHENTICATION_ERROR (2200) | ||||||||||
| 120 | |||||||||||
| 121 | =item AUTHORISATION_ERROR (2201) | ||||||||||
| 122 | |||||||||||
| 123 | =item AUTHORIZATION_ERROR (2201) | ||||||||||
| 124 | |||||||||||
| 125 | =item INVALID_AUTH_INFO (2202) | ||||||||||
| 126 | |||||||||||
| 127 | =back | ||||||||||
| 128 | |||||||||||
| 129 | =head3 Data Management (23nn) | ||||||||||
| 130 | |||||||||||
| 131 | =over | ||||||||||
| 132 | |||||||||||
| 133 | =item OBJECT_PENDING_TRANSFER (2300) | ||||||||||
| 134 | |||||||||||
| 135 | =item OBJECT_NOT_PENDING_TRANSFER (2301) | ||||||||||
| 136 | |||||||||||
| 137 | =item OBJECT_EXISTS (2302) | ||||||||||
| 138 | |||||||||||
| 139 | =item OBJECT_DOES_NOT_EXIST (2303) | ||||||||||
| 140 | |||||||||||
| 141 | =item STATUS_PROHIBITS_OP (2304) | ||||||||||
| 142 | |||||||||||
| 143 | =item ASSOC_PROHIBITS_OP (2305) | ||||||||||
| 144 | |||||||||||
| 145 | =item PARAM_POLICY_ERROR (2306) | ||||||||||
| 146 | |||||||||||
| 147 | =item UNIMPLEMENTED_OBJECT_SERVICE (2307) | ||||||||||
| 148 | |||||||||||
| 149 | =item DATA_MGMT_POLICY_VIOLATION (2308) | ||||||||||
| 150 | |||||||||||
| 151 | =back | ||||||||||
| 152 | |||||||||||
| 153 | =head3 Server System (24nn) | ||||||||||
| 154 | |||||||||||
| 155 | =over | ||||||||||
| 156 | |||||||||||
| 157 | =item COMMAND_FAILED (2400) | ||||||||||
| 158 | |||||||||||
| 159 | =back | ||||||||||
| 160 | |||||||||||
| 161 | =head3 Connection Management (25nn) | ||||||||||
| 162 | |||||||||||
| 163 | =over | ||||||||||
| 164 | |||||||||||
| 165 | =item COMMAND_FAILED_BYE (2500) | ||||||||||
| 166 | |||||||||||
| 167 | =item AUTH_FAILED_BYE (2501) | ||||||||||
| 168 | |||||||||||
| 169 | =item SESSION_LIMIT_EXCEEDED_BYE (2502) | ||||||||||
| 170 | |||||||||||
| 171 | =back | ||||||||||
| 172 | |||||||||||
| 173 | =head1 COPYRIGHT | ||||||||||
| 174 | |||||||||||
| 175 | This module is (c) 2008 - 2023 CentralNic Ltd and 2024 Gavin Brown. This module | ||||||||||
| 176 | is free software; you can redistribute it and/or modify it under the same terms | ||||||||||
| 177 | as Perl itself. | ||||||||||
| 178 | |||||||||||
| 179 | =cut | ||||||||||
| 180 | |||||||||||
| 181 | # | ||||||||||
| 182 | # Successful command completion responses: | ||||||||||
| 183 | # | ||||||||||
| 184 | 1 | ▶ | use constant OK => 1000; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 185 | 1 | ▶ | use constant OK_PENDING => 1001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 186 | 1 | ▶ | use constant OK_NO_MESSAGES => 1300; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 187 | 1 | ▶ | use constant OK_MESSAGES => 1301; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 188 | 1 | ▶ | use constant OK_BYE => 1500; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 189 | |||||||||||
| 190 | # | ||||||||||
| 191 | # Command error responses: | ||||||||||
| 192 | # | ||||||||||
| 193 | |||||||||||
| 194 | # Protocol Syntax: | ||||||||||
| 195 | 1 | ▶ | use constant UNKNOWN_COMMAND => 2000; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 196 | 1 | ▶ | use constant SYNTAX_ERROR => 2001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 197 | 1 | ▶ | use constant USE_ERROR => 2002; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 198 | 1 | ▶ | use constant MISSING_PARAM => 2003; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 199 | 1 | ▶ | use constant PARAM_RANGE_ERROR => 2004; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 200 | 1 | ▶ | use constant PARAM_SYNTAX_ERROR => 2005; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 201 | |||||||||||
| 202 | # Implementation-specific Rules: | ||||||||||
| 203 | 1 | ▶ | use constant UNIMPLEMENTED_VERSION => 2100; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 204 | 1 | ▶ | use constant UNIMPLEMENTED_COMMAND => 2101; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 205 | 1 | ▶ | use constant UNIMPLEMENTED_OPTION => 2102; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 206 | 1 | ▶ | use constant UNIMPLEMENTED_EXTENSION => 2103; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 207 | 1 | ▶ | use constant BILLING_FAILURE => 2104; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 208 | 1 | ▶ | use constant NOT_RENEWABLE => 2105; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 209 | 1 | ▶ | use constant NOT_TRANSFERRABLE => 2106; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 210 | |||||||||||
| 211 | # Security: | ||||||||||
| 212 | 1 | ▶ | use constant AUTHENTICATION_ERROR => 2200; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 213 | 1 | ▶ | use constant AUTHORISATION_ERROR => 2201; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 214 | 1 | ▶ | use constant AUTHORIZATION_ERROR => 2201; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 215 | 1 | ▶ | use constant INVALID_AUTH_INFO => 2202; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 216 | |||||||||||
| 217 | # Data Management: | ||||||||||
| 218 | 1 | ▶ | use constant OBJECT_PENDING_TRANSFER => 2300; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 219 | 1 | ▶ | use constant OBJECT_NOT_PENDING_TRANSFER => 2301; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 220 | 1 | ▶ | use constant OBJECT_EXISTS => 2302; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 221 | 1 | ▶ | use constant OBJECT_DOES_NOT_EXIST => 2303; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 222 | 1 | ▶ | use constant STATUS_PROHIBITS_OP => 2304; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 223 | 1 | ▶ | use constant ASSOC_PROHIBITS_OP => 2305; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 224 | 1 | ▶ | use constant PARAM_POLICY_ERROR => 2306; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 225 | 1 | ▶ | use constant UNIMPLEMENTED_OBJECT_SERVICE => 2307; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 226 | 1 | ▶ | use constant DATA_MGMT_POLICY_VIOLATION => 2308; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 227 | |||||||||||
| 228 | # Server System: | ||||||||||
| 229 | 1 | ▶ | use constant COMMAND_FAILED => 2400; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 230 | |||||||||||
| 231 | # Connection Management: | ||||||||||
| 232 | 1 | ▶ | use constant COMMAND_FAILED_BYE => 2500; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 233 | 1 | ▶ | use constant AUTH_FAILED_BYE => 2501; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 234 | 1 | ▶ | use constant SESSION_LIMIT_EXCEEDED_BYE => 2502; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 235 | |||||||||||
| 236 | 1 | our @EXPORT; | |||||||||
| 237 | 1 | my $package = __PACKAGE__; | |||||||||
| 238 | 1 | foreach my $constant (keys(%constant::declared)) { | |||||||||
| 239 | 242 | ▶ | if ($constant =~ /^$package/) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 240 | 35 | $constant =~ s/^$package\:\://; | |||||||||
| 241 | 35 | push(@EXPORT, $constant); | |||||||||
| 242 | } | ||||||||||
| 243 | } | ||||||||||
| 244 | |||||||||||
| 245 | 1 | 1; | |||||||||