Net::D...ributes(3pm)

๐Ÿ“ฆ
version 0.700 ยท 2 versions
, in fedora 43

๐Ÿ’– 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>

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