lib/Net/DHCPv6/Option/CaptivePortal.pm

filter: Statementstmt 100% 35 / 35 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 100% 3 / 3 totaltotal 100% 52 / 52 CC 3 SCAR 2.9
CC
3
Cov
100%
new
2.0
from_bytes_inner
2.0
BEGIN
1.0
CRAP 1.3
« lib/Net/DHCPv6/Option/BootfileUrl.pm ↑ Summary lib/Net/DHCPv6/Option/ClientArchType.pm »
1 #!/bin/false
2 # ABSTRACT: DHCP Captive-Portal option (code 103) -- captive portal API URI
3 # PODNAME: Net::DHCPv6::Option::CaptivePortal
4 15 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 package Net::DHCPv6::Option::CaptivePortal;
7 15 $Net::DHCPv6::Option::CaptivePortal::VERSION = '0.002';
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;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 15 ▶use Net::DHCPv6::X::Truncated;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 15 ▶use parent 'Net::DHCPv6::Option';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 15 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 sub new {
16 3 ▶ my ( $class, %args ) = @_;
Subroutine new: called CC=2 SCAR=6.9
Pod documented
17 3 ▶ croak 'CaptivePortal requires uri' unless defined $args{uri};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $args{"uri"} 1 2 3
18 2 $args{code} = $OPTION_CAPTIVE_PORTAL;
19 2 $args{data} = $args{uri};
20 2 my $self = $class->SUPER::new( %args );
21 2 $self->{uri} = $args{uri};
22 2 return bless $self, $class;
23 }
24  
25 2 ▶sub uri { return shift->{uri} }
Subroutine uri: called CC=1 SCAR=0.0
Pod documented
26  
27 sub from_bytes_inner {
28 2 ▶ my ( $class, $code, $payload ) = @_;
Subroutine from_bytes_inner: called CC=2 SCAR=6.9
Pod documented
29 2 ▶ Net::DHCPv6::X::Truncated->throw( message => 'Truncated CaptivePortal option' )
Branch: 1 branch
BranchTrueFalseTotal
if length $payload == 0 1 1 2
30 if CORE::length( $payload ) == 0;
31 1 return $class->new( uri => $payload );
32 }
33  
34 15 $Net::DHCPv6::OptionList::OPTION_CLASS{$OPTION_CAPTIVE_PORTAL} = __PACKAGE__;
35 15 1;
36  
37 __END__
« lib/Net/DHCPv6/Option/BootfileUrl.pm ↑ Summary lib/Net/DHCPv6/Option/ClientArchType.pm »