line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: HINFO.pm 49 2009-05-31 13:15:34Z VinsWorldcom $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::DNS::RR::HINFO; |
5
|
6
|
|
|
6
|
|
27
|
use strict; use warnings; |
|
6
|
|
|
6
|
|
12
|
|
|
6
|
|
|
|
|
163
|
|
|
6
|
|
|
|
|
28
|
|
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
145
|
|
6
|
|
|
|
|
|
|
|
7
|
6
|
|
|
6
|
|
24
|
use Net::Frame::Layer qw(:consts :subs); |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
1372
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer Exporter); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @AS = qw( |
11
|
|
|
|
|
|
|
cpu |
12
|
|
|
|
|
|
|
os |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
15
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
16
|
|
|
|
|
|
|
|
17
|
6
|
|
|
6
|
|
44
|
use Net::Frame::Layer::DNS qw(:subs); |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
3158
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new { |
20
|
|
|
|
|
|
|
shift->SUPER::new( |
21
|
1
|
|
|
1
|
1
|
163
|
cpu => 'PC', |
22
|
|
|
|
|
|
|
os => 'Windows', |
23
|
|
|
|
|
|
|
@_, |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub getLength { |
28
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
29
|
0
|
|
|
|
|
0
|
return length($self->cpu) + length($self->os) |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub pack { |
33
|
2
|
|
|
2
|
1
|
157
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
2
|
|
|
|
|
8
|
my $cpu = CORE::pack('C a*', |
36
|
|
|
|
|
|
|
length($self->cpu), $self->cpu |
37
|
|
|
|
|
|
|
); |
38
|
2
|
|
|
|
|
51
|
my $os = CORE::pack('C a*', |
39
|
|
|
|
|
|
|
length($self->os), $self->os |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
2
|
|
|
|
|
43
|
$self->raw($cpu . $os); |
43
|
|
|
|
|
|
|
|
44
|
2
|
|
|
|
|
22
|
return $self->raw; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub unpack { |
48
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
49
|
|
|
|
|
|
|
|
50
|
0
|
0
|
|
|
|
0
|
my ($cpulen) = |
51
|
|
|
|
|
|
|
$self->SUPER::unpack('C', $self->raw) |
52
|
|
|
|
|
|
|
or return; |
53
|
|
|
|
|
|
|
|
54
|
0
|
0
|
|
|
|
0
|
my ($cpudata) = |
55
|
|
|
|
|
|
|
$self->SUPER::unpack('a*', substr $self->raw, 1, $cpulen) |
56
|
|
|
|
|
|
|
or return; |
57
|
|
|
|
|
|
|
|
58
|
0
|
0
|
|
|
|
0
|
my ($oslen) = |
59
|
|
|
|
|
|
|
$self->SUPER::unpack('C', substr $self->raw, 1+$cpulen) |
60
|
|
|
|
|
|
|
or return; |
61
|
|
|
|
|
|
|
|
62
|
0
|
0
|
|
|
|
0
|
my ($osdata) = |
63
|
|
|
|
|
|
|
$self->SUPER::unpack('a*', substr $self->raw, 2+$cpulen, $oslen) |
64
|
|
|
|
|
|
|
or return; |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
0
|
$self->cpu($cpudata); |
67
|
0
|
|
|
|
|
0
|
$self->os($osdata); |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
0
|
$self->payload(substr $self->raw, 2+$cpulen+$oslen); |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
0
|
return $self; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub encapsulate { |
75
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
76
|
|
|
|
|
|
|
|
77
|
0
|
0
|
|
|
|
0
|
return $self->nextLayer if $self->nextLayer; |
78
|
|
|
|
|
|
|
|
79
|
0
|
0
|
|
|
|
0
|
if ($self->payload) { |
80
|
0
|
|
|
|
|
0
|
return 'DNS::RR'; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
0
|
|
|
|
|
0
|
NF_LAYER_NONE; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub print { |
87
|
2
|
|
|
2
|
1
|
188
|
my $self = shift; |
88
|
|
|
|
|
|
|
|
89
|
2
|
|
|
|
|
11
|
my $l = $self->layer; |
90
|
2
|
|
|
|
|
23
|
my $buf = sprintf |
91
|
|
|
|
|
|
|
"$l: cpu:%s os:%s", |
92
|
|
|
|
|
|
|
$self->cpu, $self->os; |
93
|
|
|
|
|
|
|
|
94
|
2
|
|
|
|
|
183
|
return $buf; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
1; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
__END__ |