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