NAME
Net::DHCPv6::Option::IAPrefix - IA Prefix option (code 26) -- prefix delegation sub-option
VERSION
version 0.003
SYNOPSIS
# Text form (auto-resolved to wire bytes)
my $iaprefix = Net::DHCPv6::Option::IAPrefix->new(
address => '2001:db8::',
preferred_lifetime => 7_200,
valid_lifetime => 86_400,
prefix_length => 64,
);
print $iaprefix->address; # '2001:db8::'
print $iaprefix->address_raw; # 16-byte wire-format bytes
# Raw bytes
use Socket qw(inet_pton AF_INET6);
my $iaprefix2 = Net::DHCPv6::Option::IAPrefix->new(
address_raw => inet_pton( AF_INET6, '2001:db8::' ),
preferred_lifetime => 7_200,
valid_lifetime => 86_400,
prefix_length => 64,
);
DESCRIPTION
Implements the IAPREFIX option (OPTION_IAPREFIX, code 26) per RFC 8415 §21.23. A sub-option of IA_PD containing an IPv6 prefix, preferred lifetime, valid lifetime, prefix length, and sub-options.
ALPHA STATUS
ALPHA SOFTWARE. This is an early release. The interface is experimental and subject to change without notice.
METHODS
- new(address => $text | address_raw => $bytes16, preferred_lifetime => $num, valid_lifetime => $num, prefix_length => $num, options => $optionlist)
-
Constructor. Requires either
address(IPv6 text) oraddress_raw(16 raw bytes).prefix_lengthis the number of significant bits in the prefix. - address
-
Returns the IPv6 prefix address as a text string.
- address_raw
-
Returns the 16-byte wire-format address.
- preferred_lifetime
-
Returns preferred lifetime in seconds.
- valid_lifetime
-
Returns valid lifetime in seconds.
- prefix_length
-
Returns the prefix length in bits.
- options
-
Returns the internal Net::DHCPv6::OptionList of sub-options.
- add_option($option)
-
Add a sub-option.
- get_option($code)
-
Retrieve the first sub-option with the given code.
SEE ALSO
Net::DHCPv6::Option, Net::DHCPv6::Option::IAPD
AUTHOR
Dean Hamstead <dean@fragfest.com.au>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2026 by Dean Hamstead.
This is free software, licensed under:
The MIT (X11) License