Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

net::epp::protocol(3pm) [debian man page]

Net::EPP::Protocol(3pm) 				User Contributed Perl Documentation				   Net::EPP::Protocol(3pm)

NAME
Net::EPP::Protocol - Low-level functions useful for both EPP clients and servers. SYNOPSIS
#!/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); DESCRIPTION
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. This module implements functions that are common to both EPP clients and servers that implement the TCP transport as defined in RFC 4934. The main consumer of this module is currently Net::EPP::Client. METHODS
my $xml = Net::EPP::Protocol->get_frame($socket); This method reads a frame from the socket and returns a scalar containing the XML. $socket must be an IO::Handle or one of its subclasses (ie "IO::Socket::*"). If the transmission fails for whatever reason, this method will "croak()", so be sure to enclose it in an "eval()". Net::EPP::Protocol->send_frame($socket, $xml); This method prepares an RFC 4934 compliant EPP frame and transmits it to the remote peer. $socket must be an IO::Handle or one of its subclasses (ie "IO::Socket::*"). If the transmission fails for whatever reason, this method will "croak()", so be sure to enclose it in an "eval()". Otherwise, it will return a true value. my $frame = Net::EPP::Protocol->prep_frame($xml); This method returns the XML frame in "wire format" 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); AUTHOR
CentralNic Ltd (<http://www.centralnic.com/>). COPYRIGHT
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. SEE ALSO
o Net::EPP::Client o RFCs 4930 and RFC 4934, available from <http://www.ietf.org/>. o The CentralNic EPP site at <http://www.centralnic.com/resellers/epp>. perl v5.14.2 2012-04-23 Net::EPP::Protocol(3pm)

Check Out this Related Man Page

Net::EPP::Client(3pm)					User Contributed Perl Documentation				     Net::EPP::Client(3pm)

NAME
Net::EPP::Client - a client library for the TCP transport for EPP, the Extensible Provisioning Protocol SYNOPSIS
#!/usr/bin/perl use Net::EPP::Client; use strict; my $epp = Net::EPP::Client->new( host => 'epp.nic.tld', port => 700, ssl => 1, frames => 1, ); my $greeting = $epp->connect; $epp->send_frame('login.xml'); my $answer = $epp->get_frame; $epp->send_frame('<epp><logout /></epp>'); my $answer = $epp->get_frame; DESCRIPTION
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. RFC 4934 defines a TCP based transport model for EPP, and this module implements a client for that model. You can establish and manage EPP connections and send and receive responses over this connection. "Net::EPP::Client" also provides some time-saving features, such as being able to provide request and response frames as "Net::EPP::Frame" objects. CONSTRUCTOR
my $epp = Net::EPP::Client->new(PARAMS); The constructor method creates a new EPP client object. It accepts a number of parameters: o host "host" specifies the computer to connect to. This may be a DNS hostname or an IP address. o port "port" specifies the TCP port to connect to. This is usually 700. o ssl If the "ssl" parameter is defined, then "IO::Socket::SSL" will be used to provide an encrypted connection. If not, then a plaintext connection will be created. o dom (deprecated) If the "dom" parameter is defined, then all response frames will be returned as "XML::LibXML::Document" objects. o frames If the "frames" parameter is defined, then all response frames will be returned as "Net::EPP::Frame" objects (actually, "XML::LibXML::Document" objects reblessed as "Net::EPP::Frame" objects). METHODS
Connecting to a server: my $greeting = $epp->connect(%PARAMS); This method establishes the TCP connection. You can use the %PARAMS hash to specify arguments that will be passed on to the constructors for "IO::Socket::INET" (such as a timeout) or "IO::Socket::SSL" (such as certificate information). See the relevant manpage for examples. This method will "croak()" if connection fails, so be sure to use "eval()" if you want to catch the error. By default, the return value for "connect()" will be the EPP <greeting> frame returned by the server. Please note that the same caveat about blocking applies to this method as to "get_frame()" (see below). If you want to get the greeting yourself, set $params{no_greeting}. Communicating with the server: my $answer = $epp->request($question); This is a simple wrapper around "get_frame()" and "send_frame()" (see below). This method accepts a "question" frame as an argument, sends it to the server, and then returns the next frame the server sends back. Getting a frame from the server: my $frame = $epp->get_frame; This method returns an EPP response frame from the server. This may either be a scalar filled with XML, an "XML::LibXML::Document" object (or an "XML::DOM::Document" object), depending on whether you defined the "dom" parameter to the constructor. Important Note: this method will block your program until it receives the full frame from the server. That could be a bad thing for your program, so you might want to consider using the "alarm()" function to apply a timeout, like so: my $timeout = 10; # ten seconds eval { local $SIG{ALRM} = sub { die "alarm " }; alarm($timeout); my $frame = $epp->get_frame; alarm(0); }; if ($@ ne '') { alarm(0); print "timed out "; } If the connection to the server closes before the response can be received, or the server returned a mal-formed frame, this method will "croak()". Sending a frame to the server: $epp->send_frame($frame, $wfcheck); This sends a request frame to the server. $frame may be one of: o a scalar containing XML o a scalar containing a filename o an "XML::LibXML::Document" object (or an instance of a subclass) o an "XML::DOM::Document" object (or an instance of a subclass) Unless $wfcheck is false, the first two of these will be checked for well-formedness. If the XML data is broken, then this method will croak. Disconnecting from the server: $epp->disconnect; This closes the connection. An EPP server should always close a connection after a <logout> frame has been received and acknowledged; this method is provided to allow you to clean up on the client side, or close the connection out of sync with the server. AUTHOR
CentralNic Ltd (<http://www.centralnic.com/>). COPYRIGHT
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. SEE ALSO
o Net::EPP::Frame o Net::EPP::Proxy o RFCs 4930 and RFC 4934, available from <http://www.ietf.org/>. o The CentralNic EPP site at <http://www.centralnic.com/resellers/epp>. perl v5.14.2 2012-04-23 Net::EPP::Client(3pm)
Man Page