Net::E...otocol(3pm)

πŸ“¦
version 0.28 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– Net::EPP::Protocol(3pm) β€” the NAME section, bestie πŸ’–

okay so welcome to Net::EPP::Protocol, which is a Perl module (yes it lives in the User Contributed Perl Documentation, and yes the header up top calls it Net::E...otocol(3pm) because apparently even manpage headers get truncated for the aesthetic πŸ™ˆ). It's low-level functions useful for both EPP clients and servers. That's it. That's the whole vibe. ✨


🌸 SYNOPSIS 🌸

here's the whole thing in action, no notes:

#!/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);

literally that's it. slay. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so 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) <https://www.rfc-editor.org/info/std69>, as defined in RFC 5734 <https://www.rfc-editor.org/rfc/rfc5734.html>.

the only user of this module is Net::EPP::Client β€” not me being shady, that's just canon 🫢 β€” but it may be useful if you want to write an EPP server. main character energy for a helper module, honestly. πŸ‘‘


πŸŽ€ VARIABLES πŸŽ€

$Net::EPP::Protocol::THRESHOLD

okay so story time: at least one EPP server implementation sends an unframed plain text error message when a client connects from an unauthorised address. and because of that, when the first four bytes of the message get unpacked, the client tries to read and allocate a very large amount of memory πŸ˜­πŸ’€

so here's the safety rail: if the apparent frame length received from a server exceeds the value of $Net::EPP::Protocol::THRESHOLD, the get_frame() method will croak.

the default value is 1GB. one. whole. gigabyte. periodt.


✨ 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(). no cap, wrap it up or get wrecked. πŸ™ˆ

Net::EPP::Protocol->send_frame($socket, $xml);

this method prepares an RFC 5734 compliant EPP frame and transmits it to the remote peer. $socket must be an IO::Handle or one of its subclasses (ie "IO::Socket::*").

⚠️ same deal bestie β€” 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);

iconic. no further questions. πŸ”₯


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.


and that's the whole page, bestie!! 🌈 written for perl v5.40.1, dated 2025-04-19, and the footer says Net::E...otocol(3pm) because we're keeping it cute and truncated to the very end πŸ’– mwah, go write an EPP server or something 🧚⭐

πŸ“¦ where this page comes from