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