line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: EmiteeDesc.pm,v 1.2 2007/03/15 18:23:26 gomor Exp $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::LLTD::EmiteeDesc; |
5
|
9
|
|
|
9
|
|
45
|
use strict; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
277
|
|
6
|
9
|
|
|
9
|
|
45
|
use warnings; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
240
|
|
7
|
|
|
|
|
|
|
|
8
|
9
|
|
|
9
|
|
41
|
use Net::Frame::Layer qw(:consts :subs); |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
5652
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @AS = qw( |
12
|
|
|
|
|
|
|
type |
13
|
|
|
|
|
|
|
pause |
14
|
|
|
|
|
|
|
sourceAddress |
15
|
|
|
|
|
|
|
destinationAddress |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
18
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
|
|
|
|
|
|
shift->SUPER::new( |
22
|
1
|
|
|
1
|
1
|
28
|
type => 0, |
23
|
|
|
|
|
|
|
pause => 0, |
24
|
|
|
|
|
|
|
sourceAddress => 'ff:ff:ff:ff:ff:ff', |
25
|
|
|
|
|
|
|
destinationAddress => 'ff:ff:ff:ff:ff:ff', |
26
|
|
|
|
|
|
|
@_, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
0
|
1
|
0
|
sub getLength { 14 } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub pack { |
33
|
1
|
|
|
1
|
1
|
586
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
7
|
(my $sourceAddress = $self->sourceAddress) =~ s/://g; |
36
|
1
|
|
|
|
|
41
|
(my $destinationAddress = $self->destinationAddress) =~ s/://g; |
37
|
|
|
|
|
|
|
|
38
|
1
|
50
|
|
|
|
20
|
$self->raw($self->SUPER::pack('CCH12H12', |
39
|
|
|
|
|
|
|
$self->type, $self->pause, $sourceAddress, $destinationAddress, |
40
|
|
|
|
|
|
|
)) or return undef; |
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
66
|
$self->raw; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub unpack { |
46
|
1
|
|
|
1
|
1
|
16
|
my $self = shift; |
47
|
|
|
|
|
|
|
|
48
|
1
|
50
|
|
|
|
5
|
my ($type, $pause, $src, $dst, $payload) = |
49
|
|
|
|
|
|
|
$self->SUPER::unpack('CCH12H12 a*', $self->raw) |
50
|
|
|
|
|
|
|
or return undef; |
51
|
|
|
|
|
|
|
|
52
|
1
|
|
|
|
|
41
|
$self->type($type); |
53
|
1
|
|
|
|
|
14
|
$self->pause($pause); |
54
|
1
|
|
|
|
|
14
|
$self->sourceAddress(convertMac($src)); |
55
|
1
|
|
|
|
|
30
|
$self->destinationAddress(convertMac($dst)); |
56
|
|
|
|
|
|
|
|
57
|
1
|
|
|
|
|
28
|
$self->payload($payload); |
58
|
|
|
|
|
|
|
|
59
|
1
|
|
|
|
|
12
|
$self; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub print { |
63
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
my $l = $self->layer; |
66
|
0
|
|
|
|
|
|
sprintf |
67
|
|
|
|
|
|
|
"$l: type:%02x pause:%02x\n". |
68
|
|
|
|
|
|
|
"$l: sourceAddress: %s\n". |
69
|
|
|
|
|
|
|
"$l: destinationAddress: %s", |
70
|
|
|
|
|
|
|
$self->type, |
71
|
|
|
|
|
|
|
$self->pause, |
72
|
|
|
|
|
|
|
$self->sourceAddress, |
73
|
|
|
|
|
|
|
$self->destinationAddress; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |