Net::EPP::ResponseCodes - a module to export some constants that


Net-EPP documentation Contained in the Net-EPP distribution.

Index


Code Index:

NAME

Top

Net::EPP::ResponseCodes - a module to export some constants that correspond to EPP response codes

SYNOPSIS

Top

	use Net::EPP::ResponseCodes;
	use Net::EPP::Simple;
	use strict;

	my $epp = Net::EPP::Simple->new(
		host	=> 'epp.nic.tld',
		user	=> 'my-id',
		pass	=> 'my-password',
	);

	my $result = $epp->domain_transfer_request('example.tld', 'foobar', 1);

	if ($result) {
		print "Transfer initiated OK\n";

	} else {
		if ($Net::EPP::Simple::Code == OBJECT_PENDING_TRANSFER) {
			print "Error: domain is already pending transfer\n";

		} elsif ($Net::EPP::Simple::Code == INVALID_AUTH_INFO) {
			print "Error: invalid authcode provided\n";

		} elsif ($Net::EPP::Simple::Code == OBJECT_DOES_NOT_EXIST) {
			print "Error: domain not found\n";

		} elsif ($Net::EPP::Simple::Code == STATUS_PROHIBITS_OP) {
			print "Error: domain cannot be transferred\n";

		} else {
			print "Error code $Net::EPP::Simple::Code\n";

		}
	}

DESCRIPTION

Top

EPP is the Extensible Provisioning Protocol. EPP (defined in RFC 4930) is an application layer client-server protocol for the provisioning and management of objects stored in a shared central repository. Specified in XML, the protocol defines generic object management operations and an extensible framework that maps protocol operations to objects. As of writing, its only well-developed application is the provisioning of Internet domain names, hosts, and related contact details.

Every response sent to the client by an EPP server contains a <result> element that has a code attribute. This is a four-digit numeric code that describes the result of the request. This module exports a set of constants that provide handy mnemonics for each of the defined codes.

EXPORTS

Top

Net::EPP::ResponseCodes exports the following constants. The number in brackets is the integer value associated with the constant.

Successful command completion responses (1nnn)

OK (1000)
OK_PENDING (1001)
OK_NO_MESSAGES (1300)
OK_MESSAGES (1301)
OK_BYE (1500)

Command error responses (2nnn)

Protocol Syntax

UNKNOWN_COMMAND (2011)
SYNTAX_ERROR (2011)
USE_ERROR (2011)
MISSING_PARAM (2011)
PARAM_RANGE_ERROR (2011)
PARAM_SYNTAX_ERROR (2011)

Implementation-specific Rules

UNIMPLEMENTED_VERSION (2100)
UNIMPLEMENTED_COMMAND (2101)
UNIMPLEMENTED_OPTION (2102)
UNIMPLEMENTED_EXTENSION (2103)
BILLING_FAILURE (2104)
NOT_RENEWABLE (2105)
NOT_TRANSFERRABLE (2106)

Security (22nn)

AUTHENTICATION_ERROR (2200)
AUTHORISATION_ERROR (2201)
AUTHORIZATION_ERROR (2201)
INVALID_AUTH_INFO (2202)

Data Management (23nn)

OBJECT_PENDING_TRANSFER (2300)
OBJECT_NOT_PENDING_TRANSFER (2301)
OBJECT_EXISTS (2302)
OBJECT_DOES_NOT_EXIST (2303)
STATUS_PROHIBITS_OP (2304)
ASSOC_PROHIBITS_OP (2305)
PARAM_POLICY_ERROR (2306)
UNIMPLEMENTED_OBJECT_SERVICE (2307)
DATA_MGMT_POLICY_VIOLATION (2308)

Server System (24nn)

COMMAND_FAILED (2400)

Connection Management (25nn)

COMMAND_FAILED_BYE (2500)
AUTH_FAILED_BYE (2501)
SESSION_LIMIT_EXCEEDED_BYE (2502)

AUTHOR

Top

CentralNic Ltd (http://www.centralnic.com/).

COPYRIGHT

Top

SEE ALSO

Top

* Net::EPP::Client
* Net::EPP::Frame
* Net::EPP::Proxy
* RFCs 4930 and RFC 4934, available from http://www.ietf.org/.
* The CentralNic EPP site at http://www.centralnic.com/resellers/epp.

Net-EPP documentation Contained in the Net-EPP distribution.

# Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
# free software; you can redistribute it and/or modify it under the same
# terms as Perl itself.
# 
# $Id: ResponseCodes.pm,v 1.2 2011/01/04 10:37:33 gavin Exp $
package Net::EPP::ResponseCodes;
use base qw(Exporter);
use vars qw(@EXPORT);
use strict;

#
# Successful command completion responses:
#
use constant OK					=> 1000;
use constant OK_PENDING				=> 1001;
use constant OK_NO_MESSAGES			=> 1300;
use constant OK_MESSAGES			=> 1301;
use constant OK_BYE				=> 1500;

#
# Command error responses:
#

# Protocol Syntax:
use constant UNKNOWN_COMMAND			=> 2011;
use constant SYNTAX_ERROR			=> 2011;
use constant USE_ERROR				=> 2011;
use constant MISSING_PARAM			=> 2011;
use constant PARAM_RANGE_ERROR			=> 2011;
use constant PARAM_SYNTAX_ERROR			=> 2011;

# Implementation-specific Rules:
use constant UNIMPLEMENTED_VERSION		=> 2100;
use constant UNIMPLEMENTED_COMMAND		=> 2101;
use constant UNIMPLEMENTED_OPTION		=> 2102;
use constant UNIMPLEMENTED_EXTENSION		=> 2103;
use constant BILLING_FAILURE			=> 2104;
use constant NOT_RENEWABLE			=> 2105;
use constant NOT_TRANSFERRABLE			=> 2106;

# Security:
use constant AUTHENTICATION_ERROR		=> 2200;
use constant AUTHORISATION_ERROR		=> 2201;
use constant AUTHORIZATION_ERROR		=> 2201;
use constant INVALID_AUTH_INFO			=> 2202;

# Data Management:
use constant OBJECT_PENDING_TRANSFER		=> 2300;
use constant OBJECT_NOT_PENDING_TRANSFER	=> 2301;
use constant OBJECT_EXISTS			=> 2302;
use constant OBJECT_DOES_NOT_EXIST		=> 2303;
use constant STATUS_PROHIBITS_OP		=> 2304;
use constant ASSOC_PROHIBITS_OP			=> 2305;
use constant PARAM_POLICY_ERROR			=> 2306;
use constant UNIMPLEMENTED_OBJECT_SERVICE	=> 2307;
use constant DATA_MGMT_POLICY_VIOLATION		=> 2308;

# Server System:
use constant COMMAND_FAILED			=> 2400;

# Connection Management:
use constant COMMAND_FAILED_BYE			=> 2500;
use constant AUTH_FAILED_BYE			=> 2501;
use constant SESSION_LIMIT_EXCEEDED_BYE		=> 2502;

our @EXPORT;
my $package = __PACKAGE__;
foreach my $constant (keys(%constant::declared)) {
	if ($constant =~ /^$package/) {
		$constant =~ s/^$package\:\://;
		push(@EXPORT, $constant);
	}
}

1;