line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Gnutella::Packet::Ping;
|
2
|
1
|
|
|
1
|
|
5
|
use Carp;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
55
|
|
3
|
1
|
|
|
1
|
|
4
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
4
|
use vars qw/$VERSION $AUTOLOAD/;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
278
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
$VERSION = $VERSION = "0.1";
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# Use AUTOHANDLER to supply generic attribute methods
|
9
|
|
|
|
|
|
|
#
|
10
|
|
|
|
|
|
|
sub AUTOLOAD {
|
11
|
0
|
|
|
0
|
|
|
my $self = shift;
|
12
|
0
|
|
|
|
|
|
my $attr = $AUTOLOAD;
|
13
|
0
|
|
|
|
|
|
$attr =~ s/.*:://;
|
14
|
0
|
0
|
|
|
|
|
return unless $attr =~ /[^A-Z]/; # skip DESTROY and all-cap methods
|
15
|
0
|
0
|
|
|
|
|
croak sprintf "invalid attribute method: %s->%s()", ref($self), $attr unless exists $self->{_attr}->{lc $attr};
|
16
|
0
|
0
|
|
|
|
|
$self->{_attr}->{lc $attr} = shift if @_;
|
17
|
0
|
|
|
|
|
|
return $self->{_attr}->{lc $attr};
|
18
|
|
|
|
|
|
|
}
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new {
|
21
|
0
|
|
|
0
|
0
|
|
my $proto = shift;
|
22
|
0
|
|
|
|
|
|
my %args = @_;
|
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my $self = {
|
25
|
|
|
|
|
|
|
_attr => {
|
26
|
|
|
|
|
|
|
msgid => [],
|
27
|
|
|
|
|
|
|
ttl => 7,
|
28
|
|
|
|
|
|
|
hops => 1,
|
29
|
|
|
|
|
|
|
function => 0,
|
30
|
|
|
|
|
|
|
},
|
31
|
|
|
|
|
|
|
};
|
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
bless $self, $proto;
|
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
foreach my $key (keys %args) {
|
36
|
0
|
|
|
|
|
|
my $lkey = lc $key;
|
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
$self->$lkey($args{$key});
|
39
|
|
|
|
|
|
|
}
|
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
return $self;
|
42
|
|
|
|
|
|
|
}
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub parse {
|
45
|
0
|
|
|
0
|
0
|
|
return;
|
46
|
|
|
|
|
|
|
}
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub format {
|
49
|
0
|
|
|
0
|
0
|
|
return;
|
50
|
|
|
|
|
|
|
}
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1;
|