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