/
Inet6Num.pm
383 lines (253 loc) · 9.92 KB
/
Inet6Num.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
package Net::Whois::Object::Inet6Num;
use base qw/Net::Whois::Object/;
# http://www.ripe.net/data-tools/support/documentation/update-ref-manual#section-12
# http://www.apnic.net/apnic-info/whois_search/using-whois/guide/inet6num
#
# inet6num: [mandatory] [single] [primary/look-up key]
# netname: [mandatory] [single] [lookup key]
# descr: [mandatory] [multiple] [ ]
# country: [mandatory] [multiple] [ ]
# org: [optional] [single] [inverse key]
# admin-c: [mandatory] [multiple] [inverse key]
# tech-c: [mandatory] [multiple] [inverse key]
# status: [mandatory] [single] [ ]
# remarks: [optional] [multiple] [ ]
# notify: [optional] [multiple] [inverse key]
# mnt-by: [mandatory] [multiple] [inverse key]
# mnt-lower: [optional] [multiple] [inverse key]
# mnt-routes: [optional] [multiple] [inverse key]
# mnt-domains: [optional] [multiple] [inverse key]
# mnt-irt: [optional] [multiple] [inverse key]
# changed: [mandatory] [multiple] [ ]
# source: [mandatory] [single] [ ]
# From http://www.apnic.net/apnic-info/whois_search/using-whois/guide/inet6num?view=text-only
#
# mnt-irt: [mandatory] [single] [inverse key]
=head1 NAME
Net::Whois::Object::Inet6Num - an object representation of a RPSL Inet6Num block
=head1 DESCRIPTION
An inet6num object contains information on allocations and assignments
of IPv6 address space.
=head1 METHODS
=head2 new ( %options )
Constructor for the Net::Whois::Object::Inet6Num class
=cut
sub new {
my ( $class, %options ) = @_;
my $self = bless {}, $class;
for my $key ( keys %options ) {
$self->$key( $options{$key} );
}
$self->attributes( 'primary', ['inet6num'] );
$self->attributes( 'mandatory', [ 'inet6num', 'netname', 'status', 'source' ] );
$self->attributes( 'optionnal', [ 'org', 'remarks', 'notify', 'mnt_lower', 'mnt_routes', 'mnt_domains', 'mnt_irt' ] );
$self->attributes( 'single', [ 'inet6num', 'netname', 'org', 'status', 'source' ] );
$self->attributes( 'multiple', [ 'descr', 'country', 'tech_c', 'admin_c', 'remarks', 'notify', 'mnt_by', 'mnt_lower', 'mnt_routes', 'mnt_domains', 'mnt_irt', 'changed' ] );
return $self;
}
=head2 B<inet6num( [$inet6num] )>
Accessor to the inet6num attribute.
Accepts an optional inet6num value, always return the current inet6num value.
The inet6num attribute specifies a range of IPv6 addresses that the
inet6num object presents. The range may be a single address.
Addresses can only be expressed in prefix notation
=cut
sub inet6num {
my ( $self, $inet6num ) = @_;
return $self->_single_attribute_setget( 'inet6num', $inet6num );
}
=head2 B<netname( [$netname] )>
Accessor to the netname attribute.
Accepts an optional netname, always return the current netname.
The netname attribute is the name of a range of IP address space. It is
recommended that the same netname is used for any set of assignment ranges
used for a common purpose.
=cut
sub netname {
my ( $self, $netname ) = @_;
return $self->_single_attribute_setget( 'netname', $netname );
}
=head2 B<descr( [$descr] )>
Accessor to the descr attribute.
Accepts an optional descr to be added to the descr array,
always return the current descr array.
Description of the organization allocated or assigned the address space shown
in the inet6num.
=cut
sub descr {
my ( $self, $descr ) = @_;
return $self->_multiple_attribute_setget( 'descr', $descr );
}
=head2 B<country( [$country] )>
Accessor to the country attribute.
Accepts an optional country to be added to the country array,
always return the current country array.
The country attribute identifies the country. It has never been specified
if this is the country where the addresses are used, where the issuing
organisation is based or some transit country in between. There are no rules
defined for this attribute. It cannot therefore be used in any reliable way to
map IP addresses to countries.
=cut
sub country {
my ( $self, $country ) = @_;
return $self->_multiple_attribute_setget( 'country', $country );
}
=head2 B<org( [$org] )>
Accessor to the org attribute.
Accepts an optional org, always return the current org.
Only a single value for the org attribute is allowed in the inet6num
object. This is to ensure only one organisation is responsible for this
resource.
=cut
sub org {
my ( $self, $org ) = @_;
return $self->_single_attribute_setget( 'org', $org );
}
=head2 B<admin_c( [$contact] )>
Accessor to the admin_c attribute.
Accepts an optional contact to be added to the admin_c array,
always return the current admin_c array.
The NIC-handle of an on-site contact 'person' object. As more than one person
often fulfills a role function, there may be more than one admin_c listed.
An administrative contact (admin_c) must be someone who is physically
located at the site of the network.
=cut
sub admin_c {
my ( $self, $contact ) = @_;
return $self->_multiple_attribute_setget( 'admin_c', $contact );
}
=head2 B<tech_c( [$contact] )>
Accessor to the tech_c attribute.
Accepts an optional contact to be added to the tech_c array,
always return the current tech_c array.
The NIC-handle of a technical contact 'person' or 'role' object. As more than
one person often fulfills a role function, there may be more than one tech_c
listed.
A technical contact (tech_c) must be a person responsible for the
day-to-day operation of the network, but does not need to be
=cut
sub tech_c {
my ( $self, $contact ) = @_;
return $self->_multiple_attribute_setget( 'tech_c', $contact );
}
=head2 B<status( [$status] )>
Accessor to the status attribute.
Accepts an optional status, always return the current status.
The status attribute indicates where the address range represented by an
inet6num object sits in a hierarchy and how it is used.
Status can have one of these values:
=over 4
=item ALLOCATED-BY-RIR
=item ALLOCATED-BY-LIR
=item ASSIGNED
=item ASSIGNED ANYCAST
=item ASSIGNED PI
=back
=cut
sub status {
my ( $self, $status ) = @_;
return $self->_single_attribute_setget( 'status', $status );
}
=head2 B<remarks( [$remark] )>
Accessor to the remarks attribute.
Accepts an optional remark to be added to the remarks array,
always return the current remarks array.
General remarks. May include a URL or instructions on where to send abuse
complaints.
=cut
sub remarks {
my ( $self, $remark ) = @_;
return $self->_multiple_attribute_setget( 'remarks', $remark );
}
=head2 B<notify( [$notify] )>
Accessor to the notify attribute.
Accepts an optional notify value to be added to the notify array,
always return the current notify array.
The email address to which notifications of changes to this object should be
sent.
=cut
sub notify {
my ( $self, $notify ) = @_;
return $self->_multiple_attribute_setget( 'notify', $notify );
}
=head2 B<mnt_by( [$mnt_by] )>
Accessor to the mnt_by attribute.
Accepts an optional mnt_by value to be added to the mnt_by array,
always return the current mnt_by array.
=cut
sub mnt_by {
my ( $self, $mnt_by ) = @_;
return $self->_multiple_attribute_setget( 'mnt_by', $mnt_by );
}
=head2 B<mnt_lower( [$mnt_lower] )>
Accessor to the mnt_lower attribute.
Accepts an optional mnt_lower value to be added to the mnt_lower array,
always return the current mnt_lower array.
Sometimes there is a hierarchy of maintainers. In these cases, mnt-lower is
used as well as 'mnt-by.'
=cut
sub mnt_lower {
my ( $self, $mnt_lower ) = @_;
return $self->_multiple_attribute_setget( 'mnt_lower', $mnt_lower );
}
=head2 B<mnt_routes( [$mnt_route] )>
Accessor to the mnt_routes attribute.
Accepts an optional mnt_route to be added to the mnt_routes array,
always return the current mnt_routes array.
The identifier of a registered Mntner object used to control the creation of
Route6 objects associated with the address range specified by the Inet6num
object.
=cut
sub mnt_routes {
my ( $self, $mnt_route ) = @_;
return $self->_multiple_attribute_setget( 'mnt_routes', $mnt_route );
}
=head2 B<mnt_domains( [$mnt_route] )>
Accessor to the mnt_domains attribute.
Accepts an optional mnt_route to be added to the mnt_domains array,
always return the current mnt_domains array.
The identifier of a registered Mntner object used to control the creation of
Domain objects associated with the address range specified by the Inet6num
object.
=cut
sub mnt_domains {
my ( $self, $mnt_route ) = @_;
return $self->_multiple_attribute_setget( 'mnt_domains', $mnt_route );
}
=head2 B<mnt_irt( [$mnt_irt] )>
Accessor to the mnt_irt attribute.
Accepts an optional mnt_irt to be added to the mnt_irt array,
always return the current mnt_irt array.
mnt_irt references an Irt object. Authorisation is required from the Irt
object to be able to add this reference.
=cut
sub mnt_irt {
my ( $self, $mnt_irt ) = @_;
return $self->_multiple_attribute_setget( 'mnt_irt', $mnt_irt );
}
=head2 B<changed( [$changed] )>
Accessor to the changed attribute.
Accepts an optional changed value to be added to the changed array,
always return the current changed array.
The email address of who last updated the database object and the date it
occurred.
Every time a change is made to a database object, this attribute will show
the email address of the person who made those changes.
Please use the address format specified in RFC 822 - Standard for
the Format of ARPA Internet Text Message and provide the date
format using one of the following two formats: YYYYMMDD or YYMMDD.
=cut
sub changed {
my ( $self, $changed ) = @_;
return $self->_multiple_attribute_setget( 'changed', $changed );
}
=head2 B<source( [$source] )>
Accessor to the source attribute.
Accepts an optional source, always return the current source.
The database where the object is registered.
=cut
sub source {
my ( $self, $source ) = @_;
return $self->_single_attribute_setget( 'source', $source );
}
1;