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