line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: NativeVlan.pm 1640 2013-03-28 17:58:27Z VinsWorldcom $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::CDP::NativeVlan; |
5
|
19
|
|
|
19
|
|
6875
|
use strict; use warnings; |
|
19
|
|
|
19
|
|
36
|
|
|
19
|
|
|
|
|
575
|
|
|
19
|
|
|
|
|
108
|
|
|
19
|
|
|
|
|
40
|
|
|
19
|
|
|
|
|
559
|
|
6
|
|
|
|
|
|
|
|
7
|
19
|
|
|
19
|
|
1054
|
use Net::Frame::Layer qw(:consts :subs); |
|
19
|
|
|
|
|
86685
|
|
|
19
|
|
|
|
|
5168
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @AS = qw( |
11
|
|
|
|
|
|
|
type |
12
|
|
|
|
|
|
|
length |
13
|
|
|
|
|
|
|
nativeVlan |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
16
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
#no strict 'vars'; |
19
|
|
|
|
|
|
|
|
20
|
19
|
|
|
19
|
|
829
|
use Net::Frame::Layer::CDP::Constants qw(:consts); |
|
19
|
|
|
|
|
38
|
|
|
19
|
|
|
|
|
9930
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
|
|
|
|
|
|
shift->SUPER::new( |
24
|
2
|
|
|
2
|
1
|
272
|
type => NF_CDP_TYPE_NATIVE_VLAN, |
25
|
|
|
|
|
|
|
length => 6, |
26
|
|
|
|
|
|
|
nativeVlan => 1, |
27
|
|
|
|
|
|
|
@_, |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
1
|
0
|
sub getLength { 6 } |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub pack { |
34
|
1
|
|
|
1
|
1
|
272
|
my $self = shift; |
35
|
|
|
|
|
|
|
|
36
|
1
|
50
|
|
|
|
6
|
my $raw = $self->SUPER::pack('nnn', |
37
|
|
|
|
|
|
|
$self->type, |
38
|
|
|
|
|
|
|
$self->length, |
39
|
|
|
|
|
|
|
$self->nativeVlan, |
40
|
|
|
|
|
|
|
) or return; |
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
78
|
return $self->raw($raw); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub unpack { |
46
|
1
|
|
|
1
|
1
|
16
|
my $self = shift; |
47
|
|
|
|
|
|
|
|
48
|
1
|
50
|
|
|
|
4
|
my ($type, $length, $nativeVlan, $payload) = |
49
|
|
|
|
|
|
|
$self->SUPER::unpack('nnn a*', $self->raw) |
50
|
|
|
|
|
|
|
or return; |
51
|
|
|
|
|
|
|
|
52
|
1
|
|
|
|
|
35
|
$self->type($type); |
53
|
1
|
|
|
|
|
74
|
$self->length($length); |
54
|
1
|
|
|
|
|
14
|
$self->nativeVlan($nativeVlan); |
55
|
|
|
|
|
|
|
|
56
|
1
|
|
|
|
|
15
|
$self->payload($payload); |
57
|
|
|
|
|
|
|
|
58
|
1
|
|
|
|
|
12
|
return $self; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub computeLengths { |
62
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
0
|
$self->length(6); |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
0
|
return 1; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub print { |
70
|
3
|
|
|
3
|
1
|
12
|
my $self = shift; |
71
|
|
|
|
|
|
|
|
72
|
3
|
|
|
|
|
15
|
my $l = $self->layer; |
73
|
3
|
|
|
|
|
42
|
my $buf = sprintf |
74
|
|
|
|
|
|
|
"$l: type:0x%04x length:%d nativeVlan:%d", |
75
|
|
|
|
|
|
|
$self->type, $self->length, $self->nativeVlan; |
76
|
|
|
|
|
|
|
|
77
|
3
|
|
|
|
|
546
|
return $buf; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |