Object/AutNum.pm

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