line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: LOOP.pm 4 2015-01-14 06:34:44Z gomor $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::LOOP; |
5
|
2
|
|
|
2
|
|
13868
|
use strict; use warnings; |
|
2
|
|
|
2
|
|
5
|
|
|
2
|
|
|
|
|
95
|
|
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
114
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.01'; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
1467
|
use Net::Frame::Layer qw(:consts); |
|
2
|
|
|
|
|
160379
|
|
|
2
|
|
|
|
|
480
|
|
10
|
2
|
|
|
2
|
|
22
|
use Exporter; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
225
|
|
11
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer Exporter); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
14
|
|
|
|
|
|
|
consts => [qw( |
15
|
|
|
|
|
|
|
NF_LOOP_HDR_LEN |
16
|
|
|
|
|
|
|
NF_LOOP_FUNCTION_REPLY |
17
|
|
|
|
|
|
|
)], |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
our @EXPORT_OK = ( |
20
|
|
|
|
|
|
|
@{$EXPORT_TAGS{consts}}, |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
2
|
|
12
|
use constant NF_LOOP_HDR_LEN => 6; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
151
|
|
24
|
2
|
|
|
2
|
|
12
|
use constant NF_LOOP_FUNCTION_REPLY => 0x0100; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
858
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
our @AS = qw( |
27
|
|
|
|
|
|
|
skipCount |
28
|
|
|
|
|
|
|
function |
29
|
|
|
|
|
|
|
receiptNumber |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
32
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub new { |
35
|
|
|
|
|
|
|
shift->SUPER::new( |
36
|
1
|
|
|
1
|
1
|
19
|
skipCount => 0, |
37
|
|
|
|
|
|
|
function => NF_LOOP_FUNCTION_REPLY, |
38
|
|
|
|
|
|
|
receiptNumber => 0, |
39
|
|
|
|
|
|
|
@_, |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
0
|
1
|
0
|
sub getLength { NF_LOOP_HDR_LEN } |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub pack { |
46
|
1
|
|
|
1
|
1
|
193
|
my $self = shift; |
47
|
|
|
|
|
|
|
|
48
|
1
|
50
|
|
|
|
4
|
$self->raw($self->SUPER::pack('nnn', |
49
|
|
|
|
|
|
|
$self->skipCount, |
50
|
|
|
|
|
|
|
$self->function, |
51
|
|
|
|
|
|
|
$self->receiptNumber, |
52
|
|
|
|
|
|
|
)) or return undef; |
53
|
|
|
|
|
|
|
|
54
|
1
|
|
|
|
|
65
|
$self->raw; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub unpack { |
58
|
1
|
|
|
1
|
1
|
14
|
my $self = shift; |
59
|
|
|
|
|
|
|
|
60
|
1
|
50
|
|
|
|
4
|
my ($skipCount, $function, $receiptNumber, $payload) = |
61
|
|
|
|
|
|
|
$self->SUPER::unpack('nnn a*', $self->raw) |
62
|
|
|
|
|
|
|
or return undef; |
63
|
|
|
|
|
|
|
|
64
|
1
|
|
|
|
|
40
|
$self->skipCount($skipCount); |
65
|
1
|
|
|
|
|
13
|
$self->function($function); |
66
|
1
|
|
|
|
|
10
|
$self->receiptNumber($receiptNumber); |
67
|
|
|
|
|
|
|
|
68
|
1
|
|
|
|
|
16
|
$self->payload($payload); |
69
|
|
|
|
|
|
|
|
70
|
1
|
|
|
|
|
11
|
$self; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
0
|
1
|
|
sub encapsulate { shift->nextLayer } |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub print { |
76
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
my $l = $self->layer; |
79
|
0
|
|
|
|
|
|
sprintf "$l: skipCount:%d function:0x%04x receiptNumber:%d", |
80
|
|
|
|
|
|
|
$self->skipCount, |
81
|
|
|
|
|
|
|
$self->function, |
82
|
|
|
|
|
|
|
$self->receiptNumber, |
83
|
|
|
|
|
|
|
; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
1; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
__END__ |