line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (c) 2016 CentralNic Ltd. All rights reserved. This program is |
2
|
|
|
|
|
|
|
# free software; you can redistribute it and/or modify it under the same |
3
|
|
|
|
|
|
|
# terms as Perl itself. |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# $Id: ResponseCodes.pm,v 1.2 2011/01/04 10:37:33 gavin Exp $ |
6
|
|
|
|
|
|
|
package Net::EPP::ResponseCodes; |
7
|
1
|
|
|
1
|
|
3
|
use base qw(Exporter); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
58
|
|
8
|
1
|
|
|
1
|
|
4
|
use vars qw(@EXPORT); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
9
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Net::EPP::ResponseCodes - a module to export some constants that |
14
|
|
|
|
|
|
|
correspond to EPP response codes |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use Net::EPP::ResponseCodes; |
19
|
|
|
|
|
|
|
use Net::EPP::Simple; |
20
|
|
|
|
|
|
|
use strict; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $epp = Net::EPP::Simple->new( |
23
|
|
|
|
|
|
|
host => 'epp.nic.tld', |
24
|
|
|
|
|
|
|
user => 'my-id', |
25
|
|
|
|
|
|
|
pass => 'my-password', |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $result = $epp->domain_transfer_request('example.tld', 'foobar', 1); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
if ($result) { |
31
|
|
|
|
|
|
|
print "Transfer initiated OK\n"; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
} else { |
34
|
|
|
|
|
|
|
if ($Net::EPP::Simple::Code == OBJECT_PENDING_TRANSFER) { |
35
|
|
|
|
|
|
|
print "Error: domain is already pending transfer\n"; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
} elsif ($Net::EPP::Simple::Code == INVALID_AUTH_INFO) { |
38
|
|
|
|
|
|
|
print "Error: invalid authcode provided\n"; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
} elsif ($Net::EPP::Simple::Code == OBJECT_DOES_NOT_EXIST) { |
41
|
|
|
|
|
|
|
print "Error: domain not found\n"; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
} elsif ($Net::EPP::Simple::Code == STATUS_PROHIBITS_OP) { |
44
|
|
|
|
|
|
|
print "Error: domain cannot be transferred\n"; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
} else { |
47
|
|
|
|
|
|
|
print "Error code $Net::EPP::Simple::Code\n"; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 DESCRIPTION |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
EPP is the Extensible Provisioning Protocol. EPP (defined in RFC 4930) is an |
55
|
|
|
|
|
|
|
application layer client-server protocol for the provisioning and management of |
56
|
|
|
|
|
|
|
objects stored in a shared central repository. Specified in XML, the protocol |
57
|
|
|
|
|
|
|
defines generic object management operations and an extensible framework that |
58
|
|
|
|
|
|
|
maps protocol operations to objects. As of writing, its only well-developed |
59
|
|
|
|
|
|
|
application is the provisioning of Internet domain names, hosts, and related |
60
|
|
|
|
|
|
|
contact details. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Every response sent to the client by an EPP server contains a CresultE> |
63
|
|
|
|
|
|
|
element that has a C attribute. This is a four-digit |
64
|
|
|
|
|
|
|
numeric code that describes the result of the request. This module exports |
65
|
|
|
|
|
|
|
a set of constants that provide handy mnemonics for each of the defined |
66
|
|
|
|
|
|
|
codes. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 EXPORTS |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
C exports the following constants. The number in |
71
|
|
|
|
|
|
|
brackets is the integer value associated with the constant. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 Successful command completion responses (1nnn) |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=over |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item OK (1000) |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item OK_PENDING (1001) |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item OK_NO_MESSAGES (1300) |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item OK_MESSAGES (1301) |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item OK_BYE (1500) |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=back |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head2 Command error responses (2nnn) |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head3 Protocol Syntax |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=over |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item UNKNOWN_COMMAND (2011) |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=item SYNTAX_ERROR (2011) |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item USE_ERROR (2011) |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item MISSING_PARAM (2011) |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=item PARAM_RANGE_ERROR (2011) |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=item PARAM_SYNTAX_ERROR (2011) |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=back |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head3 Implementation-specific Rules |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=over |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=item UNIMPLEMENTED_VERSION (2100) |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=item UNIMPLEMENTED_COMMAND (2101) |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=item UNIMPLEMENTED_OPTION (2102) |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=item UNIMPLEMENTED_EXTENSION (2103) |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=item BILLING_FAILURE (2104) |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=item NOT_RENEWABLE (2105) |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=item NOT_TRANSFERRABLE (2106) |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=back |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head3 Security (22nn) |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=over |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=item AUTHENTICATION_ERROR (2200) |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=item AUTHORISATION_ERROR (2201) |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=item AUTHORIZATION_ERROR (2201) |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item INVALID_AUTH_INFO (2202) |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=back |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head3 Data Management (23nn) |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=over |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=item OBJECT_PENDING_TRANSFER (2300) |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=item OBJECT_NOT_PENDING_TRANSFER (2301) |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item OBJECT_EXISTS (2302) |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=item OBJECT_DOES_NOT_EXIST (2303) |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=item STATUS_PROHIBITS_OP (2304) |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item ASSOC_PROHIBITS_OP (2305) |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=item PARAM_POLICY_ERROR (2306) |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=item UNIMPLEMENTED_OBJECT_SERVICE (2307) |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=item DATA_MGMT_POLICY_VIOLATION (2308) |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=back |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=head3 Server System (24nn) |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=over |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=item COMMAND_FAILED (2400) |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=back |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=head3 Connection Management (25nn) |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=over |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=item COMMAND_FAILED_BYE (2500) |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=item AUTH_FAILED_BYE (2501) |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=item SESSION_LIMIT_EXCEEDED_BYE (2502) |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=back |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=head1 AUTHOR |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
CentralNic Ltd (L). |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=head1 COPYRIGHT |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
This module is (c) 2016 CentralNic Ltd. This module is free software; you can |
194
|
|
|
|
|
|
|
redistribute it and/or modify it under the same terms as Perl itself. |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=head1 SEE ALSO |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=over |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=item * L |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=item * L |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=item * L |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=item * RFCs 4930 and RFC 4934, available from L. |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=item * The CentralNic EPP site at L. |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
=back |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
=cut |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
# |
215
|
|
|
|
|
|
|
# Successful command completion responses: |
216
|
|
|
|
|
|
|
# |
217
|
1
|
|
|
1
|
|
3
|
use constant OK => 1000; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
55
|
|
218
|
1
|
|
|
1
|
|
3
|
use constant OK_PENDING => 1001; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
219
|
1
|
|
|
1
|
|
3
|
use constant OK_NO_MESSAGES => 1300; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
220
|
1
|
|
|
1
|
|
2
|
use constant OK_MESSAGES => 1301; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
221
|
1
|
|
|
1
|
|
3
|
use constant OK_BYE => 1500; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
# |
224
|
|
|
|
|
|
|
# Command error responses: |
225
|
|
|
|
|
|
|
# |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
# Protocol Syntax: |
228
|
1
|
|
|
1
|
|
3
|
use constant UNKNOWN_COMMAND => 2011; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
229
|
1
|
|
|
1
|
|
4
|
use constant SYNTAX_ERROR => 2011; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
33
|
|
230
|
1
|
|
|
1
|
|
4
|
use constant USE_ERROR => 2011; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
32
|
|
231
|
1
|
|
|
1
|
|
3
|
use constant MISSING_PARAM => 2011; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
232
|
1
|
|
|
1
|
|
3
|
use constant PARAM_RANGE_ERROR => 2011; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
233
|
1
|
|
|
1
|
|
2
|
use constant PARAM_SYNTAX_ERROR => 2011; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
84
|
|
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
# Implementation-specific Rules: |
236
|
1
|
|
|
1
|
|
4
|
use constant UNIMPLEMENTED_VERSION => 2100; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
237
|
1
|
|
|
1
|
|
3
|
use constant UNIMPLEMENTED_COMMAND => 2101; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
29
|
|
238
|
1
|
|
|
1
|
|
3
|
use constant UNIMPLEMENTED_OPTION => 2102; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
239
|
1
|
|
|
1
|
|
3
|
use constant UNIMPLEMENTED_EXTENSION => 2103; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
240
|
1
|
|
|
1
|
|
3
|
use constant BILLING_FAILURE => 2104; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
241
|
1
|
|
|
1
|
|
3
|
use constant NOT_RENEWABLE => 2105; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
242
|
1
|
|
|
1
|
|
3
|
use constant NOT_TRANSFERRABLE => 2106; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
58
|
|
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
# Security: |
245
|
1
|
|
|
1
|
|
4
|
use constant AUTHENTICATION_ERROR => 2200; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
42
|
|
246
|
1
|
|
|
1
|
|
3
|
use constant AUTHORISATION_ERROR => 2201; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
247
|
1
|
|
|
1
|
|
3
|
use constant AUTHORIZATION_ERROR => 2201; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
248
|
1
|
|
|
1
|
|
3
|
use constant INVALID_AUTH_INFO => 2202; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
# Data Management: |
251
|
1
|
|
|
1
|
|
3
|
use constant OBJECT_PENDING_TRANSFER => 2300; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
252
|
1
|
|
|
1
|
|
3
|
use constant OBJECT_NOT_PENDING_TRANSFER => 2301; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
253
|
1
|
|
|
1
|
|
3
|
use constant OBJECT_EXISTS => 2302; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
254
|
1
|
|
|
1
|
|
3
|
use constant OBJECT_DOES_NOT_EXIST => 2303; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
255
|
1
|
|
|
1
|
|
3
|
use constant STATUS_PROHIBITS_OP => 2304; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
256
|
1
|
|
|
1
|
|
3
|
use constant ASSOC_PROHIBITS_OP => 2305; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
257
|
1
|
|
|
1
|
|
3
|
use constant PARAM_POLICY_ERROR => 2306; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
258
|
1
|
|
|
1
|
|
3
|
use constant UNIMPLEMENTED_OBJECT_SERVICE => 2307; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
43
|
|
259
|
1
|
|
|
1
|
|
3
|
use constant DATA_MGMT_POLICY_VIOLATION => 2308; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
40
|
|
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
# Server System: |
262
|
1
|
|
|
1
|
|
6
|
use constant COMMAND_FAILED => 2400; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
# Connection Management: |
265
|
1
|
|
|
1
|
|
3
|
use constant COMMAND_FAILED_BYE => 2500; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
266
|
1
|
|
|
1
|
|
3
|
use constant AUTH_FAILED_BYE => 2501; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
267
|
1
|
|
|
1
|
|
3
|
use constant SESSION_LIMIT_EXCEEDED_BYE => 2502; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
90
|
|
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
our @EXPORT; |
270
|
|
|
|
|
|
|
my $package = __PACKAGE__; |
271
|
|
|
|
|
|
|
foreach my $constant (keys(%constant::declared)) { |
272
|
|
|
|
|
|
|
if ($constant =~ /^$package/) { |
273
|
|
|
|
|
|
|
$constant =~ s/^$package\:\://; |
274
|
|
|
|
|
|
|
push(@EXPORT, $constant); |
275
|
|
|
|
|
|
|
} |
276
|
|
|
|
|
|
|
} |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
1; |