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