line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: QueryResp.pm,v 1.2 2007/03/15 18:23:52 gomor Exp $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::LLTD::QueryResp; |
5
|
9
|
|
|
9
|
|
45
|
use strict; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
384
|
|
6
|
9
|
|
|
9
|
|
44
|
use warnings; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
269
|
|
7
|
|
|
|
|
|
|
|
8
|
9
|
|
|
9
|
|
42
|
use Net::Frame::Layer qw(:consts :subs); |
|
9
|
|
|
|
|
13
|
|
|
9
|
|
|
|
|
3680
|
|
9
|
|
|
|
|
|
|
require Exporter; |
10
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer Exporter); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @AS = qw( |
13
|
|
|
|
|
|
|
flags |
14
|
|
|
|
|
|
|
numDescs |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
our @AA = qw( |
17
|
|
|
|
|
|
|
recveeDescList |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
20
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
21
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsArray (\@AA); |
22
|
|
|
|
|
|
|
|
23
|
9
|
|
|
9
|
|
7414
|
use Net::Frame::Layer::LLTD::RecveeDesc; |
|
9
|
|
|
|
|
26
|
|
|
9
|
|
|
|
|
5705
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub new { |
26
|
|
|
|
|
|
|
shift->SUPER::new( |
27
|
1
|
|
|
1
|
1
|
28
|
flags => 0, |
28
|
|
|
|
|
|
|
numDescs => 0, |
29
|
|
|
|
|
|
|
recveeDescList => [], |
30
|
|
|
|
|
|
|
@_, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub getRecveeDescListLength { |
35
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
36
|
0
|
|
|
|
|
0
|
my $len = 0; |
37
|
0
|
|
|
|
|
0
|
for ($self->recveeDescList) { |
38
|
0
|
|
|
|
|
0
|
$len += $_->getLength; |
39
|
|
|
|
|
|
|
} |
40
|
0
|
|
|
|
|
0
|
$len; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub getLength { |
44
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
45
|
0
|
|
|
|
|
0
|
my $len = 2; |
46
|
0
|
0
|
|
|
|
0
|
$len += $self->getRecveeDescListLength if $self->recveeDescList; |
47
|
0
|
|
|
|
|
0
|
$len; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub pack { |
51
|
1
|
|
|
1
|
1
|
222
|
my $self = shift; |
52
|
|
|
|
|
|
|
|
53
|
1
|
50
|
|
|
|
4
|
my $raw = $self->SUPER::pack('CC', $self->flags, $self->numDescs) |
54
|
|
|
|
|
|
|
or return undef; |
55
|
|
|
|
|
|
|
|
56
|
1
|
|
|
|
|
72
|
for ($self->recveeDescList) { |
57
|
0
|
|
|
|
|
0
|
$raw .= $_->pack; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
1
|
|
|
|
|
26
|
$self->raw($raw); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub unpack { |
64
|
1
|
|
|
1
|
1
|
15
|
my $self = shift; |
65
|
|
|
|
|
|
|
|
66
|
1
|
50
|
|
|
|
4
|
my ($flags, $numDescs, $payload) = |
67
|
|
|
|
|
|
|
$self->SUPER::unpack('CC a*', $self->raw) |
68
|
|
|
|
|
|
|
or return undef; |
69
|
|
|
|
|
|
|
|
70
|
1
|
|
|
|
|
32
|
$self->flags($flags); |
71
|
1
|
|
|
|
|
15
|
$self->numDescs($numDescs); |
72
|
|
|
|
|
|
|
|
73
|
1
|
|
|
|
|
11
|
my @recveeDescList = (); |
74
|
1
|
50
|
33
|
|
|
4
|
if ($self->numDescs && $self->numDescs > 0) { |
75
|
0
|
|
|
|
|
0
|
for (1..$self->numDescs) { |
76
|
0
|
|
|
|
|
0
|
my $recvee = Net::Frame::Layer::LLTD::RecveeDesc->new(raw => $payload); |
77
|
0
|
|
|
|
|
0
|
$recvee->unpack; |
78
|
0
|
|
|
|
|
0
|
push @recveeDescList, $recvee; |
79
|
0
|
|
|
|
|
0
|
$payload = $recvee->payload; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
1
|
|
|
|
|
26
|
$self->recveeDescList(\@recveeDescList); |
84
|
1
|
|
|
|
|
21
|
$self->payload($payload); |
85
|
|
|
|
|
|
|
|
86
|
1
|
|
|
|
|
14
|
$self; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
0
|
1
|
|
sub encapsulate { shift->nextLayer } |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub print { |
92
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
93
|
|
|
|
|
|
|
|
94
|
0
|
|
|
|
|
|
my $l = $self->layer; |
95
|
0
|
|
|
|
|
|
my $buf = sprintf |
96
|
|
|
|
|
|
|
"$l: flags:0x%02x numDescs:%d", |
97
|
|
|
|
|
|
|
$self->flags, $self->numDescs; |
98
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
for ($self->recveeDescList) { |
100
|
0
|
|
|
|
|
|
$buf .= "\n".$_->print; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
0
|
|
|
|
|
|
$buf; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
1; |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
__END__ |