File Coverage

blib/lib/Net/Whois/Object/AutNum.pm
Criterion Covered Total %
statement 16 17 94.1
branch 1 2 50.0
condition 2 3 66.6
subroutine 5 5 100.0
pod 2 2 100.0
total 26 29 89.6


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