lib/Net/DHCPv6/Option/CaptivePortal.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 3 / 3 totaltotal 100% 48 / 48 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/BootfileUrl.pm ↑ Summary lib/Net/DHCPv6/Option/MudUrl.pm »
1 #!/usr/bin/false
2 # ABSTRACT: DHCP Captive-Portal option (code 103) — captive portal API URI
3 # PODNAME: Net::DHCPv6::Option::CaptivePortal
4 package Net::DHCPv6::Option::CaptivePortal;
5 15 $Net::DHCPv6::Option::CaptivePortal::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 'CaptivePortal requires uri' unless defined $args{uri};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $args{"uri"} 1 2 3
16 2 $args{code} = $OPTION_CAPTIVE_PORTAL;
17 2 $args{data} = $args{uri};
18 2 my $self = $class->SUPER::new( %args );
19 2 $self->{uri} = $args{uri};
20 2 bless $self, $class;
21 }
22  
23 2 ▶sub uri { shift->{uri} }
Subroutine uri: 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 CaptivePortal option' )
Branch: 1 branch
BranchTrueFalseTotal
if length $data == 0 1 1 2
28 if CORE::length( $data ) == 0;
29 1 return $class->new( uri => $data );
30 }
31  
32 15 $Net::DHCPv6::OptionList::OPTION_CLASS{$OPTION_CAPTIVE_PORTAL} = __PACKAGE__;
33 15 1;
34  
35 __END__
« lib/Net/DHCPv6/Option/BootfileUrl.pm ↑ Summary lib/Net/DHCPv6/Option/MudUrl.pm »