view release on metacpan or search on metacpan
lib/Net/Whois/Generic.pm view on Meta::CPAN
}
);
}
}
=head2 B<object_types()>
Return a list of known object types from the RIPE Database.
RIPE currently returns 21 types (Limerik have been removed):
as-block as-set aut-num domain filter-set inet6num inetnum inet-rtr irt
key-cert mntner organisation peering-set person poem poetic-form role route
route6 route-set rtr-set
Due to some strange mis-behaviour in the protocol (or documentation?) the RIPE
Database server won't allow a keep-alive token with this query, meaning the
connection will be terminated after this query.
=cut
sub object_types
lib/Net/Whois/Object.pm view on Meta::CPAN
my $rir;
my $object_returned;
my %class = ( as_block => 'AsBlock',
as_set => 'AsSet',
aut_num => 'AutNum',
comment => 'Information',
domain => 'Domain',
filter_set => 'FilterSet',
inet6num => 'Inet6Num',
inetnum => 'InetNum',
inet_rtr => 'InetRtr',
irt => 'Irt',
key_cert => 'KeyCert',
limerick => 'Limerick',
mntner => 'Mntner',
organisation => 'Organisation',
peering_set => 'PeeringSet',
person => 'Person',
poem => 'Poem',
lib/Net/Whois/Object/Inet6Num.pm view on Meta::CPAN
#######################################################################################
# The following lines where auto-generated by 'perl whois_to_attribute.pl Inet6Num'
# % This is the RIPE Database query service.
# % The objects are in RPSL format.
# %
# % The RIPE Database is subject to Terms and Conditions.
# % See http://www.ripe.net/db/support/db-terms-conditions.pdf
#
# inet6num: [mandatory] [single] [primary/lookup key]
# netname: [mandatory] [single] [lookup key]
# descr: [optional] [multiple] [ ]
# country: [mandatory] [multiple] [ ]
# geoloc: [optional] [single] [ ]
# language: [optional] [multiple] [ ]
# org: [optional] [single] [inverse key]
# sponsoring-org: [optional] [single] [ ]
# admin-c: [mandatory] [multiple] [inverse key]
# tech-c: [mandatory] [multiple] [inverse key]
# abuse-c: [optional] [single] [inverse key]
lib/Net/Whois/Object/Inet6Num.pm view on Meta::CPAN
# mnt-routes: [optional] [multiple] [inverse key]
# mnt-domains: [optional] [multiple] [inverse key]
# mnt-irt: [optional] [multiple] [inverse key]
# created: [generated] [single] [ ]
# last-modified: [generated] [single] [ ]
# source: [mandatory] [single] [ ]
#
# % This query was served by the RIPE Database Query Service version 1.99 (BLAARKOP)
#
#
__PACKAGE__->attributes( 'primary', [ 'inet6num' ] );
__PACKAGE__->attributes( 'mandatory', [ 'inet6num', 'netname', 'country', 'admin_c', 'tech_c', 'status', 'mnt_by', 'source' ] );
__PACKAGE__->attributes( 'optional', [ 'descr', 'geoloc', 'language', 'org', 'sponsoring_org', 'abuse_c', 'assignment_size', 'remarks', 'notify', 'mnt_lower', 'mnt_routes', 'mnt_domains', 'mnt_irt', 'created', 'last_modified' ] );
__PACKAGE__->attributes( 'single', [ 'inet6num', 'netname', 'geoloc', 'org', 'sponsoring_org', 'abuse_c', 'status', 'assignment_size', 'created', 'last_modified', 'source' ] );
__PACKAGE__->attributes( 'multiple', [ 'descr', 'country', 'language', 'admin_c', 'tech_c', 'remarks', 'notify', 'mnt_by', 'mnt_lower', 'mnt_routes', 'mnt_domains', 'mnt_irt' ] );
# End of auto-generated lines
#######################################################################################
=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;
$self->_init(@options);
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
=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.
=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.
=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
lib/Net/Whois/Object/Inet6Num.pm view on Meta::CPAN
Identifies the language.
Valid two-letter ISO 639-1 language code.
=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.
=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
lib/Net/Whois/Object/Inet6Num.pm view on Meta::CPAN
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
=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
lib/Net/Whois/Object/Inet6Num/AFRINIC.pm view on Meta::CPAN
package Net::Whois::Object::Inet6Num::AFRINIC;
use strict;
use warnings;
use base qw/Net::Whois::Object/;
# whois -t inet6num -h whois.afrinic.net
# % This is the AfriNIC Whois server.
#
# 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] [ ]
# parent: [generated] [multiple] [ ]
__PACKAGE__->attributes( 'primary', ['inet6num'] );
__PACKAGE__->attributes( 'mandatory', [ 'inet6num', 'netname', 'descr', 'country', 'admin_c', 'tech_c', 'status', 'mnt_by', 'changed', 'source' ] );
__PACKAGE__->attributes( 'optional', ['org', 'remarks', 'notify', 'mnt_lower', 'mnt_routes', 'mnt_domains', 'mnt_irt' ] );
__PACKAGE__->attributes( 'single', [ 'inet6num', 'netname', 'org', 'status', 'source' ] );
__PACKAGE__->attributes( 'multiple', [ 'descr', 'country', 'admin_c', 'tech_c', 'remarks', 'notify', 'mnt_by', 'mnt_lower', 'mnt_routes', 'mnt_domains', 'mnt_irt', 'changed' ] );
=head1 NAME
Net::Whois::Object::Inet6Num::AFRINIC - 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::AFRINIC class
=cut
sub new {
my ( $class, @options ) = @_;
my $self = bless {}, $class;
$self->_init(@options);
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
=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.
=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.
=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
lib/Net/Whois/Object/Inet6Num/AFRINIC.pm view on Meta::CPAN
Identifies the language.
Valid two-letter ISO 639-1 language code.
=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.
=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
lib/Net/Whois/Object/Inet6Num/AFRINIC.pm view on Meta::CPAN
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
=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
lib/Net/Whois/Object/Inet6Num/APNIC.pm view on Meta::CPAN
package Net::Whois::Object::Inet6Num::APNIC;
use strict;
use warnings;
use base qw/Net::Whois::Object/;
# whois -h whois.apnic.net -t inet6num
# % [whois.apnic.net]
# % Whois data copyright terms http://www.apnic.net/db/dbcopyright.html
#
# inet6num: [mandatory] [single] [primary/lookup key]
# netname: [mandatory] [single] [lookup key]
# descr: [mandatory] [multiple] [ ]
# country: [mandatory] [multiple] [ ]
# geoloc: [optional] [single] [ ]
# language: [optional] [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-irt: [mandatory] [multiple] [inverse key]
# changed: [mandatory] [multiple] [ ]
# source: [mandatory] [single] [ ]
__PACKAGE__->attributes( 'primary', [ 'inet6num'] );
__PACKAGE__->attributes( 'mandatory', [ 'inet6num', 'netname', 'descr', 'country', 'admin_c', 'tech_c', 'status', 'mnt_by', 'mnt_irt', 'changed', 'source' ] );
__PACKAGE__->attributes( 'optional', [ 'geoloc', 'language', 'org', 'remarks', 'notify', 'mnt_lower', 'mnt_routes' ] );
__PACKAGE__->attributes( 'single', [ 'inet6num', 'netname', 'geoloc', 'org', 'status', 'source' ] );
__PACKAGE__->attributes( 'multiple', [ 'descr', 'country', 'language', 'admin_c', 'tech_c', 'remarks', 'notify', 'mnt_by', 'mnt_lower', 'mnt_routes', 'mnt_irt', 'changed' ] );
=head1 NAME
Net::Whois::Object::Inet6Num::APNIC - 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::APNIC class
=cut
sub new {
my ( $class, @options ) = @_;
my $self = bless {}, $class;
$self->_init(@options);
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
=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.
=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.
=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
lib/Net/Whois/Object/Inet6Num/APNIC.pm view on Meta::CPAN
Identifies the language.
Valid two-letter ISO 639-1 language code.
=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.
=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
lib/Net/Whois/Object/Inet6Num/APNIC.pm view on Meta::CPAN
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
=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
lib/Net/Whois/RIPE.pm view on Meta::CPAN
}
);
}
}
=head2 B<object_types()>
Return a list of known object types from the RIPE Database.
RIPE currently returns 21 types (Limerik have been removed):
as-block as-set aut-num domain filter-set inet6num inetnum inet-rtr irt
key-cert mntner organisation peering-set person poem poetic-form role route
route6 route-set rtr-set
Due to some strange mis-behaviour in the protocol (or documentation?) the RIPE
Database server won't allow a keep-alive token with this query, meaning the
connection will be terminated after this query.
=cut
sub object_types {
t/140-Inet6Num.t view on Meta::CPAN
BEGIN { $class = 'Net::Whois::Object::Inet6Num'; use_ok $class; }
our %tested;
my @lines = <DATA>;
our $object = ( Net::Whois::Object->new(@lines) )[0];
isa_ok $object, $class;
# Non-inherited methods
can_ok $object, qw( inet6num netname descr country admin_c tech_c
status remarks notify mnt_by mnt_lower mnt_routes mnt_domains mnt_irt source);
can_ok $object, qw( mnt_irt );
# Check if typed attributes are correct
can_ok $object, $object->attributes('mandatory');
can_ok $object, $object->attributes('optional');
# Test 'inet6num'
$tested{'inet6num'}++;
is( $object->inet6num(), '2001:0DB8::/32', 'inet6num properly parsed' );
$object->inet6num('2001:0DB9::/32');
is( $object->inet6num(), '2001:0DB9::/32', 'inet6num properly set' );
# Test 'netname'
$tested{'netname'}++;
is( $object->netname(), 'EXAMPLENET-AP', 'netname properly parsed' );
$object->netname('EXAMPLE2');
is( $object->netname(), 'EXAMPLE2', 'netname properly set' );
# Test 'descr'
$tested{'descr'}++;
is_deeply( $object->descr(), ['Example net Pty Ltd'], 'descr properly parsed' );
t/140-Inet6Num.t view on Meta::CPAN
$tested{'org'}++;
# TODO
# Common tests
do './t/common.pl';
ok( $tested{common_loaded}, "t/common.pl properly loaded" );
ok( !$@, "Can evaluate t/common.pl ($@)" );
__DATA__
inet6num: 2001:0DB8::/32
remarks: Example subnet
netname: EXAMPLENET-AP
descr: Example net Pty Ltd
country: AP
admin-c: FR123-AP
tech-c: FR123-AP
status: ALLOCATED PORTABLE
notify: abc@examplenet.com
geoloc: [-90,90]
language: FR