line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: Unknown.pm 1640 2013-03-28 17:58:27Z VinsWorldcom $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::CDP::Unknown; |
5
|
19
|
|
|
19
|
|
107
|
use strict; use warnings; |
|
19
|
|
|
19
|
|
39
|
|
|
19
|
|
|
|
|
583
|
|
|
19
|
|
|
|
|
96
|
|
|
19
|
|
|
|
|
36
|
|
|
19
|
|
|
|
|
656
|
|
6
|
|
|
|
|
|
|
|
7
|
19
|
|
|
19
|
|
98
|
use Net::Frame::Layer qw(:consts :subs); |
|
19
|
|
|
|
|
31
|
|
|
19
|
|
|
|
|
13055
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @AS = qw( |
11
|
|
|
|
|
|
|
type |
12
|
|
|
|
|
|
|
length |
13
|
|
|
|
|
|
|
value |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
16
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
#no strict 'vars'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
|
|
|
|
|
|
shift->SUPER::new( |
22
|
0
|
|
|
0
|
1
|
|
type => 0, |
23
|
|
|
|
|
|
|
length => 0, |
24
|
|
|
|
|
|
|
value => '', |
25
|
|
|
|
|
|
|
@_, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub getLength { |
30
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my $length = 4 + length($self->value); |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return $length |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub pack { |
38
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
0
|
0
|
|
|
|
|
my $raw = $self->SUPER::pack('nna*', |
41
|
|
|
|
|
|
|
$self->type, |
42
|
|
|
|
|
|
|
$self->length, |
43
|
|
|
|
|
|
|
$self->value, |
44
|
|
|
|
|
|
|
) or return; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
return $self->raw($raw); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub unpack { |
50
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
51
|
|
|
|
|
|
|
|
52
|
0
|
0
|
|
|
|
|
my ($type, $length, $tail) = |
53
|
|
|
|
|
|
|
$self->SUPER::unpack('nna*', $self->raw) |
54
|
|
|
|
|
|
|
or return; |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
$self->type($type); |
57
|
0
|
|
|
|
|
|
$self->length($length); |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
my $valLen = $length - 4; |
60
|
0
|
0
|
|
|
|
|
my ($value, $payload) = |
61
|
|
|
|
|
|
|
$self->SUPER::unpack("a$valLen a*", $tail) |
62
|
|
|
|
|
|
|
or return; |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
$self->value($value); |
65
|
0
|
|
|
|
|
|
$self->payload($payload); |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
return $self; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub computeLengths { |
71
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
|
$self->length(4 + length($self->value)); |
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
return 1; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub print { |
79
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
80
|
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
my $l = $self->layer; |
82
|
0
|
0
|
|
|
|
|
my $buf = sprintf |
83
|
|
|
|
|
|
|
"$l: type:0x%04x length:%d value:%s", |
84
|
|
|
|
|
|
|
$self->type, $self->length, |
85
|
|
|
|
|
|
|
($self->value =~ /[\x00-\x1f\x7f-\xff]/s) ? (CORE::unpack 'H*', $self->value) : $self->value; |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
|
return $buf; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
__END__ |