line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GeoIP2::Model::AnonymousIP; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
44
|
use strict; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
193
|
|
4
|
7
|
|
|
7
|
|
38
|
use warnings; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
241
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '2.006002'; |
7
|
|
|
|
|
|
|
|
8
|
7
|
|
|
7
|
|
31
|
use Moo; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
34
|
|
9
|
|
|
|
|
|
|
|
10
|
7
|
|
|
7
|
|
1931
|
use GeoIP2::Types qw( Bool ); |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
356
|
|
11
|
|
|
|
|
|
|
|
12
|
7
|
|
|
7
|
|
39
|
use namespace::clean -except => 'meta'; |
|
7
|
|
|
|
|
21
|
|
|
7
|
|
|
|
|
47
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
with 'GeoIP2::Role::Model::Flat', 'GeoIP2::Role::HasIPAddress'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has [ |
17
|
|
|
|
|
|
|
'is_anonymous', |
18
|
|
|
|
|
|
|
'is_anonymous_vpn', |
19
|
|
|
|
|
|
|
'is_hosting_provider', |
20
|
|
|
|
|
|
|
'is_public_proxy', |
21
|
|
|
|
|
|
|
'is_tor_exit_node' |
22
|
|
|
|
|
|
|
] => ( |
23
|
|
|
|
|
|
|
is => 'ro', |
24
|
|
|
|
|
|
|
isa => Bool, |
25
|
|
|
|
|
|
|
default => 0, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# ABSTRACT: Model class for the GeoIP2 Anonymous IP database |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=pod |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=encoding UTF-8 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 NAME |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
GeoIP2::Model::AnonymousIP - Model class for the GeoIP2 Anonymous IP database |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 VERSION |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
version 2.006002 |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 SYNOPSIS |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
use 5.008; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
use GeoIP2::Model::AnonymousIP; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my $anon = GeoIP2::Model::AnonymousIP->new( |
53
|
|
|
|
|
|
|
raw => { |
54
|
|
|
|
|
|
|
is_anonymous => 1, |
55
|
|
|
|
|
|
|
is_hosting_provider => 1, |
56
|
|
|
|
|
|
|
ip_address => '24.24.24.24' |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
print $anon->is_anonymous(), "\n"; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 DESCRIPTION |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This class provides a model for the data returned by the GeoIP2 Anonymous IP |
65
|
|
|
|
|
|
|
database. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 METHODS |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This class provides the following methods: |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 $anon->is_anonymous() |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Returns true if the IP address belongs to any sort of anonymous network. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 $anon->is_anonymous_vpn() |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Returns true if the IP address is registered to an anonymous VPN provider. |
78
|
|
|
|
|
|
|
If a VPN provider does not register subnets under names associated with them, |
79
|
|
|
|
|
|
|
we will likely only flag their IP ranges using the C<is_hosting_provider> |
80
|
|
|
|
|
|
|
attribute. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 $anon->is_hosting_provider() |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Returns true if the IP address belongs to a hosting or VPN provider |
85
|
|
|
|
|
|
|
(see description of C<is_anonymous_vpn> attribute). |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head2 $anon->is_public_proxy() |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Returns true if the IP address belongs to a public proxy. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head2 $anon->is_tor_exit_node() |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Returns true if the IP address is a Tor exit node. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head2 $anon->ip_address() |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Returns the IP address used in the lookup. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 SUPPORT |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Bugs may be submitted through L<https://github.com/maxmind/GeoIP2-perl/issues>. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 AUTHORS |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=over 4 |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=item * |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Dave Rolsky <drolsky@maxmind.com> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=item * |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Greg Oschwald <goschwald@maxmind.com> |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=item * |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Mark Fowler <mfowler@maxmind.com> |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=item * |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Olaf Alders <oalders@maxmind.com> |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=back |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
This software is copyright (c) 2013 - 2019 by MaxMind, Inc. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
130
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=cut |