.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::EPP::Protocol 3pm" .TH Net::EPP::Protocol 3pm 2024-04-27 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Net::EPP::Protocol \- Low\-level functions useful for both EPP clients and servers. .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 3 \& #!/usr/bin/perl \& use Net::EPP::Protocol; \& use strict; \& \& # send a frame down a socket: \& \& Net::EPP::Protocol\->send_frame($socket, $xml); \& \& # get a frame from a socket: \& \& my $xml = Net::EPP::Protocol\->get_frame($socket); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module implements functions that are common to both EPP clients and servers that implement the TCP/TLS transport of the Extensible Provisioning Protocol (EPP) as defined in RFC 5734 . The only user of this module is Net::EPP::Client, but it may be useful if you want to write an EPP server. .SH VARIABLES .IX Header "VARIABLES" .ie n .SS $Net::EPP::Protocol::THRESHOLD .el .SS \f(CW$Net::EPP::Protocol::THRESHOLD\fP .IX Subsection "$Net::EPP::Protocol::THRESHOLD" At least one EPP server implementation sends an unframed plain text error message when a client connects from an unauthorised address. As a result, when the first four bytes of the message are unpacked, the client tries to read and allocate a very large amount of memory. .PP If the apparent frame length received from a server exceeds the value of \&\f(CW$Net::EPP::Protocol::THRESHOLD\fR, the \f(CWget_frame()\fR method will croak. .PP The default value is 1GB. .SH METHODS .IX Header "METHODS" .Vb 1 \& my $xml = Net::EPP::Protocol\->get_frame($socket); .Ve .PP This method reads a frame from the socket and returns a scalar containing the XML. \f(CW$socket\fR must be an IO::Handle or one of its subclasses (ie \&\f(CW\*(C`IO::Socket::*\*(C'\fR). .PP If the transmission fails for whatever reason, this method will \f(CWcroak()\fR, so be sure to enclose it in an \f(CWeval()\fR. .PP .Vb 1 \& Net::EPP::Protocol\->send_frame($socket, $xml); .Ve .PP This method prepares an RFC 5734 compliant EPP frame and transmits it to the remote peer. \f(CW$socket\fR must be an IO::Handle or one of its subclasses (ie \f(CW\*(C`IO::Socket::*\*(C'\fR). .PP If the transmission fails for whatever reason, this method will \f(CWcroak()\fR, so be sure to enclose it in an \f(CWeval()\fR. Otherwise, it will return a true value. .PP .Vb 1 \& my $frame = Net::EPP::Protocol\->prep_frame($xml); .Ve .PP 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: .PP .Vb 1 \& print STDOUT Net::EPP::Protocol\->prep_frame($frame\->toString); .Ve .SH COPYRIGHT .IX Header "COPYRIGHT" This module is (c) 2008 \- 2023 CentralNic Ltd and 2024 Gavin Brown. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.