line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package UltraDNS::Type; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
UltraDNS::Type - Classes for argument and result value data types |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 DESCRIPTION |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
This is an internal module. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=cut |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
3916
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
40
|
|
14
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
476
|
use RPC::XML; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my %udns_types = ( |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# type list for arguments, generated by mk_methods.pl and manually copied here |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# XXX we're happy to subclass int to unsigned, for example, |
24
|
|
|
|
|
|
|
# because we know that RPC::XML::int doesn't do any range validation. |
25
|
|
|
|
|
|
|
float => { |
26
|
|
|
|
|
|
|
base => 'RPC::XML::double', |
27
|
|
|
|
|
|
|
}, |
28
|
|
|
|
|
|
|
hexint => { |
29
|
|
|
|
|
|
|
base => 'RPC::XML::string', |
30
|
|
|
|
|
|
|
}, |
31
|
|
|
|
|
|
|
hostname => { |
32
|
|
|
|
|
|
|
base => 'RPC::XML::string', |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
id => { |
35
|
|
|
|
|
|
|
base => 'RPC::XML::string', |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
integer => { |
38
|
|
|
|
|
|
|
base => 'RPC::XML::int', |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
ip_address => { |
41
|
|
|
|
|
|
|
base => 'RPC::XML::string', |
42
|
|
|
|
|
|
|
}, |
43
|
|
|
|
|
|
|
ipv6_address => { |
44
|
|
|
|
|
|
|
base => 'RPC::XML::string', |
45
|
|
|
|
|
|
|
}, |
46
|
|
|
|
|
|
|
unsigned => { |
47
|
|
|
|
|
|
|
base => 'RPC::XML::int', |
48
|
|
|
|
|
|
|
}, |
49
|
|
|
|
|
|
|
unsigned_short => { |
50
|
|
|
|
|
|
|
base => 'RPC::XML::int', |
51
|
|
|
|
|
|
|
}, |
52
|
|
|
|
|
|
|
zonename => { |
53
|
|
|
|
|
|
|
base => 'RPC::XML::string', |
54
|
|
|
|
|
|
|
}, |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# type list for result types not listed above |
57
|
|
|
|
|
|
|
soa_record => { |
58
|
|
|
|
|
|
|
base => 'RPC::XML::struct', |
59
|
|
|
|
|
|
|
}, |
60
|
|
|
|
|
|
|
ns_record => { |
61
|
|
|
|
|
|
|
base => 'RPC::XML::struct', |
62
|
|
|
|
|
|
|
}, |
63
|
|
|
|
|
|
|
a_record => { |
64
|
|
|
|
|
|
|
base => 'RPC::XML::struct', |
65
|
|
|
|
|
|
|
}, |
66
|
|
|
|
|
|
|
aaaa_record => { |
67
|
|
|
|
|
|
|
base => 'RPC::XML::struct', |
68
|
|
|
|
|
|
|
}, |
69
|
|
|
|
|
|
|
ptr_record => { |
70
|
|
|
|
|
|
|
base => 'RPC::XML::struct', |
71
|
|
|
|
|
|
|
}, |
72
|
|
|
|
|
|
|
cname_record => { |
73
|
|
|
|
|
|
|
base => 'RPC::XML::struct', |
74
|
|
|
|
|
|
|
}, |
75
|
|
|
|
|
|
|
mx_record => { |
76
|
|
|
|
|
|
|
base => 'RPC::XML::struct', |
77
|
|
|
|
|
|
|
}, |
78
|
|
|
|
|
|
|
txt_record => { |
79
|
|
|
|
|
|
|
base => 'RPC::XML::struct', |
80
|
|
|
|
|
|
|
}, |
81
|
|
|
|
|
|
|
ds_record => { |
82
|
|
|
|
|
|
|
base => 'RPC::XML::struct', |
83
|
|
|
|
|
|
|
}, |
84
|
|
|
|
|
|
|
rp_record => { |
85
|
|
|
|
|
|
|
base => 'RPC::XML::struct', |
86
|
|
|
|
|
|
|
}, |
87
|
|
|
|
|
|
|
crs_mail_record => { |
88
|
|
|
|
|
|
|
base => 'RPC::XML::struct', |
89
|
|
|
|
|
|
|
}, |
90
|
|
|
|
|
|
|
crs_web_record => { |
91
|
|
|
|
|
|
|
base => 'RPC::XML::struct', |
92
|
|
|
|
|
|
|
}, |
93
|
|
|
|
|
|
|
); |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
for my $type (keys %udns_types) { |
97
|
|
|
|
|
|
|
my $info = $udns_types{$type}; |
98
|
|
|
|
|
|
|
my $base = $info->{base} |
99
|
|
|
|
|
|
|
or die "No base class defined for $type type"; |
100
|
|
|
|
|
|
|
my $class = "RPC::XML::$type"; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
no strict 'refs'; ## no critic |
103
|
|
|
|
|
|
|
die "Class $class already exists" |
104
|
|
|
|
|
|
|
if @{"${class}::ISA"}; |
105
|
|
|
|
|
|
|
@{"${class}::ISA"} = ($base); |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
if ($type =~ m/_/) { |
108
|
|
|
|
|
|
|
# we need to compensate for the default as_string method that will |
109
|
|
|
|
|
|
|
# replace '_' with '.' in the type name, by installing our own in |
110
|
|
|
|
|
|
|
# our subclass that doesn't do that. |
111
|
|
|
|
|
|
|
*{"${class}::as_string"} = sub { |
112
|
|
|
|
|
|
|
my $self = shift; |
113
|
|
|
|
|
|
|
my $class = ref $self; |
114
|
|
|
|
|
|
|
$class =~ s/^.*\://; |
115
|
|
|
|
|
|
|
return "<$class>$$self$class>"; |
116
|
|
|
|
|
|
|
}; |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub _type_to_class_map { |
122
|
|
|
|
|
|
|
return { map { $_ => "RPC::XML::$_" } keys %udns_types } |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
1; |