line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1616
|
use 5.008; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
45
|
|
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Data::Semantic::Net::IPAddress::IPv6; |
6
|
|
|
|
|
|
|
BEGIN { |
7
|
1
|
|
|
1
|
|
19
|
$Data::Semantic::Net::IPAddress::IPv6::VERSION = '1.101760'; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
# ABSTRACT: Semantic data class for IPv6 addresses |
10
|
1
|
|
|
1
|
|
8
|
use Net::IP qw/ip_is_ipv6 ip_iptype/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
70
|
|
11
|
1
|
|
|
1
|
|
4
|
use parent qw(Data::Semantic::Net::IPAddress); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub is_valid_normalized_value { |
14
|
86
|
|
|
86
|
1
|
9598
|
my ($self, $value) = @_; |
15
|
86
|
100
|
|
|
|
532
|
$self->SUPER::is_valid_normalized_value($value) && ip_is_ipv6($value); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub is_internal { |
19
|
43
|
|
|
43
|
1
|
528
|
my ($self, $value) = @_; |
20
|
43
|
50
|
|
|
|
140
|
return unless defined $value; |
21
|
43
|
|
|
|
|
175
|
my $ip = Net::IP->new($value); |
22
|
43
|
50
|
|
|
|
391143
|
return unless $ip; |
23
|
43
|
|
|
|
|
433
|
$ip->iptype ne 'GLOBAL-UNICAST'; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub normalize { |
27
|
127
|
|
|
127
|
1
|
101371
|
my ($self, $value) = @_; |
28
|
127
|
|
|
|
|
544
|
my $ip = Net::IP->new($value); |
29
|
127
|
100
|
|
|
|
1152209
|
return undef unless $ip; |
30
|
116
|
|
|
|
|
1066
|
$ip->short; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |