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
|
|
33
|
use strict; use warnings; |
|
6
|
|
|
6
|
|
12
|
|
|
6
|
|
|
|
|
163
|
|
|
6
|
|
|
|
|
26
|
|
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
139
|
|
6
|
|
|
|
|
|
|
|
7
|
6
|
|
|
6
|
|
26
|
use Net::Frame::Layer qw(:consts :subs); |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
994
|
|
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
|
|
39
|
use Net::Frame::Layer::DNS qw(:subs); |
|
6
|
|
|
|
|
139
|
|
|
6
|
|
|
|
|
2118
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new { |
20
|
|
|
|
|
|
|
shift->SUPER::new( |
21
|
1
|
|
|
1
|
1
|
165
|
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
|
108
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
2
|
|
|
|
|
8
|
my $cpu = CORE::pack('C a*', |
36
|
|
|
|
|
|
|
length($self->cpu), $self->cpu |
37
|
|
|
|
|
|
|
); |
38
|
2
|
|
|
|
|
46
|
my $os = CORE::pack('C a*', |
39
|
|
|
|
|
|
|
length($self->os), $self->os |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
2
|
|
|
|
|
42
|
$self->raw($cpu . $os); |
43
|
|
|
|
|
|
|
|
44
|
2
|
|
|
|
|
20
|
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
|
210
|
my $self = shift; |
88
|
|
|
|
|
|
|
|
89
|
2
|
|
|
|
|
7
|
my $l = $self->layer; |
90
|
2
|
|
|
|
|
24
|
my $buf = sprintf |
91
|
|
|
|
|
|
|
"$l: cpu:%s os:%s", |
92
|
|
|
|
|
|
|
$self->cpu, $self->os; |
93
|
|
|
|
|
|
|
|
94
|
2
|
|
|
|
|
150
|
return $buf; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
1; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
__END__ |