line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::MobileAttribute::Plugin::CIDR; |
2
|
3
|
|
|
3
|
|
1981
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
92
|
|
3
|
3
|
|
|
3
|
|
20
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
85
|
|
4
|
3
|
|
|
3
|
|
16
|
use base qw/HTTP::MobileAttribute::Plugin/; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
18
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
16
|
use Net::CIDR::MobileJP; |
|
3
|
|
|
|
|
22
|
|
|
3
|
|
|
|
|
32
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
__PACKAGE__->depends([qw/CarrierLetter/]); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub init { |
11
|
15
|
|
|
15
|
1
|
714
|
my($self, $c) = @_; |
12
|
15
|
|
|
|
|
48
|
$self->{cidr} = Net::CIDR::MobileJP->new($self->config->{cidr}); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub reload_cidr :Method { |
16
|
2
|
|
|
2
|
0
|
26
|
my($self, $c, $cidr) = @_; |
17
|
2
|
|
|
|
|
20
|
$self->{cidr} = Net::CIDR::MobileJP->new($cidr); |
18
|
2
|
|
|
|
|
648
|
return; |
19
|
3
|
|
|
3
|
|
3021
|
} |
|
3
|
|
|
|
|
4120
|
|
|
3
|
|
|
|
|
19
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub isa_cidr :Method { |
22
|
28
|
|
|
28
|
0
|
319
|
my($self, $c, $ip) = @_; |
23
|
28
|
|
|
|
|
106
|
($c->carrier eq $self->{cidr}->get_carrier($ip)); |
24
|
3
|
|
|
3
|
|
1000
|
} |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
15
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
__END__ |