Net::DHCP::Packet::Attributes - Attribute methods for Net::DHCP::Packet
version 0.7
use Net::DHCP::Packet::Attributes qw( :all );
Provides attribute methods for Net::DHCP::Packet.
This module is not particularly useful on its own.
Sets or gets the comment attribute (object meta-data only)
Sets/gets the BOOTP opcode.
Normal values are:
BOOTREQUEST() BOOTREPLY()
Sets/gets the hardware address type.
Common value is: HTYPE_ETHER() (1) = ethernet
HTYPE_ETHER()
Sets/gets the hardware address length. Value must be between 0 and 16.
0
16
For most NIC's, the MAC address has 6 bytes.
Sets/gets the number of hops.
This field is incremented by each encountered DHCP relay agent.
Sets/gets the 32 bits transaction id.
This field should be a random value set by the DHCP client.
Sets/gets the 16 bits elapsed boot time in seconds.
Sets/gets the 16 bits flags.
0x8000 = Broadcast reply requested.
Sets/gets the client IP address.
IP address is only accepted as a string like '10.24.50.3'.
Note: IP address is internally stored as a 4 bytes binary string. See "Special methods" below.
Sets/gets the your IP address.
Sets/gets the next server IP address.
Sets/gets the relay agent IP address.
Sets/gets the client hardware address. Its length is given by the hlen attribute.
hlen
Value is formatted as an Hexadecimal string representation.
Example: "0010A706DFFF" for 6 bytes mac address.
Note : internal format is packed bytes string. See "Special methods" below.
Sets/gets the "server host name". Maximum size is 63 bytes. If greater a warning is issued.
Sets/gets the "boot file name". Maximum size is 127 bytes. If greater a warning is issued.
Sets/gets the DHCP cookie. Returns whether the cookie is valid or not, hence whether the packet is DHCP or BOOTP.
Default value is 1, valid DHCP cookie.
1
Sets/gets the optional padding at the end of the DHCP packet, i.e. after DHCP options.
Convert to hex with: unpack( 'H*', $obj->padding() )
These methods are provided for performance tuning only. They give access to internal data representation , thus avoiding unnecessary type conversion.
Sets/gets the client IP address in packed 4 characters binary strings.
Sets/gets the your IP address in packed 4 characters binary strings.
Sets/gets the next server IP address in packed 4 characters binary strings.
Sets/gets the relay agent IP address in packed 4 characters binary strings.
Sets/gets the client hardware address in packed binary string. Its length is given by the hlen attribute.
Net::DHCP, Net::DHCP::Packet, Net::DHCP::Constants.
Dean Hamstead <dean@fragfest.com.au>
This software is Copyright (c) 2022 by Dean Hamstead.
This is free software, licensed under:
The MIT (X11) License
To install Net::DHCP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::DHCP
CPAN shell
perl -MCPAN -e shell install Net::DHCP
For more information on module installation, please visit the detailed CPAN module installation guide.