| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# |
|
2
|
|
|
|
|
|
|
# $Id: Query.pm 49 2009-05-31 13:15:34Z VinsWorldcom $ |
|
3
|
|
|
|
|
|
|
# |
|
4
|
|
|
|
|
|
|
package Net::Frame::Layer::ICMPv6::MLD::Query; |
|
5
|
4
|
|
|
4
|
|
7700
|
use strict; use warnings; |
|
|
4
|
|
|
4
|
|
21
|
|
|
|
4
|
|
|
|
|
171
|
|
|
|
4
|
|
|
|
|
36
|
|
|
|
4
|
|
|
|
|
10
|
|
|
|
4
|
|
|
|
|
194
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
389
|
use Net::Frame::Layer qw(:consts :subs); |
|
|
4
|
|
|
|
|
81120
|
|
|
|
4
|
|
|
|
|
1249
|
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @AS = qw( |
|
11
|
|
|
|
|
|
|
resv |
|
12
|
|
|
|
|
|
|
sFlag |
|
13
|
|
|
|
|
|
|
qrv |
|
14
|
|
|
|
|
|
|
qqic |
|
15
|
|
|
|
|
|
|
numSources |
|
16
|
|
|
|
|
|
|
); |
|
17
|
|
|
|
|
|
|
our @AA = qw( |
|
18
|
|
|
|
|
|
|
sourceAddress |
|
19
|
|
|
|
|
|
|
); |
|
20
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
|
21
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
|
22
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsArray(\@AA); |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#no strict 'vars'; |
|
25
|
|
|
|
|
|
|
|
|
26
|
4
|
|
|
4
|
|
1340
|
use Bit::Vector; |
|
|
4
|
|
|
|
|
3827
|
|
|
|
4
|
|
|
|
|
3133
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub new { |
|
29
|
|
|
|
|
|
|
shift->SUPER::new( |
|
30
|
2
|
|
|
2
|
1
|
417
|
resv => 0, |
|
31
|
|
|
|
|
|
|
sFlag => 0, |
|
32
|
|
|
|
|
|
|
qrv => 2, |
|
33
|
|
|
|
|
|
|
qqic => 125, |
|
34
|
|
|
|
|
|
|
numSources => 0, |
|
35
|
|
|
|
|
|
|
sourceAddress => [], |
|
36
|
|
|
|
|
|
|
@_, |
|
37
|
|
|
|
|
|
|
); |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub getLength { |
|
41
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
42
|
0
|
|
|
|
|
0
|
my $len = 4; |
|
43
|
0
|
|
|
|
|
0
|
$len += 16 for $self->sourceAddress; |
|
44
|
0
|
|
|
|
|
0
|
return $len; |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub pack { |
|
48
|
1
|
|
|
1
|
1
|
345
|
my $self = shift; |
|
49
|
|
|
|
|
|
|
|
|
50
|
1
|
|
|
|
|
7
|
my $resv = Bit::Vector->new_Dec(4, $self->resv); |
|
51
|
1
|
|
|
|
|
54
|
my $sFlag = Bit::Vector->new_Dec(1, $self->sFlag); |
|
52
|
1
|
|
|
|
|
62
|
my $qrv = Bit::Vector->new_Dec(3, $self->qrv); |
|
53
|
1
|
|
|
|
|
34
|
my $bvlist = $resv->Concat_List($sFlag, $qrv); |
|
54
|
|
|
|
|
|
|
|
|
55
|
1
|
50
|
|
|
|
16
|
my $raw = $self->SUPER::pack('CCn', |
|
56
|
|
|
|
|
|
|
$bvlist->to_Dec, |
|
57
|
|
|
|
|
|
|
$self->qqic, |
|
58
|
|
|
|
|
|
|
$self->numSources |
|
59
|
|
|
|
|
|
|
) or return; |
|
60
|
|
|
|
|
|
|
|
|
61
|
1
|
|
|
|
|
75
|
for ($self->sourceAddress) { |
|
62
|
0
|
|
|
|
|
0
|
$raw .= inet6Aton($_); |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
1
|
|
|
|
|
42
|
return $self->raw($raw); |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub unpack { |
|
69
|
1
|
|
|
1
|
1
|
39
|
my $self = shift; |
|
70
|
|
|
|
|
|
|
|
|
71
|
1
|
50
|
|
|
|
7
|
my ($bv, $qqic, $numSources, $payload) = |
|
72
|
|
|
|
|
|
|
$self->SUPER::unpack('CCn a*', $self->raw) |
|
73
|
|
|
|
|
|
|
or return; |
|
74
|
|
|
|
|
|
|
|
|
75
|
1
|
|
|
|
|
65
|
my $bvlist = Bit::Vector->new_Dec(8, $bv); |
|
76
|
1
|
|
|
|
|
15
|
$self->resv ($bvlist->Chunk_Read(4, 4)); |
|
77
|
1
|
|
|
|
|
40
|
$self->sFlag ($bvlist->Chunk_Read(1, 3)); |
|
78
|
1
|
|
|
|
|
23
|
$self->qrv ($bvlist->Chunk_Read(3, 0)); |
|
79
|
|
|
|
|
|
|
|
|
80
|
1
|
|
|
|
|
19
|
$self->qqic($qqic); |
|
81
|
1
|
|
|
|
|
18
|
$self->numSources($numSources); |
|
82
|
|
|
|
|
|
|
|
|
83
|
1
|
|
|
|
|
15
|
my @sourceAddress = (); |
|
84
|
1
|
|
|
|
|
17
|
for my $num (0..$numSources-1) { |
|
85
|
0
|
0
|
0
|
|
|
0
|
if (defined($payload) && (length($payload) >= 16)) { |
|
86
|
0
|
|
|
|
|
0
|
my $addr = unpack 'a16', $payload; |
|
87
|
0
|
|
|
|
|
0
|
push @sourceAddress, inet6Ntoa($addr); |
|
88
|
0
|
|
|
|
|
0
|
$payload = substr $payload, 16; |
|
89
|
|
|
|
|
|
|
} |
|
90
|
|
|
|
|
|
|
} |
|
91
|
1
|
|
|
|
|
8
|
$self->sourceAddress(\@sourceAddress); |
|
92
|
|
|
|
|
|
|
|
|
93
|
1
|
|
|
|
|
23
|
$self->payload($payload); |
|
94
|
|
|
|
|
|
|
|
|
95
|
1
|
|
|
|
|
21
|
return $self; |
|
96
|
|
|
|
|
|
|
} |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub encapsulate { |
|
99
|
1
|
|
|
1
|
1
|
7
|
my $self = shift; |
|
100
|
|
|
|
|
|
|
|
|
101
|
1
|
50
|
|
|
|
6
|
return $self->nextLayer if $self->nextLayer; |
|
102
|
|
|
|
|
|
|
|
|
103
|
1
|
50
|
|
|
|
14
|
if ($self->payload) { |
|
104
|
0
|
|
|
|
|
0
|
return 'ICMPv6::MLD::Query'; |
|
105
|
|
|
|
|
|
|
} |
|
106
|
|
|
|
|
|
|
|
|
107
|
1
|
|
|
|
|
12
|
NF_LAYER_NONE; |
|
108
|
|
|
|
|
|
|
} |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub computeLengths { |
|
111
|
1
|
|
|
1
|
1
|
378
|
my $self = shift; |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
# Calculate numSources from sourceAddress array items |
|
114
|
1
|
50
|
33
|
|
|
7
|
if (scalar($self->sourceAddress) && ($self->numSources == 0)) { |
|
115
|
1
|
|
|
|
|
66
|
$self->numSources(scalar($self->sourceAddress)) |
|
116
|
|
|
|
|
|
|
} |
|
117
|
|
|
|
|
|
|
|
|
118
|
1
|
|
|
|
|
33
|
return 1; |
|
119
|
|
|
|
|
|
|
} |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub print { |
|
122
|
3
|
|
|
3
|
1
|
19
|
my $self = shift; |
|
123
|
|
|
|
|
|
|
|
|
124
|
3
|
|
|
|
|
16
|
my $l = $self->layer; |
|
125
|
3
|
|
|
|
|
51
|
my $buf = sprintf |
|
126
|
|
|
|
|
|
|
"$l: resv:%d sFlag:%d qrv:%d qqic:%d numSources:%d", |
|
127
|
|
|
|
|
|
|
$self->resv, $self->sFlag, $self->qrv, $self->qqic, $self->numSources; |
|
128
|
|
|
|
|
|
|
|
|
129
|
3
|
|
|
|
|
180
|
for ($self->sourceAddress) { |
|
130
|
2
|
|
|
|
|
43
|
$buf .= sprintf |
|
131
|
|
|
|
|
|
|
"\n$l: sourceAddress:%s", |
|
132
|
|
|
|
|
|
|
$_ |
|
133
|
|
|
|
|
|
|
} |
|
134
|
|
|
|
|
|
|
|
|
135
|
3
|
|
|
|
|
58
|
return $buf; |
|
136
|
|
|
|
|
|
|
} |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
1; |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
__END__ |