| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::RIR_CC::RIR; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
11
|
use Mouse; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
21
|
|
|
4
|
2
|
|
|
2
|
|
914
|
use Carp; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
825
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my $rir_data = { |
|
7
|
|
|
|
|
|
|
AFRINIC => { |
|
8
|
|
|
|
|
|
|
code => 'AF', |
|
9
|
|
|
|
|
|
|
region => 'Africa and Indian Ocean', |
|
10
|
|
|
|
|
|
|
whois_server => 'whois.afrinic.net', |
|
11
|
|
|
|
|
|
|
}, |
|
12
|
|
|
|
|
|
|
APNIC => { |
|
13
|
|
|
|
|
|
|
code => 'AP', |
|
14
|
|
|
|
|
|
|
region => 'Asia-Pacific', |
|
15
|
|
|
|
|
|
|
whois_server => 'whois.apnic.net', |
|
16
|
|
|
|
|
|
|
}, |
|
17
|
|
|
|
|
|
|
ARIN => { |
|
18
|
|
|
|
|
|
|
code => 'AR', |
|
19
|
|
|
|
|
|
|
region => 'North America', |
|
20
|
|
|
|
|
|
|
whois_server => 'whois.arin.net', |
|
21
|
|
|
|
|
|
|
}, |
|
22
|
|
|
|
|
|
|
LACNIC => { |
|
23
|
|
|
|
|
|
|
code => 'LA', |
|
24
|
|
|
|
|
|
|
region => 'Latin America', |
|
25
|
|
|
|
|
|
|
whois_server => 'whois.lacnic.net', |
|
26
|
|
|
|
|
|
|
}, |
|
27
|
|
|
|
|
|
|
RIPE => { |
|
28
|
|
|
|
|
|
|
code => 'RI', |
|
29
|
|
|
|
|
|
|
region => 'Europe', |
|
30
|
|
|
|
|
|
|
whois_server => 'whois.ripe.net', |
|
31
|
|
|
|
|
|
|
}, |
|
32
|
|
|
|
|
|
|
}; |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has 'name' => ( is => 'ro', isa => 'Str', required => 1 ); |
|
35
|
|
|
|
|
|
|
has 'code' => ( is => 'ro', isa => 'Str', required => 1 ); |
|
36
|
|
|
|
|
|
|
has 'region' => ( is => 'ro', isa => 'Str', required => 1 ); |
|
37
|
|
|
|
|
|
|
has 'whois_server' => ( is => 'ro', isa => 'Str', required => 1 ); |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
around BUILDARGS => sub { |
|
40
|
|
|
|
|
|
|
my ($orig, $class, %arg) = @_; |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $data = $rir_data->{ $arg{name} } |
|
43
|
|
|
|
|
|
|
or croak "Invalid RIR '$arg{name}'"; |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
$arg{$_} ||= $data->{$_} foreach keys %$data; |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
return $class->$orig(%arg); |
|
48
|
|
|
|
|
|
|
}; |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub dump { |
|
51
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
52
|
0
|
|
|
|
|
|
sprintf "%s\t%s\t%s", $self->name, $self->code, $self->region; |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 NAME |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Net::RIR_CC::RIR - RIR class |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
# Typically returned by a Net::RIR_CC get_rir() call |
|
62
|
|
|
|
|
|
|
$rir = $rc->get_rir('AU'); |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# Methods |
|
65
|
|
|
|
|
|
|
print $rir->name; # e.g. APNIC |
|
66
|
|
|
|
|
|
|
print $rir->code; # e.g. AP |
|
67
|
|
|
|
|
|
|
print $rir->region; # e.g. Asia-Pacific |
|
68
|
|
|
|
|
|
|
print $rir->whois_server; # e.g. whois.apnic.net |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
print $rir->dump; |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Net::RIR_CC::RR is a class modelling an RIR (Regional Internet Registry), |
|
75
|
|
|
|
|
|
|
one of: |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Name Code Region |
|
78
|
|
|
|
|
|
|
------------------------------------------- |
|
79
|
|
|
|
|
|
|
AFRINIC AF Africa and Indian Ocean |
|
80
|
|
|
|
|
|
|
APNIC AP Asia-Pacific |
|
81
|
|
|
|
|
|
|
ARIN AR North America |
|
82
|
|
|
|
|
|
|
LACNIC LA Latin America |
|
83
|
|
|
|
|
|
|
RIPE RI Europe |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
L |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 AUTHOR |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Gavin Carr, C<< >> |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Copyright 2013 Gavin Carr. |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
98
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
|
99
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=cut |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
1; |
|
106
|
|
|
|
|
|
|
|