blib/lib/Net/DHCPv6/Option/InfMaxRt.pm untested

filter: Statementstmt 0.0% 0 / 36 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 53 CC 3 SCAR 12.0
CC
3
Cov
0%
new
6.0
from_bytes_inner
6.0
value
2.0
CRAP 3.3
1 #!/bin/false
2 # ABSTRACT: INF_MAX_RT option (code 83) -- maximum Information-Request retransmission duration
3 # PODNAME: Net::DHCPv6::Option::InfMaxRt
4 use strictures 2;
5  
6 package Net::DHCPv6::Option::InfMaxRt;
7 $Net::DHCPv6::Option::InfMaxRt::VERSION = '0.002';
8 use Net::DHCPv6::OptionList;
9 use Carp qw( croak );
10 use Net::DHCPv6::Constants;
11 use Net::DHCPv6::X::BadOption;
12 use parent 'Net::DHCPv6::Option';
13 use namespace::clean;
14  
15 sub new {
16 my ( $class, %args ) = @_;
17 croak 'InfMaxRt requires value' unless defined $args{value};
18 $args{code} = $OPTION_INF_MAX_RT;
19 $args{data} = pack( 'N', $args{value} );
20 my $self = $class->SUPER::new( %args );
21 $self->{value} = $args{value};
22 return bless $self, $class;
23 }
24  
25 sub value { return shift->{value} }
26  
27 sub from_bytes_inner {
28 my ( $class, $code, $payload ) = @_;
29 Net::DHCPv6::X::BadOption->throw( message => 'InfMaxRt must be exactly 4 bytes' )
30 if CORE::length( $payload ) != 4; ## no critic (ValuesAndExpressions::ProhibitMagicNumbers)
31 my $value = unpack( 'N', $payload );
32 return $class->new( value => $value );
33 }
34  
35 $Net::DHCPv6::OptionList::OPTION_CLASS{$OPTION_INF_MAX_RT} = __PACKAGE__;
36 1;
37  
38 __END__