lib/Net/DHCPv6/Option/ReconfMsg.pm

filter: Statementstmt 100% 33 / 33 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 3 / 3 totaltotal 100% 49 / 49 CC 3 SCAR 3.1
CC
3
Cov
100%
new
2.0
from_bytes_inner
2.0
BEGIN
1.0
CRAP 1.4
« lib/Net/DHCPv6/Option/MudUrl.pm ↑ Summary lib/Net/DHCPv6/Option/InfMaxRt.pm »
1 #!/usr/bin/false
2 # ABSTRACT: Reconfigure Message option (code 19) — 1-byte msg-type
3 # PODNAME: Net::DHCPv6::Option::ReconfMsg
4 package Net::DHCPv6::Option::ReconfMsg;
5 15 $Net::DHCPv6::Option::ReconfMsg::VERSION = '0.001';
6 15 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 15 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 15 ▶use Net::DHCPv6::Constants;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 15 ▶use Net::DHCPv6::X::Truncated;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 15 ▶use parent 'Net::DHCPv6::Option';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 15 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub new {
14 3 ▶ my ( $class, %args ) = @_;
Subroutine new: called CC=2 SCAR=6.9
Pod documented
15 3 ▶ croak 'ReconfMsg requires msg_type' unless defined $args{msg_type};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $args{"msg_type"} 1 2 3
16 2 $args{code} = $OPTION_RECONF_MSG;
17 2 $args{data} = pack( 'C', $args{msg_type} );
18 2 my $self = $class->SUPER::new( %args );
19 2 $self->{msg_type} = $args{msg_type};
20 2 bless $self, $class;
21 }
22  
23 2 ▶sub msg_type { shift->{msg_type} }
Subroutine msg_type: called CC=1 SCAR=0.0
Pod documented
24  
25 sub from_bytes_inner {
26 2 ▶ my ( $class, $code, $data ) = @_;
Subroutine from_bytes_inner: called CC=2 SCAR=6.9
Pod documented
27 2 ▶ Net::DHCPv6::X::Truncated->throw( message => 'Truncated ReconfMsg option' )
Branch: 1 branch
BranchTrueFalseTotal
if length $data < 1 1 1 2
28 if CORE::length( $data ) < 1;
29 1 my $type = unpack( 'C', $data );
30 1 return $class->new( msg_type => $type );
31 }
32  
33 15 $Net::DHCPv6::OptionList::OPTION_CLASS{$OPTION_RECONF_MSG} = __PACKAGE__;
34 15 1;
35  
36 __END__
« lib/Net/DHCPv6/Option/MudUrl.pm ↑ Summary lib/Net/DHCPv6/Option/InfMaxRt.pm »