| 1 | #!/bin/false | ||||||||||
| 2 | # ABSTRACT: Reconfigure Message option (code 19) -- 1-byte msg-type | ||||||||||
| 3 | # PODNAME: Net::DHCPv6::Option::ReconfMsg | ||||||||||
| 4 | 15 | ▶ | use strictures 2; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | package Net::DHCPv6::Option::ReconfMsg; | ||||||||||
| 7 | 15 | $Net::DHCPv6::Option::ReconfMsg::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_RECONF_MSG | ||||||||||
| 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 | 3 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 18 | 3 | my ( $class, %args ) = @_; | |||||||||
| 19 | 3 | ▶ | croak 'ReconfMsg requires msg_type' unless defined $args{msg_type}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 2 | $args{code} = $OPTION_RECONF_MSG; | |||||||||
| 21 | 2 | $args{data} = pack( 'C', $args{msg_type} ); | |||||||||
| 22 | 2 | my $self = $class->SUPER::new( %args ); | |||||||||
| 23 | 2 | $self->{msg_type} = $args{msg_type}; | |||||||||
| 24 | 2 | return bless $self, $class; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 2 | ▶ | sub msg_type { return shift->{msg_type} } | ||||||||
|
Subroutine
msg_type: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 28 | |||||||||||
| 29 | 2 | ▶ | sub from_bytes_inner { | ||||||||
|
Subroutine
from_bytes_inner: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 30 | 2 | my ( $class, $code, $payload ) = @_; | |||||||||
| 31 | 2 | ▶ | Net::DHCPv6::X::Truncated->throw( message => 'Truncated ReconfMsg option' ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | if CORE::length( $payload ) < 1; | ||||||||||
| 33 | 1 | my $type = unpack( 'C', $payload ); | |||||||||
| 34 | 1 | return $class->new( msg_type => $type ); | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 15 | $Net::DHCPv6::OptionList::OPTION_CLASS{$OPTION_RECONF_MSG} = __PACKAGE__; | |||||||||
| 38 | 15 | 1; | |||||||||
| 39 | |||||||||||
| 40 | __END__ | ||||||||||