line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GeoIP2::Model::ASN; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
43
|
use strict; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
179
|
|
4
|
7
|
|
|
7
|
|
31
|
use warnings; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
251
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '2.006002'; |
7
|
|
|
|
|
|
|
|
8
|
7
|
|
|
7
|
|
33
|
use Moo; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
43
|
|
9
|
|
|
|
|
|
|
|
10
|
7
|
|
|
7
|
|
2094
|
use GeoIP2::Types qw( IPAddress NonNegativeInt Str ); |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
447
|
|
11
|
|
|
|
|
|
|
|
12
|
7
|
|
|
7
|
|
42
|
use namespace::clean -except => 'meta'; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
37
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
with 'GeoIP2::Role::Model::Flat', 'GeoIP2::Role::HasIPAddress'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has autonomous_system_number => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
isa => NonNegativeInt, |
19
|
|
|
|
|
|
|
predicate => 'has_autonomous_system_number', |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has autonomous_system_organization => ( |
23
|
|
|
|
|
|
|
is => 'ro', |
24
|
|
|
|
|
|
|
isa => Str, |
25
|
|
|
|
|
|
|
predicate => 'has_autonomous_system_organization', |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# ABSTRACT: Model class for the GeoLite2 ASN database |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=pod |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=encoding UTF-8 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 NAME |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
GeoIP2::Model::ASN - Model class for the GeoLite2 ASN database |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 VERSION |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
version 2.006002 |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 SYNOPSIS |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
use 5.008; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
use GeoIP2::Model::ASN (); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my $asn = GeoIP2::Model::ASN->new( |
53
|
|
|
|
|
|
|
raw => { |
54
|
|
|
|
|
|
|
autonomous_system_number => '217', |
55
|
|
|
|
|
|
|
autonomous_system_organization => 'University of Minnesota', |
56
|
|
|
|
|
|
|
ip_address => '128.101.101.101', |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
print $asn->autonomous_system_number(), "\n"; |
61
|
|
|
|
|
|
|
print $asn->autonomous_system_organization(), "\n"; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 DESCRIPTION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This class provides a model for the data returned by the GeoLite2 ASN database. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 METHODS |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This class provides the following methods: |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 $asn->autonomous_system_number() |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This returns the autonomous system number |
74
|
|
|
|
|
|
|
(L<http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>) associated with |
75
|
|
|
|
|
|
|
the IP address. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head2 $asn->autonomous_system_organization() |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This returns the organization associated with the registered autonomous system |
80
|
|
|
|
|
|
|
number (L<http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>) for the IP |
81
|
|
|
|
|
|
|
address. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 $asn->ip_address() |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Returns the IP address used in the lookup. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 SUPPORT |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Bugs may be submitted through L<https://github.com/maxmind/GeoIP2-perl/issues>. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 AUTHORS |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=over 4 |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item * |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Dave Rolsky <drolsky@maxmind.com> |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item * |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Greg Oschwald <goschwald@maxmind.com> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=item * |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Mark Fowler <mfowler@maxmind.com> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=item * |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Olaf Alders <oalders@maxmind.com> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=back |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This software is copyright (c) 2013 - 2019 by MaxMind, Inc. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
118
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=cut |