line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::MinFraud::Data::Rx::Type::IPAddress; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
38
|
use 5.010; |
|
2
|
|
|
|
|
8
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
39
|
|
6
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
49
|
|
7
|
2
|
|
|
2
|
|
9
|
use namespace::autoclean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
12
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.009001'; |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
594
|
use Data::Validate::IP; |
|
2
|
|
|
|
|
29835
|
|
|
2
|
|
|
|
|
369
|
|
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
18
|
use parent 'Data::Rx::CommonType::EasyNew'; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
15
|
|
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
2
|
|
1009
|
use Role::Tiny::With; |
|
2
|
|
|
|
|
4732
|
|
|
2
|
|
|
|
|
304
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
with 'WebService::MinFraud::Role::Data::Rx::Type'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub assert_valid { |
20
|
107
|
|
|
107
|
0
|
48438
|
my ( $self, $value ) = @_; |
21
|
|
|
|
|
|
|
|
22
|
107
|
50
|
33
|
|
|
651
|
return 1 |
|
|
|
33
|
|
|
|
|
23
|
|
|
|
|
|
|
if $value |
24
|
|
|
|
|
|
|
&& ( Data::Validate::IP::is_ipv4($value) |
25
|
|
|
|
|
|
|
|| Data::Validate::IP::is_ipv6($value) ); |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
0
|
$self->fail( |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
error => [qw(type)], |
30
|
|
|
|
|
|
|
message => |
31
|
|
|
|
|
|
|
'Found value is not an IP address, neither version 4 nor 6.', |
32
|
|
|
|
|
|
|
value => $value, |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub type_uri { |
38
|
|
|
|
|
|
|
## no critic(ValuesAndExpressions::ProhibitCommaSeparatedStatements) |
39
|
55
|
|
|
55
|
0
|
983
|
'tag:maxmind.com,MAXMIND:rx/ip'; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# ABSTRACT: A type to check for a valid IP address, version 4 or 6 |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=pod |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=encoding UTF-8 |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 NAME |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
WebService::MinFraud::Data::Rx::Type::IPAddress - A type to check for a valid IP address, version 4 or 6 |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 VERSION |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
version 1.009001 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 SUPPORT |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Bugs may be submitted through L<https://github.com/maxmind/minfraud-api-perl/issues>. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AUTHOR |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Mateu Hunter <mhunter@maxmind.com> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This software is copyright (c) 2015 - 2019 by MaxMind, Inc. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
73
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |