Object/AutNum/AFRINIC.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 41 CC 2 SCAR 12.0
CC
2
Cov
0%
aut_num
6.0
new
2.0
BEGIN
2.0
CRAP 3.3
1 package Net::Whois::Object::AutNum::AFRINIC;
2  
3 use strict;
4 use warnings;
5 use base qw/Net::Whois::Object/;
6  
7 # whois -t aut-num -h whois.afrinic.net
8 # % This is the AfriNIC Whois server.
9 #
10 # aut-num: [mandatory] [single] [primary/look-up key]
11 # as-name: [mandatory] [single] [ ]
12 # descr: [mandatory] [multiple] [ ]
13 # member-of: [optional] [multiple] [ ]
14 # import: [optional] [multiple] [ ]
15 # mp-import: [optional] [multiple] [ ]
16 # export: [optional] [multiple] [ ]
17 # mp-export: [optional] [multiple] [ ]
18 # default: [optional] [multiple] [ ]
19 # mp-default: [optional] [multiple] [ ]
20 # remarks: [optional] [multiple] [ ]
21 # org: [optional] [single] [inverse key]
22 # admin-c: [mandatory] [multiple] [inverse key]
23 # tech-c: [mandatory] [multiple] [inverse key]
24 # notify: [optional] [multiple] [inverse key]
25 # mnt-lower: [optional] [multiple] [inverse key]
26 # mnt-routes: [optional] [multiple] [inverse key]
27 # mnt-by: [mandatory] [multiple] [inverse key]
28 # mnt-irt: [optional] [multiple] [inverse key]
29 # changed: [mandatory] [multiple] [ ]
30 # source: [mandatory] [single] [ ]
31  
32  
33 __PACKAGE__->attributes( 'primary', ['aut_num'] );
34 __PACKAGE__->attributes( 'mandatory', [ 'aut_num', 'as_name', 'descr', 'admin_c', 'tech_c', 'mnt_by', 'changed', 'source' ] );
35 __PACKAGE__->attributes( 'optional', [ 'member_of', 'import', 'mp_import', 'export', 'mp_export', 'default', 'mp_default', 'remarks', 'org', 'notify', 'mnt_lower', 'mnt_routes', 'mnt_irt' ] );
36 __PACKAGE__->attributes( 'single', [ 'aut_num', 'as_name', 'org', 'source' ] );
37 __PACKAGE__->attributes( 'multiple', [ 'descr', 'member_of', 'import', 'mp_import', 'export', 'mp_export', 'default', 'mp_default', 'remarks', 'admin_c', 'tech_c', 'notify', 'mnt_lower', 'mnt_routes', 'mnt_by', 'mnt_irt', 'changed' ] );
38  
39  
40 =head1 NAME
41  
42 Net::Whois::Object::AutNum::AFRINIC - an object representation of a RPSL AutNum block
43  
44 =head1 DESCRIPTION
45  
46 Autonomous System numbers ('aut-num' objects) are globally unique identifiers
47 for Autonomous Systems.
48  
49 The aut-num object specifies routing policies. It refers to a group of IP
50 networks that have a single and clearly defined external routing policy,
51 operated by one or more network operators, an Autonomous System (AS).
52  
53 =head1 METHODS
54  
55 =head2 new ( @options )
56  
57 Constructor for the Net::Whois::Object::AutNum::AFRINIC class
58  
59 =cut
60  
61 sub new {
62 my ( $class, @options ) = @_;
63  
64 my $self = bless {}, $class;
65 $self->_init(@options);
66  
67 return $self;
68 }
69  
70 =head2 B<aut_num( [$aut_num] )>
71  
72 Accessor to the aut_num attribute.
73 Accepts an optional aut_num, always return the current aut_num array.
74  
75 The value of the aut_num attribute is the AS Number of the Autonomous
76 System that this object describes and takes the form of ASn where n is
77 a 32 bit number..
78  
79 Leading zeroes (AS0352) are not allowed and will be removed (AS352) by the
80 database software.
81  
82 =cut
83  
84 sub aut_num {
85 my ( $self, $aut_num ) = @_;
86  
87 if ( $aut_num and $aut_num !~ /^AS\d+/ ) {
88 warn "Illegal aut-num ($aut_num) : should be ASn, n being a 32 bit number with no leading 0";
89 }
90  
91 return $self->_single_attribute_setget( 'aut_num', $aut_num );
92 }
93  
94 =head2 B<as_name( [$as_name] )>
95  
96 Accessor to the as_name attribute.
97 Accepts an optional as_name, always return the current as_name array.
98  
99 The as-name attribute is a symbolic name of the AS.
100  
101 =head2 B<descr( [$descr] )>
102  
103 Accessor to the descr attribute.
104 Accepts an optional descr value to be added to the descr array, always return the current descr array.
105  
106 =head2 B<member_of( [$mbr_of] )>
107  
108 Accessor to the member_of attribute.
109 Accepts an optional member_of value to be added to the member_of array,
110 always return the current member_of array.
111  
112 The member_of attribute value identifies a set object that this object
113 wants to be a member of. This claim, however, should be acknowledged by a
114 respective mbrs_by_ref attribute in the referenced object.
115  
116 An aut-num may be useful to include in an 'as-set' if your network maintains a
117 number of Autonomous Systems or wishes to include its routes in an upstream
118 provider's routing information.
119  
120 To be included in an 'as-set', the 'as-set' object must:
121 include the keyword "ANY" or the AS number's mbrs_by_ref attribute
122 and/or list the AS number in the members attribute
123  
124 =head2 B<import( [$import] )>
125  
126 Accessor to the import attribute.
127 Accepts an optional import line to be added to the import array,
128 always return the current import array.
129  
130 The inbound IPv4 routing policy of the AS.
131  
132 =head2 B<mp_import( [$import] )>
133  
134 Accessor to the mp_import attribute.
135 Accepts an optional mp_import line to be added to the import array,
136 always return the current mp_import array.
137  
138 The inbound IPv6 routing policy of the AS.
139  
140 =head2 B<export( [$export] )>
141  
142 Accessor to the export attribute.
143 Accepts an optional export line to be added to the export array,
144 always return the current export array.
145  
146 The outbound routing policy of the AS.
147  
148 =head2 B<mp_export( [$mp_export] )>
149  
150 Accessor to the mp_export attribute.
151 Accepts an optional mp_export line to be added to the mp_export array,
152 always return the current mp_export array.
153  
154 The outbound IPv6 routing policy of the AS.
155  
156 =head2 B<default( [$default] )>
157  
158 Accessor to the default attribute.
159 Accepts an optional default value to be added to the default array,
160 always return the current default array.
161  
162 The peer network the AS will use for as a default, that is, when the AS has no
163 more-specific information on where to send the traffic.
164  
165 =head2 B<mp_default( [$mp_default] )>
166  
167 Accessor to the mp_default attribute.
168 Accepts an optional mp_default line to be added to the mp_default array,
169 always return the current mp_default array.
170  
171 This attribute performs the same function as the 'default' attribute above.
172 The difference is that mp-default allows both IPv4 and IPv6 addresses to be
173 specified.
174  
175 =head2 B<remarks( [$remark] )>
176  
177 Accessor to the remarks attribute.
178 Accepts an optional remark to be added to the remarks array,
179 always return the current remarks array.
180  
181 Information about the object that cannot be stated in other attributes. May
182 include a URL or email address.
183  
184 =cut
185  
186 =head2 B<admin_c( [$contact] )>
187  
188 Accessor to the admin_c attribute.
189 Accepts an optional contact to be added to the admin_c array,
190 always return the current admin_c array.
191  
192 The NIC-handle of an on-site contact 'person' object. As more than one person
193 often fulfills a role function, there may be more than one admin_c listed.
194  
195 An administrative contact (admin_c) must be someone who is physically
196 located at the site of the network.
197  
198 =head2 B<tech_c( [$contact] )>
199  
200 Accessor to the tech_c attribute.
201 Accepts an optional contact to be added to the tech_c array,
202 always return the current tech_c array.
203  
204 The NIC-handle of a technical contact 'person' or 'role' object. As more than
205 one person often fulfills a role function, there may be more than one tech_c
206 listed.
207  
208 A technical contact (tech_c) must be a person responsible for the
209 day-to-day operation of the network, but does not need to be
210 physically located at the site of the network.
211  
212 =head2 B<notify( [$notify] )>
213  
214 Accessor to the notify attribute.
215 Accepts an optional notify value to be added to the notify array,
216 always return the current notify array.
217  
218 =cut
219  
220 =head2 B<mnt_lower( [$mnt_lower] )>
221  
222 Accessor to the mnt_lower attribute.
223 Accepts an optional mnt_lower value to be added to the mnt_lower array,
224 always return the current mnt_lower array.
225  
226 =head2 B<mnt_routes( [$mnt_routes] )>
227  
228 Accessor to the mnt_routes attribute.
229 Accepts an optional mnt_routes value to be added to the mnt_routes array,
230 always return the current mnt_routes array.
231  
232 =head2 B<mnt_by( [$mnt_by] )>
233  
234 Accessor to the mnt_by attribute.
235 Accepts an optional mnt_by value to be added to the mnt_by array,
236 always return the current mnt_by array.
237  
238 =head2 B<changed( [$changed] )>
239  
240 Accessor to the changed attribute.
241 Accepts an optional changed value to be added to the changed array,
242 always return the current changed array.
243  
244 =head2 B<source( [$source] )>
245  
246 Accessor to the source attribute.
247 Accepts an optional source, always return the current source.
248  
249 The database where the object is registered.
250  
251 =head2 B<org( [$org] )>
252  
253 Accessor to the org attribute.
254 Accepts an optional org, always return the current org.
255  
256 Only a single value for the org attribute is allowed in the aut-num object.
257 This is to ensure only one organisation is responsible for this resource.
258  
259 =cut
260  
261 1;