Net::DHCP::Packet - Object methods to create a DHCP packet.
use Net::DHCP::Packet; use strict; my $p = new Net::DHCP::Packet('Chaddr' => '0??BCDEF', 'Xid' => hex(0x9F0FD), 'Ciaddr' => '0.0.0.0', 'Siaddr' => '0.0.0.0', 'Hops' => 0);
Represents a DHCP packet as specified in RFC 1533, RFC 2132.
Sets the opcode in the BOOTP type. Without argument, returns the BOOTP type. Argument is either: Net::DHCP::Packet::BOOTREQUEST() { pack('C',0x1) } Net::DHCP::Packet::BOOTREPLY() { pack('C',0x2) }
Ex. '1' = 10mb ethernet
For most NIC's, the MAC address has 6 bytes.
This field is incremented by each encountered DHCP relay agent.
4 byte transaction id.
2 bytes for elapsed boot time.
2 bytes. 0x0000 = No broadcasts. 0x1000 = Broadcasts.
IP address is an ascci string like '10.24.50.3'.
Optional 64 bytes null terminated string with server host name.
Optional
Argument is reference to a Net::DHCP::Options object. Without argument, returns the Options object.
The hash %ARGS can contain any of these keys: Op, Htype, Hlen, Hops, Xid, Secs, Flags, Ciaddr, Yiaddr, Siaddr, Giaddr, Chaddr, Sname, File
DHCP discover packet
DHCP request packet
DHCP decline packet
DHCP release packet
DHCP inform packet
Converts a Net::DHCP::Packet to a string, ready to put on the network.
The inverse of serialize. Converts a string, presumably a received UDP packet, into a Net::DHCP::Packet.
Returns a textual representation of the packet, for debugging.
F. van Dun
I only ran some simple tests on Windows 2000 with a W2K DHCP server and a USR DHCP server. Not yet tested on Unix platform.
This is free software. It can be distributed and/or modified under the same terms as Perl itself.
perl(1), Net::DHCP::Options.
5 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head2'
=pod directives shouldn't be over one line long! Ignoring all 2 lines of content
You forgot a '=back' before '=head1'
To install Net::DHCP::Packet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::DHCP::Packet
CPAN shell
perl -MCPAN -e shell install Net::DHCP::Packet
For more information on module installation, please visit the detailed CPAN module installation guide.