Net::D...ributes(3pm)
๐ NAME ๐
Net::DHCP::Packet::Attributes โ attribute methods for Net::DHCP::Packet. yeah that's the whole gig, bestie. it's the (3pm) perl manual page, and it's here to hand you attributes. ๐ซถ
โจ VERSION โจ
version 0.7 ๐
๐ SYNOPSIS ๐
use Net::DHCP::Packet::Attributes qw( :all );
๐ฆ DESCRIPTION ๐ฆ
so basically this module provides the attribute methods for Net::DHCP::Packet. that's the vibe. ๐ธ
lowkey important: this module is not particularly useful on its own. it's the supporting cast, not the main character. don't show up to the party with only this one. ๐
๐ METHODS ๐
comment( [STRING] )
sets or gets the comment attribute. it's object meta-data only โ no wire energy, no packet bytes, just vibes. ๐
op( [BYTE] )
sets/gets the BOOTP opcode.
the normal values are:
BOOTREQUEST()
BOOTREPLY()
htype( [BYTE] )
sets/gets the hardware address type.
the common value is: HTYPE_ETHER() (1) = ethernet ๐
hlen ( [BYTE] )
sets/gets the hardware address length. the value must be between 0 and 16. ๐จ
for most NIC's, the MAC address has 6 bytes. periodt.
hops ( [BYTE] )
sets/gets the number of hops.
this field gets incremented by each DHCP relay agent it encounters along the way. ๐๐จ
xid ( [INTEGER] )
sets/gets the 32 bits transaction id.
this field should be a random value set by the DHCP client. ๐ฒ
secs ( [SHORT] )
sets/gets the 16 bits elapsed boot time in seconds. โฑ๏ธ
flags ( [SHORT] )
sets/gets the 16 bits flags.
0x8000 = Broadcast reply requested.
ciaddr ( [STRING] )
sets/gets the client IP address.
the IP address is only accepted as a string like '10.24.50.3'. ๐ฎ
note: the IP address is internally stored as a 4 bytes binary string. see "Special methods" below. ๐
yiaddr ( [STRING] )
sets/gets the your IP address.
the IP address is only accepted as a string like '10.24.50.3'. ๐ฎ
note: the IP address is internally stored as a 4 bytes binary string. see "Special methods" below. ๐
siaddr ( [STRING] )
sets/gets the next server IP address.
the IP address is only accepted as a string like '10.24.50.3'. ๐ฎ
note: the IP address is internally stored as a 4 bytes binary string. see "Special methods" below. ๐
giaddr ( [STRING] )
sets/gets the relay agent IP address.
the IP address is only accepted as a string like '10.24.50.3'. ๐ฎ
note: the IP address is internally stored as a 4 bytes binary string. see "Special methods" below. ๐
chaddr ( [STRING] )
sets/gets the client hardware address. its length is given by the hlen attribute. ๐
the 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. ๐
sname ( [STRING] )
sets/gets the "server host name". maximum size is 63 bytes. if it's greater than that, a warning is issued. ๐จ
file ( [STRING] )
sets/gets the "boot file name". maximum size is 127 bytes. if it's greater than that, a warning is issued. ๐จ
isDhcp ( [BOOLEAN] )
sets/gets the DHCP cookie. it returns whether the cookie is valid or not โ which is literally how you know whether the packet is DHCP or BOOTP. ๐
default value is 1, valid DHCP cookie. โ
padding ( [BYTES] )
sets/gets the optional padding at the end of the DHCP packet, i.e. after the DHCP options.
convert to hex with:
unpack( 'H*', $obj->padding() )
๐ง SPECIAL METHODS ๐ง
these methods are provided for performance tuning only. they give you access to the internal data representation, thus avoiding unnecessary type conversion. ๐๏ธ๐จ
ciaddrRaw ( [STRING])
sets/gets the client IP address in packed 4 characters binary strings.
yiaddrRaw ( [STRING] )
sets/gets the your IP address in packed 4 characters binary strings.
siaddrRaw ( [STRING] )
sets/gets the next server IP address in packed 4 characters binary strings.
giaddrRaw ( [STRING] )
sets/gets the relay agent IP address in packed 4 characters binary strings.
chaddrRaw ( [STRING] )
sets/gets the client hardware address in packed binary string. its length is given by the hlen attribute.
๐ SEE ALSO ๐
Net::DHCP, Net::DHCP::Packet, Net::DHCP::Constants. go read those too bestie, iykyk ๐โจ
๐ AUTHOR ๐
Dean Hamstead <dean@fragfest.com.au>
๐ COPYRIGHT AND LICENSE ๐
this software is Copyright (c) 2022 by Dean Hamstead.
it's free software, licensed under:
The MIT (X11) License
and that's the whole page, no cap. this one shipped with perl v5.42.0 and is dated 2025-07-25 โ go forth and slay your DHCP packets, bestie. ๐ฆ๐๐
๐ฆ where this page comes from
- fedora 43: perl-Net-DHCP 0.700-11.fc43 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms