Low-level functions useful for both epp clients and servers.
#!/usr/bin/perl use Net::EPP::Protocol; use IO::Socket; use strict; # create a socket: my $socket = IO::Socket::INET->new( ... ); # send a frame down the socket: Net::EPP::Protocol->send_frame($socket, $xml); # get a frame from the socket: my $xml = Net::EPP::Protocol->get_frame($socket);
\s-1EPP\s0 is the Extensible Provisioning Protocol. \s-1EPP\s0 (defined in \s-1RFC\s0 4930) is an application layer client-server protocol for the provisioning and management of objects stored in a shared central repository. Specified in \s-1XML\s0, 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.
This module implements functions that are common to both \s-1EPP\s0 clients and servers that implement the \s-1TCP\s0 transport as defined in \s-1RFC\s0 4934. The main consumer of this module is currently Net::EPP::Client.
my $xml = Net::EPP::Protocol->get_frame($socket);
This method reads a frame from the socket and returns a scalar containing the \s-1XML\s0. $socket must be an IO::Handle or one of its subclasses (ie \*(C`IO::Socket::*\*(C').
If the transmission fails for whatever reason, this method will \*(C`croak()\*(C', so be sure to enclose it in an \*(C`eval()\*(C'.
Net::EPP::Protocol->send_frame($socket, $xml);
This method prepares an \s-1RFC\s0 4934 compliant \s-1EPP\s0 frame and transmits it to the remote peer. $socket must be an IO::Handle or one of its subclasses (ie \*(C`IO::Socket::*\*(C').
If the transmission fails for whatever reason, this method will \*(C`croak()\*(C', so be sure to enclose it in an \*(C`eval()\*(C'. Otherwise, it will return a true value.
my $frame = Net::EPP::Protocol->prep_frame($xml);
This method returns the \s-1XML\s0 frame in \*(L"wire format\*(R" with the protocol header prepended to it. The return value can be printed directly to an open socket, for example:
print STDOUT Net::EPP::Protocol->prep_frame($frame->toString);
CentralNic Ltd (<http://www.centralnic.com/>).
This module is (c) 2012 CentralNic Ltd. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Net::EPP::Client
RFCs 4930 and \s-1RFC\s0 4934, available from <http://www.ietf.org/>.
The CentralNic \s-1EPP\s0 site at <http://www.centralnic.com/resellers/epp>.