line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: TXT.pm 49 2009-05-31 13:15:34Z VinsWorldcom $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Net::Frame::Layer::DNS::RR::TXT; |
5
|
6
|
|
|
6
|
|
37
|
use strict; use warnings; |
|
6
|
|
|
6
|
|
14
|
|
|
6
|
|
|
|
|
152
|
|
|
6
|
|
|
|
|
28
|
|
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
150
|
|
6
|
|
|
|
|
|
|
|
7
|
6
|
|
|
6
|
|
32
|
use Net::Frame::Layer qw(:consts :subs); |
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
1097
|
|
8
|
|
|
|
|
|
|
our @ISA = qw(Net::Frame::Layer Exporter); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @AS = qw( |
11
|
|
|
|
|
|
|
txtdata |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
__PACKAGE__->cgBuildIndices; |
14
|
|
|
|
|
|
|
__PACKAGE__->cgBuildAccessorsScalar(\@AS); |
15
|
|
|
|
|
|
|
|
16
|
6
|
|
|
6
|
|
42
|
use Net::Frame::Layer::DNS qw(:subs); |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
1824
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
|
|
|
|
|
|
shift->SUPER::new( |
20
|
1
|
|
|
1
|
1
|
171
|
txtdata => 'textdata', |
21
|
|
|
|
|
|
|
@_, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub getLength { |
26
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
27
|
0
|
|
|
|
|
0
|
return length($self->txtdata) |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub pack { |
31
|
2
|
|
|
2
|
1
|
141
|
my $self = shift; |
32
|
|
|
|
|
|
|
|
33
|
2
|
50
|
|
|
|
7
|
$self->raw($self->SUPER::pack('C a*', |
34
|
|
|
|
|
|
|
length($self->txtdata), $self->txtdata |
35
|
|
|
|
|
|
|
)) or return; |
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
104
|
return $self->raw; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub unpack { |
41
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
42
|
|
|
|
|
|
|
|
43
|
0
|
0
|
|
|
|
0
|
my ($txtlen, $txtdata) = |
44
|
|
|
|
|
|
|
$self->SUPER::unpack('C a*', $self->raw) |
45
|
|
|
|
|
|
|
or return; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
0
|
$self->txtdata($txtdata); |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
0
|
$self->payload(substr $self->raw, $txtlen+1); |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
0
|
return $self; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub encapsulate { |
55
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
0
|
0
|
|
|
|
0
|
return $self->nextLayer if $self->nextLayer; |
58
|
|
|
|
|
|
|
|
59
|
0
|
0
|
|
|
|
0
|
if ($self->payload) { |
60
|
0
|
|
|
|
|
0
|
return 'DNS::RR'; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
0
|
NF_LAYER_NONE; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub print { |
67
|
2
|
|
|
2
|
1
|
187
|
my $self = shift; |
68
|
|
|
|
|
|
|
|
69
|
2
|
|
|
|
|
8
|
my $l = $self->layer; |
70
|
2
|
|
|
|
|
23
|
my $buf = sprintf |
71
|
|
|
|
|
|
|
"$l: txtdata:%s", |
72
|
|
|
|
|
|
|
$self->txtdata; |
73
|
|
|
|
|
|
|
|
74
|
2
|
|
|
|
|
132
|
return $buf; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
__END__ |