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