| 1 | #!/bin/false | ||||||||||
| 2 | # ABSTRACT: Boot File URL option (code 59) -- URL for network boot | ||||||||||
| 3 | # PODNAME: Net::DHCPv6::Option::BootfileUrl | ||||||||||
| 4 | 15 | ▶ | use strictures 2; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | package Net::DHCPv6::Option::BootfileUrl; | ||||||||||
| 7 | 15 | $Net::DHCPv6::Option::BootfileUrl::VERSION = '0.002'; | |||||||||
| 8 | 15 | ▶ | use Net::DHCPv6::OptionList; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 15 | ▶ | use Carp qw( croak ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 15 | ▶ | use Net::DHCPv6::Constants; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 15 | ▶ | use Net::DHCPv6::X::Truncated; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 15 | ▶ | use parent 'Net::DHCPv6::Option'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 15 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | sub new { | ||||||||||
| 16 | 7 | ▶ | my ( $class, %args ) = @_; | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 17 | 7 | ▶ | croak 'BootfileUrl requires url' unless defined $args{url}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 6 | $args{code} = $OPTION_BOOTFILE_URL; | |||||||||
| 19 | 6 | $args{data} = $args{url}; | |||||||||
| 20 | 6 | my $self = $class->SUPER::new( %args ); | |||||||||
| 21 | 6 | $self->{url} = $args{url}; | |||||||||
| 22 | 6 | return bless $self, $class; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 2 | ▶ | sub url { return shift->{url} } | ||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 26 | |||||||||||
| 27 | sub from_bytes_inner { | ||||||||||
| 28 | 6 | ▶ | my ( $class, $code, $payload ) = @_; | ||||||||
|
Subroutine
from_bytes_inner: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 29 | 6 | ▶ | Net::DHCPv6::X::Truncated->throw( message => 'Truncated BootfileUrl option' ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | if CORE::length( $payload ) == 0; | ||||||||||
| 31 | 5 | return $class->new( url => $payload ); | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 15 | $Net::DHCPv6::OptionList::OPTION_CLASS{$OPTION_BOOTFILE_URL} = __PACKAGE__; | |||||||||
| 35 | 15 | 1; | |||||||||
| 36 | |||||||||||
| 37 | __END__ | ||||||||||