Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Net-Whois-RIPE-2.00010

  • Loading branch information...
commit ae63e01db8fd4efcb0ec8c6ab9bea6c34072430b 1 parent c2c479b
@arhuman authored
Showing with 7,112 additions and 11 deletions.
  1. +22 −2 Changes
  2. +47 −4 MANIFEST
  3. +1 −1  META.yml
  4. +204 −0 lib/Net/Whois/Object.pm
  5. +202 −0 lib/Net/Whois/Object/AsBlock.pm
  6. +203 −0 lib/Net/Whois/Object/AsSet.pm
  7. +357 −0 lib/Net/Whois/Object/AutNum.pm
  8. +260 −0 lib/Net/Whois/Object/Domain.pm
  9. +188 −0 lib/Net/Whois/Object/FilterSet.pm
  10. +277 −0 lib/Net/Whois/Object/Inet6Num.pm
  11. +286 −0 lib/Net/Whois/Object/InetNum.pm
  12. +290 −0 lib/Net/Whois/Object/InetRtr.pm
  13. +56 −0 lib/Net/Whois/Object/Information.pm
  14. +184 −0 lib/Net/Whois/Object/KeyCert.pm
  15. +185 −0 lib/Net/Whois/Object/Limerick.pm
  16. +280 −0 lib/Net/Whois/Object/Mntner.pm
  17. +308 −0 lib/Net/Whois/Object/Organisation.pm
  18. +222 −0 lib/Net/Whois/Object/PeeringSet.pm
  19. +201 −0 lib/Net/Whois/Object/Person.pm
  20. +201 −0 lib/Net/Whois/Object/Poem.pm
  21. +54 −0 lib/Net/Whois/Object/Response.pm
  22. +250 −0 lib/Net/Whois/Object/Role.pm
  23. +343 −0 lib/Net/Whois/Object/Route.pm
  24. +238 −0 lib/Net/Whois/Object/RouteSet.pm
  25. +231 −0 lib/Net/Whois/Object/RtrSet.pm
  26. +5 −4 lib/Net/Whois/RIPE.pm
  27. +108 −0 t/03-objects.t
  28. +96 −0 t/105-AsBlock.t
  29. +82 −0 t/110-AutNum.t
  30. +87 −0 t/115-Person.t
  31. +89 −0 t/120-Role.t
  32. +113 −0 t/125-AsSet.t
  33. +108 −0 t/130-Domain.t
  34. +111 −0 t/135-InetNum.t
  35. +107 −0 t/140-Inet6Num.t
  36. +106 −0 t/145-InetRtr.t
  37. +102 −0 t/150-RtrSet.t
  38. +105 −0 t/155-Mntner.t
  39. +115 −0 t/160-KeyCert.t
  40. +135 −0 t/165-Route.t
  41. +101 −0 t/170-RouteSet.t
  42. +95 −0 t/175-PeeringSet.t
  43. +89 −0 t/180-Limerick.t
  44. +82 −0 t/185-Poem.t
  45. +112 −0 t/190-Organisation.t
  46. +36 −0 t/195-Response.t
  47. +38 −0 t/200-Information.t
View
24 Changes
@@ -1,5 +1,25 @@
Revision history for net-whois-ripe
-0.01 Fri, 22 Jan 2010 23:33:55 +0100
- Initial release
+2.00010 20 Apr 2012
+ Net::Whois::Object addition (By Arnaud "Arhuman" Assad)
+
+2.00009 23 Nov 2011
+
+2.00008 26 Oct 2011
+
+2.00003 13 Feb 2011
+
+2.00002 28 Jan 2010
+
+1.31 23 Aug 2009
+
+1.30 10 Jul 2009
+
+1.23 17 Apr 2006
+
+1.22 09 May 2005
+
+1.20 07 Nov 2004
+
+1.19 23 Jul 2002
View
51 MANIFEST
@@ -1,13 +1,56 @@
Changes
-MANIFEST
+lib/Net/Whois/Object.pm
+lib/Net/Whois/Object/AsBlock.pm
+lib/Net/Whois/Object/AsSet.pm
+lib/Net/Whois/Object/AutNum.pm
+lib/Net/Whois/Object/Domain.pm
+lib/Net/Whois/Object/FilterSet.pm
+lib/Net/Whois/Object/Inet6Num.pm
+lib/Net/Whois/Object/InetNum.pm
+lib/Net/Whois/Object/InetRtr.pm
+lib/Net/Whois/Object/Information.pm
+lib/Net/Whois/Object/KeyCert.pm
+lib/Net/Whois/Object/Limerick.pm
+lib/Net/Whois/Object/Mntner.pm
+lib/Net/Whois/Object/Organisation.pm
+lib/Net/Whois/Object/PeeringSet.pm
+lib/Net/Whois/Object/Person.pm
+lib/Net/Whois/Object/Poem.pm
+lib/Net/Whois/Object/Response.pm
+lib/Net/Whois/Object/Role.pm
+lib/Net/Whois/Object/Route.pm
+lib/Net/Whois/Object/RouteSet.pm
+lib/Net/Whois/Object/RtrSet.pm
+lib/Net/Whois/RIPE.pm
Makefile.PL
+MANIFEST
+META.json Module JSON meta-data (added by MakeMaker)
+META.yml Module meta-data (added by MakeMaker)
README
-lib/Net/Whois/RIPE.pm
t/00-load.t
t/01-instantiation.t
t/02-methods.t
+t/03-objects.t
+t/105-AsBlock.t
+t/110-AutNum.t
+t/115-Person.t
+t/120-Role.t
+t/125-AsSet.t
+t/130-Domain.t
+t/135-InetNum.t
+t/140-Inet6Num.t
+t/145-InetRtr.t
+t/150-RtrSet.t
+t/155-Mntner.t
+t/160-KeyCert.t
+t/165-Route.t
+t/170-RouteSet.t
+t/175-PeeringSet.t
+t/180-Limerick.t
+t/185-Poem.t
+t/190-Organisation.t
+t/195-Response.t
+t/200-Information.t
t/boilerplate.t
t/pod-coverage.t
t/pod.t
-META.yml Module meta-data (added by MakeMaker)
-META.json Module JSON meta-data (added by MakeMaker)
View
2  META.yml
@@ -22,4 +22,4 @@ requires:
Iterator::Util: 0
Test::More: 0
perl: 5.006
-version: 2.00009
+version: 2.00_010
View
204 lib/Net/Whois/Object.pm
@@ -0,0 +1,204 @@
+package Net::Whois::Object;
+
+=head1 NAME
+
+Net/Whois/Object - Object encapsulating RPSL data returned by Whois queries
+
+=head1 SYNOPSIS
+
+ use Net::Whois::RIPE;
+ use Net::Whois::Object;
+
+ my $whois = Net::Whois::RIPE->new( %options );
+ $iterator = $whois->query( 'AS30781' );
+
+ while (my $value = $iterator->value()) {
+ my @lines = split '\n', $value;
+ push @projects, Net::Whois::Object(@lines);
+ }
+
+ for my $object (@objects) {
+ # process the Net::Whois::Object::xxx objects...
+ }
+
+ ...
+
+=head1 SUBROUTINES/METHODS
+
+=head2 B<new( @lines )>
+
+The constructor is a factory returning the appropriate Net/Whois/Object
+based on the first attribute of the block.
+
+=cut
+
+sub new {
+ my $class = shift;
+ my @lines = @_;
+
+ my ( $object, $block, @results );
+
+ my ( $attribute, $value );
+ for my $line (@lines) {
+
+
+ if ( $line =~ /^(\S+):\s+(.*)/ ) {
+
+ # Attribute line
+ $attribute = $1;
+ $value = $2;
+
+ }
+ elsif ( $line =~ /^%(\S.*)/ ) {
+
+ # Response line
+ $block = 'response';
+ $value = $1;
+
+ }
+ elsif ( $line =~ /^%\s(.*)/ ) {
+
+ $block = 'comment' unless $block;
+
+ # Comment line
+ $attribute = "comment";
+ $value = $1;
+
+ }
+ elsif ( $line =~ /^[^%]\s*(.+)/ ) {
+
+ # Continuation line
+ $value = $1;
+
+ }
+ elsif ( $line =~ /^$/ ) {
+
+ # Blank line
+ push @results, $object;
+ $attribute = undef;
+ $block = undef;
+ $object = undef;
+ next;
+
+ }
+
+ # Normalize attribute to Perl's sub name standards
+ $attribute =~ s/-/_/g if $attribute;
+
+ # First attribute determine the block
+ $block = $attribute unless $block;
+
+ $object = _object_factory( $block, $value ) unless $object;
+
+ if ($attribute) {
+ $object->$attribute($value);
+ }
+
+ }
+ return @results;
+}
+
+=head2 B<filter( $filter )>
+
+Accessor to the filter attribute used to filter out objects.
+Accepts an optional filter to be added to the filter array,
+always return the current filter array.
+
+=cut
+
+sub filter {
+ my ( $self, $filter ) = @_;
+ push @{ $self->{filter} }, $filter if defined $filter;
+ return @{ $self->{filter} };
+}
+
+=head2 B<hidden_attributes( $attribute )>
+
+Accessor to the filtered_attributes attribute (attributes to be hidden)
+Accepts an optional attribute to be added to the filtered_attributes array,
+always return the current filtered_attributes array.
+
+=cut
+
+sub filtered_attributes {
+ my ( $self, $filtered_attributes ) = @_;
+ push @{ $self->{filtered_attributes} }, $filtered_attributes if defined $filtered_attributes;
+ return @{ $self->{filtered_attributes} };
+}
+
+=head2 B<displayed_attributes( $attribute )>
+
+Accessor to the displayed_attributes attribute which should be displayed.
+Accepts an optional attribute to be added to the displayed_attributes array,
+always return the current displayed_attributes array.
+
+=cut
+
+sub displayed_attributes {
+ my ( $self, $displayed_attributes ) = @_;
+ push @{ $self->{displayed_attributes} }, $displayed_attributes if defined $displayed_attributes;
+ return @{ $self->{displayed_attributes} };
+}
+
+=begin UNDOCUMENTED
+
+=head2 B<_object_factory( $type => $value )>
+
+Private method. Shouldn't be used from other modules.
+
+Simple factory, creating Net::Whois::Objet::XXXX from
+the type passed as parameter.
+
+=end UNDOCUMENTED
+
+=cut
+
+sub _object_factory {
+ my $type = shift;
+ my $value = shift;
+
+ my %class = ( aut_num => 'AutNum',
+ as_block => 'AsBlock',
+ as_set => 'AsSet',
+ comment => 'Information',
+ person => 'Person',
+ role => 'Role',
+ domain => 'Domain',
+ inetnum => 'InetNum',
+ inet6num => 'Inet6Num',
+ inet_rtr => 'InetRtr',
+ rtr_set => 'RtrSet',
+ mntner => 'Mntner',
+ key_cert => 'KeyCert',
+ route => 'Route',
+ route_set => 'RouteSet',
+ peering_set => 'PeeringSet',
+ limerick => 'Limerick',
+ poem => 'Poem',
+ organisation => 'Organisation',
+ response => 'Response'
+ );
+
+ die "Unrecognized Object ($type first attribute)" unless $class{$type};
+
+ my $class = "Net::Whois::Object::" . $class{$type};
+
+ eval "require $class";
+ return $class->new( $type => $value );
+
+}
+
+=head1 AUTHOR
+
+Arnaud "Arhuman" Assad, C<< <arhuman at gmail.com> >>
+
+=head1 ACKNOWLEDGEMENTS
+
+Thanks to Jaguar Network for allowing me to work on this during some of my office
+hours.
+
+Thanks to Luis Motta Campos for his trust when allowing me to publish this
+release.
+
+=cut
+1;
View
202 lib/Net/Whois/Object/AsBlock.pm
@@ -0,0 +1,202 @@
+package Net::Whois::Object::AsBlock;
+
+use base qw/Net::Whois::Object/;
+
+# From ripe-223
+#
+# as-block: [mandatory] [single] [primary/look-up key]
+# descr: [optional] [multiple] [ ]
+# remarks: [optional] [multiple] [ ]
+# tech-c: [mandatory] [multiple] [inverse key]
+# admin-c: [mandatory] [multiple] [inverse key]
+# notify: [optional] [multiple] [inverse key]
+# mnt-lower: [optional] [multiple] [inverse key]
+# mnt-by: [mandatory] [multiple] [inverse key]
+# changed: [mandatory] [multiple] [ ]
+# source: [mandatory] [single] [ ]
+
+# Found in the wild
+# org:
+
+=head1 NAME
+
+Net::Whois::Object::AsBlock - an object representation of the RPSL AsBlock block
+
+=head1 DESCRIPTION
+
+An as-block object is needed to delegate a range of AS numbers to a
+given repository. This object may be used for authorisation of the
+creation of aut-num objects within the range specified by the
+"as-block:" attribute.
+
+=head1 METHODS
+
+=head2 B<new( %options )>
+
+Constructor for the Net::Whois::Object::AsBlock class
+
+=cut
+
+sub new {
+ my ( $class, %options ) = @_;
+
+ my $self = bless {}, $class;
+
+ for my $key ( keys %options ) {
+ $self->$key( $options{$key} );
+ }
+
+ return $self;
+}
+
+=head2 B<as_block( [$as_block] )>
+
+Accessor to the as_block attribute.
+Accepts an optional as_block, always return the current as_block value.
+
+=cut
+
+sub as_block {
+ my ( $self, $as_block ) = @_;
+ $self->{as_block} = $as_block if defined $as_block;
+ return $self->{as_block};
+}
+
+=head2 B<descr( [$descr] )>
+
+Accessor to the descr attribute.
+Accepts an optional descr, always return the current descr value.
+
+=cut
+
+sub descr {
+ my ( $self, $descr ) = @_;
+ push @{ $self->{descr} }, $descr if defined $descr;
+ return \@{ $self->{descr} };
+}
+
+=head2 B<remarks( [$remarks] )>
+
+Accessor to the remarks attribute.
+Accepts an optional remarks to be added to the remarks array,
+always return the current remarks array.
+
+=cut
+
+sub remarks {
+ my ( $self, $remarks ) = @_;
+ push @{ $self->{remarks} }, $remarks if defined $remarks;
+ return \@{ $self->{remarks} };
+}
+
+=head2 B<tech_c( [$tech_c] )>
+
+Accessor to the tech_c attribute.
+Accepts an optional tech_c to be added to the tech_c array,
+always return the current tech_c array.
+
+=cut
+
+sub tech_c {
+ my ( $self, $tech_c ) = @_;
+ push @{ $self->{tech_c} }, $tech_c if defined $tech_c;
+ return \@{ $self->{tech_c} };
+}
+
+=head2 B<admin_c( [$admin_c])>
+
+Accessor to the admin_c attribute.
+Accepts an optional admin_c to be added to the admin_c array,
+always return the current admin_c array.
+
+=cut
+
+sub admin_c {
+ my ( $self, $admin_c ) = @_;
+ push @{ $self->{admin_c} }, $admin_c if defined $admin_c;
+ return \@{ $self->{admin_c} };
+}
+
+=head2 B<notify( [$notify] )>
+
+Accessor to the notify attribute.
+Accepts an optional value to be added notify array,
+ always return the current notify array.
+
+=cut
+
+sub notify {
+ my ( $self, $notify ) = @_;
+ push @{ $self->{notify} }, $notify if defined $notify;
+ return \@{ $self->{notify} };
+}
+
+=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.
+
+=cut
+
+sub mnt_lower {
+ my ( $self, $mnt_lower ) = @_;
+ push @{ $self->{mnt_lower} }, $mnt_lower if defined $mnt_lower;
+ return \@{ $self->{mnt_lower} };
+}
+
+=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 ) = @_;
+ push @{ $self->{mnt_by} }, $mnt_by if defined $mnt_by;
+ return \@{ $self->{mnt_by} };
+}
+
+=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.
+
+=cut
+
+sub changed {
+ my ( $self, $changed ) = @_;
+ push @{ $self->{changed} }, $changed if defined $changed;
+ return \@{ $self->{changed} };
+}
+
+=head2 B<source( [$source] )>
+
+Accessor to the source attribute.
+Accepts an optional source, always return the current source.
+
+=cut
+
+sub source {
+ my ( $self, $source ) = @_;
+ $self->{source} = $source if defined $source;
+ return $self->{source};
+}
+
+=head2 B<org( [$org] )>
+
+Accessor to the org attribute.
+Accepts an optional org, always return the current org.
+
+=cut
+
+sub org {
+ my ( $self, $org ) = @_;
+ $self->{org} = $org if defined $org;
+ return $self->{org};
+}
+
+1;
View
203 lib/Net/Whois/Object/AsSet.pm
@@ -0,0 +1,203 @@
+package Net::Whois::Object::AsSet;
+
+use base qw/Net::Whois::Object/;
+
+# From ripe-223
+#
+# as-set: [mandatory] [single] [primary/look-up key]
+# descr: [mandatory] [multiple] [ ]
+# members: [optional] [multiple] [ ]
+# mbrs-by-ref: [optional] [multiple] [inverse key]
+# remarks: [optional] [multiple] [ ]
+# tech-c: [mandatory] [multiple] [inverse key]
+# admin-c: [mandatory] [multiple] [inverse key]
+# notify: [optional] [multiple] [inverse key]
+# mnt-by: [mandatory] [multiple] [inverse key]
+# changed: [mandatory] [multiple] [ ]
+# source: [mandatory] [single] [ ]
+
+=head1 NAME
+
+Net::Whois::Object::AsSet - an object representation of a RPSL AsSet block
+
+=head1 DESCRIPTION
+
+An as-set object defines a set of aut-num objects. The attributes of
+the as-set class are shown in Figure 1.2.2. The "as-set:" attribute
+defines the name of the set. It is an RPSL name that starts with
+"as-". The "members:" attribute lists the members of the set. The
+"members:" attribute is a list of AS numbers, or other as-set names.
+
+=head1 METHODS
+
+=head2 new ( %options )
+
+Constructor for the Net::Whois::Object::AsSet class
+
+=cut
+
+sub new {
+ my ( $class, %options ) = @_;
+
+ my $self = bless {}, $class;
+
+ for my $key ( keys %options ) {
+ $self->$key( $options{$key} );
+ }
+
+ return $self;
+}
+
+=head2 B<as_set( [$as_set])>
+
+Accessor to the as_set attribute.
+Accepts an optional as_set, always return the current as_set value.
+
+=cut
+
+sub as_set {
+ my ( $self, $as_set ) = @_;
+ $self->{as_set} = $as_set if defined $as_set;
+ return $self->{as_set};
+}
+
+=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.
+
+=cut
+
+sub descr {
+ my ( $self, $descr ) = @_;
+ push @{ $self->{descr} }, $descr if defined $descr;
+ return \@{ $self->{descr} };
+}
+
+=head2 B<members( [$member] )>
+
+Accessor to the members attribute.
+Accepts an optional member to be added to the members array,
+always return the current 'members' array.
+
+=cut
+
+sub members {
+ my ( $self, $member ) = @_;
+ push @{ $self->{members} }, $member if defined $member;
+ return \@{ $self->{members} };
+}
+
+=head2 B<mbrs_by_ref( [$mbr] )>
+
+Accessor to the mbrs_by_ref attribute.
+Accepts an optional mbr to be added to the mbrs_by_ref array,
+always return the current mbrs_by_ref array.
+
+=cut
+
+sub mbrs_by_ref {
+ my ( $self, $mbr) = @_;
+ push @{ $self->{mbrs_by_ref} }, $mbr if defined $mbr;
+ return \@{ $self->{mbrs_by_ref} };
+}
+
+=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.
+
+=cut
+
+sub remarks {
+ my ( $self, $remark ) = @_;
+ push @{ $self->{remarks} }, $remark if defined $remark;
+ return \@{ $self->{remarks} };
+}
+
+=head2 B<tech_c( [$tech_c] )>
+
+Accessor to the tech_c attribute.
+Accepts an optional tech_c to be added to the tech_c array,
+always return the current tech_c array.
+
+=cut
+
+sub tech_c {
+ my ( $self, $tech_c ) = @_;
+ push @{ $self->{tech_c} }, $tech_c if defined $tech_c;
+ return \@{ $self->{tech_c} };
+}
+
+=head2 B<admin_c( [$admin_c] )>
+
+Accessor to the admin_c attribute.
+Accepts an optional admin_c to be added to the admin_c array,
+always return the current admin_c array.
+
+=cut
+
+sub admin_c {
+ my ( $self, $admin_c ) = @_;
+ push @{ $self->{admin_c} }, $admin_c if defined $admin_c;
+ return \@{ $self->{admin_c} };
+}
+
+=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.
+
+=cut
+
+sub notify {
+ my ( $self, $notify ) = @_;
+ push @{ $self->{notify} }, $notify if defined $notify;
+ return \@{ $self->{notify} };
+}
+
+=head2 B<mnt_by( [$mnt] )>
+
+Accessor to the mnt_by attribute.
+Accepts an optional mnt to be added to the mnt_by array,
+always return the current mnt_by array.
+
+=cut
+
+sub mnt_by {
+ my ( $self, $mnt ) = @_;
+ push @{ $self->{mnt_by} }, $mnt if defined $mnt;
+ return \@{ $self->{mnt_by} };
+}
+
+=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.
+
+=cut
+
+sub changed {
+ my ( $self, $changed ) = @_;
+ push @{ $self->{changed} }, $changed if defined $changed;
+ return \@{ $self->{changed} };
+}
+
+=head2 B<source( [$source] )>
+
+Accessor to the source attribute.
+Accepts an optional source, always return the current source.
+
+=cut
+
+sub source {
+ my ( $self, $source ) = @_;
+ $self->{source} = $source if defined $source;
+ return $self->{source};
+}
+
+1;
View
357 lib/Net/Whois/Object/AutNum.pm
@@ -0,0 +1,357 @@
+package Net::Whois::Object::AutNum;
+
+use base qw/Net::Whois::Object/;
+
+# From ripe-223
+#
+# aut-num: [mandatory] [single] [primary/look-up key]
+# as-name: [mandatory] [single] [ ]
+# descr: [mandatory] [multiple] [ ]
+# member-of: [optional] [multiple] [inverse key]
+# import: [optional] [multiple] [ ]
+# export: [optional] [multiple] [ ]
+# default: [optional] [multiple] [ ]
+# remarks: [optional] [multiple] [ ]
+# admin-c: [mandatory] [multiple] [inverse key]
+# tech-c: [mandatory] [multiple] [inverse key]
+# cross-mnt: [optional] [multiple] [inverse key]
+# cross-nfy: [optional] [multiple] [inverse key]
+# notify: [optional] [multiple] [inverse key]
+# mnt-lower: [optional] [multiple] [inverse key]
+# mnt-routes: [optional] [multiple] [inverse key]
+# mnt-by: [mandatory] [multiple] [inverse key]
+# changed: [mandatory] [multiple] [ ]
+# source: [mandatory] [single] [ ]
+
+# Found into the Wild
+# mp-import
+# mp-export
+
+=head1 NAME
+
+Net::Whois::Object::AutNum - an object representation of a RPSL AutNum block
+
+=head1 DESCRIPTION
+
+An object of the aut-num class is a database representation of an
+Autonomous System (AS), which is a group of IP networks operated by
+one or more network operators that has a single and clearly defined
+external routing policy.</SPAN>
+Objects of this class are used to
+specify routing policies. The attributes of the aut-num class are
+shown in Figure 1.2.3. The value of the "aut-num:" attribute is the AS
+number of the AS described by this object. The "as-name:" attribute is
+a symbolic name (in RPSL name syntax) of the AS. The import, export
+and default routing policies of the AS are specified using the
+"import:", "export:" and "default:" attributes, respectively.
+
+=head1 METHODS
+
+=head2 new ( %options )
+
+Constructor for the Net::Whois::Object::AutNum class
+
+=cut
+
+sub new {
+ my ( $class, %options ) = @_;
+
+ my $self = bless {}, $class;
+
+ for my $key ( keys %options ) {
+ $self->$key( $options{$key} );
+ }
+
+ return $self;
+}
+
+=head2 B<aut_num( [$aut_num] )>
+
+Accessor to the aut_num attribute.
+Accepts an optional aut_num, always return the current aut_num array.
+
+=cut
+
+sub aut_num {
+ my ( $self, $aut_num ) = @_;
+ $self->{aut_num} = $aut_num if defined $aut_num;
+ return $self->{aut_num};
+}
+
+=head2 B<as_name( [$as_name] )>
+
+Accessor to the as_name attribute.
+Accepts an optional as_name, always return the current as_name array.
+
+=cut
+
+sub as_name {
+ my ( $self, $as_name ) = @_;
+ $self->{as_name} = $as_name if defined $as_name;
+ return $self->{as_name};
+}
+
+=head2 B<descr( [$descr] )>
+
+Accessor to the descr attribute.
+Accepts an optional descr value to be added to the descr array, always return the current descr array.
+
+=cut
+
+sub descr {
+ my ( $self, $descr ) = @_;
+ push @{ $self->{descr} }, $descr if defined $descr;
+ return \@{ $self->{descr} };
+}
+
+=head2 B<member_of( [$mbr_of] )>
+
+Accessor to the member_of attribute.
+Accepts an optional member_of value to be added to the member_of array,
+always return the current member_of array.
+
+=cut
+
+sub member_of {
+ my ( $self, $member_of ) = @_;
+ push @{ $self->{member_of} }, $member_of if defined $member_of;
+ return \@{ $self->{member_of} };
+}
+
+=head2 B<import( [$import] )>
+
+Accessor to the import attribute.
+Accepts an optional import line to be added to the import array,
+always return the current import array.
+
+=cut
+
+sub import {
+ my ( $self, $import ) = @_;
+ push @{ $self->{import} }, $import if defined $import;
+ return \@{ $self->{import} };
+}
+
+=head2 B<export( [$export] )>
+
+Accessor to the export attribute.
+Accepts an optional export line to be added to the export array,
+always return the current export array.
+
+=cut
+
+sub export {
+ my ( $self, $export ) = @_;
+ push @{ $self->{export} }, $export if defined $export;
+ return \@{ $self->{export} };
+}
+
+=head2 B<default( [$default] )>
+
+Accessor to the default attribute.
+Accepts an optional default value to be added to the default array,
+always return the current default array.
+
+=cut
+
+sub default {
+ my ( $self, $default ) = @_;
+ push @{ $self->{default} }, $default if defined $default;
+ return \@{ $self->{default} };
+}
+
+=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.
+
+=cut
+
+sub remarks {
+ my ( $self, $remark ) = @_;
+ push @{ $self->{remarks} }, $remark if defined $remark;
+ return \@{ $self->{remarks} };
+}
+
+=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.
+
+=cut
+
+sub admin_c {
+ my ( $self, $contact ) = @_;
+ push @{ $self->{admin_c} }, $contact if defined $contact;
+ return \@{ $self->{admin_c} };
+}
+
+=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.
+
+=cut
+
+sub tech_c {
+ my ( $self, $contact ) = @_;
+ push @{ $self->{tech_c} }, $contact if defined $contact;
+ return \@{ $self->{tech_c} };
+}
+
+=head2 B<cross_mnt( [$mnt] )>
+
+Accessor to the cross_mnt attribute.
+Accepts an optional mnt to be added to the cross_mnt array,
+always return the current cross_mnt array.
+
+=cut
+
+sub cross_mnt {
+ my ( $self, $cross_mnt ) = @_;
+ push @{ $self->{cross_mnt} }, $mnt if defined $mnt;
+ return \@{ $self->{cross_mnt} };
+}
+
+=head2 B<cross_nfy( [$notify] )>
+
+Accessor to the cross_nfy attribute.
+Accepts an optional notify to be added to the cross_nfy array,
+always return the current cross_nfy array.
+
+=cut
+
+sub cross_nfy {
+ my ( $self, $notify ) = @_;
+ push @{ $self->{cross_nfy} }, $notify if defined $notify;
+ return \@{ $self->{cross_nfy} };
+}
+
+=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.
+
+=cut
+
+sub notify {
+ my ( $self, $notify ) = @_;
+ push @{ $self->{notify} }, $notify if defined $notify;
+ return \@{ $self->{notify} };
+}
+
+=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.
+
+=cut
+
+sub mnt_lower {
+ my ( $self, $mnt_lower ) = @_;
+ push @{ $self->{mnt_lower} }, $mnt_lower if defined $mnt_lower;
+ return \@{ $self->{mnt_lower} };
+}
+
+=head2 B<mnt_routes( [$mnt_routes] )>
+
+Accessor to the mnt_routes attribute.
+Accepts an optional mnt_routes value to be added to the mnt_routes array,
+always return the current mnt_routes array.
+
+=cut
+
+sub mnt_routes {
+ my ( $self, $mnt_routes ) = @_;
+ push @{ $self->{mnt_routes} }, $mnt_routes if defined $mnt_routes;
+ return \@{ $self->{mnt_routes} };
+}
+
+=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 ) = @_;
+ push @{ $self->{mnt_by} }, $mnt_by if defined $mnt_by;
+ return \@{ $self->{mnt_by} };
+}
+
+=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.
+
+=cut
+
+sub changed {
+ my ( $self, $changed ) = @_;
+ push @{ $self->{changed} }, $changed if defined $changed;
+ return \@{ $self->{changed} };
+}
+
+=head2 B<mp_import( [$mp_import] )>
+
+Accessor to the mp_import attribute.
+Accepts an optional mp_import line to be added to the mp_import array,
+always return the current mp_import array.
+
+=cut
+
+sub mp_import {
+ my ( $self, $mp_import ) = @_;
+ push @{ $self->{mp_import} }, $mp_import if defined $mp_import;
+ return \@{ $self->{mp_import} };
+}
+
+=head2 B<mp_export( [$mp_export] )>
+
+Accessor to the mp_export attribute.
+Accepts an optional mp_export line to be added to the mp_export array,
+always return the current mp_export array.
+
+=cut
+
+sub mp_export {
+ my ( $self, $mp_export ) = @_;
+ push @{ $self->{mp_export} }, $mp_export if defined $mp_export;
+ return \@{ $self->{mp_export} };
+}
+
+=head2 B<source( [$source] )>
+
+Accessor to the source attribute.
+Accepts an optional source, always return the current source.
+
+=cut
+
+sub source {
+ my ( $self, $source ) = @_;
+ $self->{source} = $source if defined $source;
+ return $self->{source};
+}
+
+=head2 B<org( [$org] )>
+
+Accessor to the org attribute.
+Accepts an optional org, always return the current org.
+
+=cut
+
+sub org {
+ my ( $self, $org ) = @_;
+ $self->{org} = $org if defined $org;
+ return $self->{org};
+}
+
+1;
View
260 lib/Net/Whois/Object/Domain.pm
@@ -0,0 +1,260 @@
+package Net::Whois::Object::Domain;
+
+use base qw/Net::Whois::Object/;
+
+# From ripe-223
+#
+# domain: [mandatory] [single] [primary/look-up key]
+# descr: [mandatory] [multiple] [ ]
+# admin-c: [mandatory] [multiple] [inverse key]
+# tech-c: [mandatory] [multiple] [inverse key]
+# zone-c: [mandatory] [multiple] [inverse key]
+# nserver: [optional] [multiple] [inverse key]
+# sub-dom: [optional] [multiple] [inverse key]
+# dom-net: [optional] [multiple] [ ]
+# remarks: [optional] [multiple] [ ]
+# notify: [optional] [multiple] [inverse key]
+# mnt-by: [optional] [multiple] [inverse key]
+# mnt-lower: [optional] [multiple] [inverse key]
+# refer: [optional] [single] [ ]
+# changed: [mandatory] [multiple] [ ]
+# source: [mandatory] [single] [ ]
+
+=head1 NAME
+
+Net::Whois::Object::Domain - an object representation of a RPSL Domain block
+
+=head1 DESCRIPTION
+
+The domain object represents Top Level Domain (TLD) and other domain
+registrations. It is also used for Reverse Delegations. The domain
+name is written in fully qualified format, without a trailing " . "
+
+=head1 METHODS
+
+=head2 new ( %options )
+
+Constructor for the Net::Whois::Object::Domain class
+
+=cut
+
+sub new {
+ my ( $class, %options ) = @_;
+
+ my $self = bless {}, $class;
+
+ for my $key ( keys %options ) {
+ $self->$key( $options{$key} );
+ }
+
+ return $self;
+}
+
+=head2 B<domain( [$domain] )>
+
+Accessor to the domain attribute.
+Accepts an optional domain, always return the current domain.
+
+=cut
+
+sub domain {
+ my ( $self, $domain ) = @_;
+ $self->{domain} = $domain if defined $domain;
+ return $self->{domain};
+}
+
+=head2 B<descr( [$descr] )>
+
+Accessor to the descr attribute.
+Accepts an optional descr line to be added to the descr array,
+always return the current descr array.
+
+=cut
+
+sub descr {
+ my ( $self, $descr ) = @_;
+ push @{ $self->{descr} }, $descr if defined $descr;
+ return \@{ $self->{descr} };
+}
+
+=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.
+
+=cut
+
+sub admin_c {
+ my ( $self, $contact ) = @_;
+ push @{ $self->{admin_c} }, $contact if defined $contact;
+ return \@{ $self->{admin_c} };
+}
+
+=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.
+
+=cut
+
+sub tech_c {
+ my ( $self, $contact ) = @_;
+ push @{ $self->{tech_c} }, $contact if defined $contact;
+ return \@{ $self->{tech_c} };
+}
+
+=head2 B<zone_c( [$contact] )>
+
+Accessor to the zone_c attribute.
+Accepts an optional contact to be added to the zone_c array,
+always return the current zone_c array.
+
+=cut
+
+sub zone_c {
+ my ( $self, $contact ) = @_;
+ push @{ $self->{zone_c} }, $contact if defined $contact;
+ return \@{ $self->{zone_c} };
+}
+
+=head2 B<nserver( [$server] )>
+
+Accessor to the nserver attribute.
+Accepts an optional server to be added to the nserver array,
+always return the current nserver array.
+
+=cut
+
+sub nserver {
+ my ( $self, $server ) = @_;
+ push @{ $self->{nserver} }, $server if defined $server;
+ return \@{ $self->{nserver} };
+}
+
+=head2 B<sub_dom( [$dom] )>
+
+Accessor to the sub_dom attribute.
+Accepts an optional dom to be added to the sub_dom array,
+always return the current sub_dom array.
+
+=cut
+
+sub sub_dom {
+ my ( $self, $dom ) = @_;
+ push @{ $self->{sub_dom} }, $dom if defined $dom;
+ return \@{ $self->{sub_dom} };
+}
+
+=head2 B<dom_net( [$dom_net] )>
+
+Accessor to the dom_net attribute.
+Accepts an optional dom_net value to be added to the dom_net array,
+always return the current dom_net array.
+
+=cut
+
+sub dom_net {
+ my ( $self, $dom_net ) = @_;
+ push @{ $self->{dom_net} }, $dom_net if defined $dom_net;
+ return \@{ $self->{dom_net} };
+}
+
+=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.
+
+=cut
+
+sub remarks {
+ my ( $self, $remark ) = @_;
+ push @{ $self->{remarks} }, $remark if defined $remark;
+ return \@{ $self->{remarks} };
+}
+
+=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.
+
+=cut
+
+sub notify {
+ my ( $self, $notify ) = @_;
+ push @{ $self->{notify} }, $notify if defined $notify;
+ return \@{ $self->{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 ) = @_;
+ push @{ $self->{mnt_by} }, $mnt_by if defined $mnt_by;
+ return \@{ $self->{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.
+
+=cut
+
+sub mnt_lower {
+ my ( $self, $mnt_lower ) = @_;
+ push @{ $self->{mnt_lower} }, $mnt_lower if defined $mnt_lower;
+ return \@{ $self->{mnt_lower} };
+}
+
+=head2 B<refer( [$refer] )>
+
+Accessor to the refer attribute.
+Accepts an optional refer, always return the current refer.
+
+=cut
+
+sub refer {
+ my ( $self, $refer ) = @_;
+ $self->{refer} = $refer if defined $refer;
+ return $self->{refer};
+}
+
+=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.
+
+=cut
+
+sub changed {
+ my ( $self, $changed ) = @_;
+ push @{ $self->{changed} }, $changed if defined $changed;
+ return \@{ $self->{changed} };
+}
+
+=head2 B<source( [$source] )>
+
+Accessor to the source attribute.
+Accepts an optional source, always return the current source.
+
+=cut
+
+sub source {
+ my ( $self, $source ) = @_;
+ $self->{source} = $source if defined $source;
+ return $self->{source};
+}
+
+1;
View
188 lib/Net/Whois/Object/FilterSet.pm
@@ -0,0 +1,188 @@
+package Net::Whois::Object::FilterSet;
+
+use base qw/Net::Whois::Object/;
+
+# From ripe-223
+#
+# filter-set: [mandatory] [single] [primary/look-up key]
+# descr: [mandatory] [multiple] [ ]
+# filter: [mandatory] [single] [ ]
+# remarks: [optional] [multiple] [ ]
+# tech-c: [mandatory] [multiple] [inverse key]
+# admin-c: [mandatory] [multiple] [inverse key]
+# notify: [optional] [multiple] [inverse key]
+# mnt-by: [mandatory] [multiple] [inverse key]
+# changed: [mandatory] [multiple] [ ]
+# source: [mandatory] [single] [ ]
+
+=head1 NAME
+
+Net::Whois::Object::FilterSet - an object representation of a RPSL FilterSet block
+
+=head1 DESCRIPTION
+
+A filter-set object defines a set of routes that are matched by its
+filter. The "filter-set:" attribute defines the name of the filter.
+It is an RPSL name that starts with "fltr-". The "filter:" attribute
+defines the set's policy filter. A policy filter is a logical
+expression which when applied to a set of routes returns a subset of
+these routes.
+
+=head1 METHODS
+
+=head2 new ( %options )
+
+Constructor for the Net::Whois::Object::FilterSet class
+
+=cut
+
+sub new {
+ my ( $class, %options ) = @_;
+
+ my $self = bless {}, $class;
+
+ for my $key ( keys %options ) {
+ $self->$key( $options{$key} );
+ }
+
+ return $self;
+}
+
+=head2 B<filter_set( [$filter_set] )>
+
+Accessor to the filter_set attribute.
+Accepts an optional filter_set value, always return the current filter_set value.
+
+=cut
+
+sub filter_set {
+ my ( $self, $filter_set ) = @_;
+ $self->{filter_set} = $filter_set if defined $filter_set;
+ return $self->{filter_set};
+}
+
+=head2 B<descr( [$descr] )>
+
+Accessor to the descr attribute.
+Accepts an optional descr value to be added to the descr array,
+always return the current descr array.
+
+=cut
+
+sub descr {
+ my ( $self, $descr ) = @_;
+ push @{ $self->{descr} }, $descr if defined $descr;
+ return \@{ $self->{descr} };
+}
+
+=head2 B<filter( [$filter] )>
+
+Accessor to the filter attribute.
+Accepts an optional filter value, always return the current filter.
+
+=cut
+
+sub filter {
+ my ( $self, $filter ) = @_;
+ $self->{filter} = $filter if defined $filter;
+ return $self->{filter};
+}
+
+=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.
+
+=cut
+
+sub remarks {
+ my ( $self, $remark ) = @_;
+ push @{ $self->{remarks} }, $remark if defined $remark;
+ return \@{ $self->{remarks} };
+}
+
+=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.
+
+=cut
+
+sub tech_c {
+ my ( $self, $contact ) = @_;
+ push @{ $self->{tech_c} }, $contact if defined $contact;
+ return \@{ $self->{tech_c} };
+}
+
+=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.
+
+=cut
+
+sub admin_c {
+ my ( $self, $contact ) = @_;
+ push @{ $self->{admin_c} }, $contact if defined $contact;
+ return \@{ $self->{admin_c} };
+}
+
+=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.
+
+=cut
+
+sub notify {
+ my ( $self, $notify ) = @_;
+ push @{ $self->{notify} }, $notify if defined $notify;
+ return \@{ $self->{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 ) = @_;
+ push @{ $self->{mnt_by} }, $mnt_by if defined $mnt_by;
+ return \@{ $self->{mnt_by} };
+}
+
+=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.
+
+=cut
+
+sub changed {
+ my ( $self, $changed ) = @_;
+ push @{ $self->{changed} }, $changed if defined $changed;
+ return \@{ $self->{changed} };
+}
+
+=head2 B<source( [$source] )>
+
+Accessor to the source attribute.
+Accepts an optional source, always return the current source.
+
+=cut
+
+sub source {
+ my ( $self, $source ) = @_;
+ $self->{source} = $source if defined $source;
+ return $self->{source};
+}
+
+1;
View
277 lib/Net/Whois/Object/Inet6Num.pm
@@ -0,0 +1,277 @@
+package Net::Whois::Object::Inet6Num;
+
+use base qw/Net::Whois::Object/;
+
+# From ripe-223
+#
+# inet6num: [mandatory] [single] [primary/look-up key]
+# netname: [mandatory] [single] [lookup key]
+# descr: [mandatory] [multiple] [ ]
+# country: [mandatory] [multiple] [ ]
+# admin-c: [mandatory] [multiple] [inverse key]
+# tech-c: [mandatory] [multiple] [inverse key]
+# rev-srv: [optional] [multiple] [inverse key]
+# status: [generated] [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]
+# 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} );
+ }
+
+ return $self;
+}
+
+=head2 B<inet6num( [$inet6num] )>
+
+Accessor to the inet6num attribute.
+Accepts an optional inet6num value, always return the current inet6num value.
+
+=cut
+
+sub inet6num {
+ my ( $self, $inet6num ) = @_;
+ $self->{inet6num} = $inet6num if defined $inet6num;
+ return $self->{inet6num};
+}
+
+=head2 B<netname( [$netname] )>
+
+Accessor to the netname attribute.
+Accepts an optional netname, always return the current netname.
+
+=cut
+
+sub netname {
+ my ( $self, $netname ) = @_;
+ $self->{netname} = $netname if defined $netname;
+ return $self->{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.
+
+=cut
+
+sub descr {
+ my ( $self, $descr ) = @_;
+ push @{ $self->{descr} }, $descr if defined $descr;
+ return \@{ $self->{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.
+
+=cut
+
+sub country {
+ my ( $self, $country ) = @_;
+ push @{ $self->{country} }, $country if defined $country;
+ return \@{ $self->{country} };
+}
+
+=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.
+
+=cut
+
+sub admin_c {
+ my ( $self, $contact ) = @_;
+ push @{ $self->{admin_c} }, $contact if defined $contact;
+ return \@{ $self->{admin_c} };
+}
+
+=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.
+
+=cut
+
+sub tech_c {
+ my ( $self, $tech_c ) = @_;
+ push @{ $self->{tech_c} }, $tech_c if defined $tech_c;
+ return \@{ $self->{tech_c} };
+}
+
+=head2 B<rev_srv( [$serv] )>
+
+Accessor to the rev_srv attribute.
+Accepts an optional serv to be added to the rev_srv array,
+always return the current rev_srv array.
+
+=cut
+
+sub rev_srv {
+ my ( $self, $serv ) = @_;
+ push @{ $self->{rev_srv} }, $serv if defined $serv;
+ return \@{ $self->{rev_srv} };
+}
+
+=head2 B<status( [$status] )>
+
+Accessor to the status attribute.
+Accepts an optional status, always return the current status.
+
+=cut
+
+sub status {
+ my ( $self, $status ) = @_;
+ $self->{status} = $status if defined $status;
+ return $self->{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.
+
+=cut
+
+sub remarks {
+ my ( $self, $remarks ) = @_;
+ push @{ $self->{remarks} }, $remarks if defined $remarks;
+ return \@{ $self->{remarks} };
+}
+
+=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.
+
+=cut
+
+sub notify {
+ my ( $self, $notify ) = @_;
+ push @{ $self->{notify} }, $notify if defined $notify;
+ return \@{ $self->{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 ) = @_;
+ push @{ $self->{mnt_by} }, $mnt_by if defined $mnt_by;
+ return \@{ $self->{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.
+
+=cut
+
+sub mnt_lower {
+ my ( $self, $mnt_lower ) = @_;
+ push @{ $self->{mnt_lower} }, $mnt_lower if defined $mnt_lower;
+ return \@{ $self->{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.
+
+=cut
+
+sub mnt_routes {
+ my ( $self, $mnt_route ) = @_;
+ push @{ $self->{mnt_routes} }, $mnt_route if defined $mnt_route;
+ return \@{ $self->{mnt_routes} };
+}
+
+=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.
+
+=cut
+
+sub changed {
+ my ( $self, $changed ) = @_;
+ push @{ $self->{changed} }, $changed if defined $changed;
+ return \@{ $self->{changed} };
+}
+
+=head2 B<source( [$source] )>
+
+Accessor to the source attribute.
+Accepts an optional source, always return the current source.
+
+=cut
+
+sub source {
+ my ( $self, $source ) = @_;
+ $self->{source} = $source if defined $source;
+ return $self->{source};
+}
+
+=head2 B<mnt_irt( [$mnt_irt] )>
+
+Accessor to the mnt_irt attribute.
+Accepts an optional mnt_irt, always return the current mnt_irt.
+The identifier of a registered 'mntner' object used to provide information
+about a Computer Security Incident Response Team (CSIRT).
+
+=cut
+
+sub mnt_irt {
+ my ( $self, $mnt_irt ) = @_;
+ $self->{mnt_irt} = $mnt_irt if defined $mnt_irt;
+ return $self->{mnt_irt};
+}
+
+1;
View
286 lib/Net/Whois/Object/InetNum.pm
@@ -0,0 +1,286 @@
+package Net::Whois::Object::InetNum;
+
+use base qw/Net::Whois::Object/;
+
+# From ripe-223
+#
+# inetnum: [mandatory] [single] [primary/look-up key]
+# netname: [mandatory] [single] [lookup key]
+# descr: [mandatory] [multiple] [ ]
+# country: [mandatory] [multiple] [ ]
+# admin-c: [mandatory] [multiple] [inverse key]
+# tech-c: [mandatory] [multiple] [inverse key]
+# rev-srv: [optional] [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]
+# changed: [mandatory] [multiple] [ ]
+# source: [mandatory] [single] [ ]
+
+
+# From http://www.apnic.net/apnic-info/whois_search/using-whois/guide/inetnum?view=text-only
+#
+# mnt-irt: [mandatory] [multiple] [inverse key]
+#
+
+=head1 NAME
+
+Net::Whois::Object::InetNum - an object representation of a RPSL InetNum block
+
+=head1 DESCRIPTION
+
+An inetnum object contains information on allocations and assignments
+of IPv4 address space.
+
+=head1 METHODS
+
+=head2 new ( %options )
+
+Constructor for the Net::Whois::Object::InetNum class
+
+=cut
+
+sub new {
+ my ( $class, %options ) = @_;
+
+ my $self = bless {}, $class;
+
+ for my $key ( keys %options ) {
+ $self->$key( $options{$key} );
+ }
+
+ return $self;
+}
+
+=head2 B<inetnum( [$inetnum] )>
+
+Accessor to the inetnum attribute.
+Accepts an optional inetnum value, always return the current inetnum value.
+
+=cut
+
+sub inetnum {
+ my ( $self, $inetnum ) = @_;
+ $self->{inetnum} = $inetnum if defined $inetnum;
+ return $self->{inetnum};
+}
+
+=head2 B<netname( [$netname] )>
+
+Accessor to the netname attribute.
+Accepts an optional netname, always return the current netname.
+
+=cut
+
+sub netname {
+ my ( $self, $netname ) = @_;
+ $self->{netname} = $netname if defined $netname;
+ return $self->{netname};
+}
+
+=head2 B<descr( [$descr] )>
+
+Accessor to the descr attribute.
+Accepts an optional descr value to be added to the descr array,
+always return the current descr array.
+
+=cut
+
+sub descr {
+ my ( $self, $descr ) = @_;
+ push @{ $self->{descr} }, $descr if defined $descr;
+ return \@{ $self->{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.
+
+=cut
+
+sub country {
+ my ( $self, $country ) = @_;
+ push @{ $self->{country} }, $country if defined $country;
+ return \@{ $self->{country} };
+}
+
+=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.
+
+=cut
+
+sub admin_c {
+ my ( $self, $contact ) = @_;
+ push @{ $self->{admin_c} }, $contact if defined $contact;
+ return \@{ $self->{admin_c} };
+}
+
+=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.
+
+=cut
+
+sub tech_c {
+ my ( $self, $contact ) = @_;
+ push @{ $self->{tech_c} }, $contact if defined $contact;
+ return \@{ $self->{tech_c} };
+}
+
+=head2 B<rev_srv( [$serv] )>
+
+Accessor to the rev_srv attribute.
+Accepts an optional serv to be added to the rev_srv array,
+always return the current rev_srv array.
+
+Domain name server for the range of IP addresses specified in the inetnum.
+
+Note: this attribute is deprecated. APNIC suggests the creation of a reverse
+delegation 'domain' object to hold this information.
+
+
+=cut
+
+sub rev_srv {
+ my ( $self, $rev_srv ) = @_;
+ push @{ $self->{rev_srv} }, $rev_srv if defined $rev_srv;
+ return \@{ $self->{rev_srv} };
+}
+
+=head2 B<status( [$status] )>
+
+Accessor to the 'status' attribute.
+Accepts an optional status, always return the current status.
+
+=cut
+
+sub status {
+ my ( $self, $status ) = @_;
+ $self->{status} = $status if defined $status;
+ return $self->{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.
+
+=cut
+
+sub remarks {
+ my ( $self, $remark ) = @_;
+ push @{ $self->{remarks} }, $remark if defined $remark;
+ return \@{ $self->{remarks} };
+}
+
+=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.
+
+=cut
+
+sub notify {
+ my ( $self, $notify ) = @_;
+ push @{ $self->{notify} }, $notify if defined $notify;
+ return \@{ $self->{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 ) = @_;
+ push @{ $self->{mnt_by} }, $mnt_by if defined $mnt_by;
+ return \@{ $self->{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.
+
+=cut
+
+sub mnt_lower {
+ my ( $self, $mnt_lower ) = @_;
+ push @{ $self->{mnt_lower} }, $mnt_lower if defined $mnt_lower;
+ return \@{ $self->{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.
+
+=cut
+
+sub mnt_routes {
+ my ( $self, $mnt_route ) = @_;
+ push @{ $self->{mnt_routes} }, $mnt_route if defined $mnt_route;
+ return \@{ $self->{mnt_routes} };
+}
+
+=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.
+
+=cut
+
+sub changed {
+ my ( $self, $changed ) = @_;
+ push @{ $self->{changed} }, $changed if defined $changed;
+ return \@{ $self->{changed} };
+}
+
+=head2 B<source( [$source] )>
+
+Accessor to the source attribute.
+Accepts an optional source, always return the current source.
+
+=cut
+
+sub source {
+ my ( $self, $source ) = @_;
+ $self->{source} = $source if defined $source;
+ return $self->{source};
+}
+
+=head2 B<mnt_irt( [$mnt_irt] )>
+
+Accessor to the mnt_irt attribute.
+Accepts an optional mnt_irt value to be added to the mnt_irt array,
+always return the current mnt_irt array.
+The identifier of a registered 'mntner' object used to provide information
+about a Computer Security Incident Response Team (CSIRT).
+
+=cut
+
+sub mnt_irt {
+ my ( $self, $mnt_irt ) = @_;
+ push @{ $self->{mnt_irt} }, $mnt_irt if defined $mnt_irt;
+ return \@{ $self->{mnt_irt} };
+}
+
+1;
View
290 lib/Net/Whois/Object/InetRtr.pm
@@ -0,0 +1,290 @@
+package Net::Whois::Object::InetRtr;
+
+use base qw/Net::Whois::Object/;
+
+# From ripe-223
+#
+# inet-rtr: [mandatory] [single] [primary/look-up key]
+# descr: [mandatory] [multiple] [ ]
+# alias: [optional] [multiple] [ ]
+# local-as: [mandatory] [single] [inverse key]
+# ifaddr: [mandatory] [multiple] [lookup key]
+# peer: [optional] [multiple] [ ]
+# member-of: [optional] [multiple] [inverse key]
+# remarks: [optional] [multiple] [ ]
+# admin-c: [mandatory] [multiple] [inverse key]
+# tech-c: [mandatory] [multiple] [inverse key]
+# notify: [optional] [multiple] [inverse key]
+# mnt-by: [mandatory] [multiple] [inverse key]
+# changed: [mandatory] [multiple] [ ]
+# source: [mandatory] [single] [ ]
+
+# http://www.apnic.net/apnic-info/whois_search/using-whois/guide/inet-rtr
+# mp-peer: [optional] [multiple] [ ]
+# interface: [optional] [multiple] [lookup key]
+
+=head1 NAME
+
+Net::Whois::Object::InetRtr - an object representation of a RPSL InetRtr block
+
+=head1 DESCRIPTION
+
+Routers are specified using the inet-rtr class. The attributes of the
+inet-rtr class are shown in Figure 1.2.8. The "inet-rtr:" attribute
+is a valid DNS name of the router described. Each "alias:" attribute,
+if present, is a canonical DNS name for the router. The "local-as:"
+attribute specifies the AS number of the AS that owns/operates this
+router.
+
+=head1 METHODS
+
+=head2 new ( %options )
+
+Constructor for the Net::Whois::Object::InetRtr class
+
+=cut
+
+sub new {
+ my ( $class, %options ) = @_;
+
+ my $self = bless {}, $class;
+
+ for my $key ( keys %options ) {
+ $self->$key( $options{$key} );
+ }
+
+ return $self;
+}
+
+=head2 B<inet_rtr( [$inet_rtr] )>
+
+Accessor to the inet_rtr attribute.
+Accepts an optional inet_rtr, always return the current inet_rtr value.
+
+=cut
+
+sub inet_rtr {
+ my ( $self, $inet_rtr ) = @_;
+ $self->{inet_rtr} = $inet_rtr if defined $inet_rtr;
+ return $self->{inet_rtr};
+}
+
+=head2 B<descr( [$descr] )>
+
+Accessor to the descr attribute.
+Accepts an optional descr value to be added to the descr array,
+always return the current descr array.
+
+=cut
+
+sub descr {
+ my ( $self, $descr ) = @_;
+ push @{ $self->{descr} }, $descr if defined $descr;
+ return \@{ $self->{descr} };
+}
+
+=head2 B<alias( [$alias] )>
+
+Accessor to the alias attribute.
+Accepts an optional alias to be added to the alias array,
+always return the current alias array.
+
+=cut
+
+sub alias {
+ my ( $self, $alias ) = @_;
+ push @{ $self->{alias} }, $alias if defined $alias;
+ return \@{ $self->{alias} };
+}
+
+=head2 B<local_as( [$local_as] )>
+
+Accessor to the local_as attribute.
+Accepts an optional local_as, always return the current local_as.
+
+=cut
+
+sub local_as {
+ my ( $self, $local_as ) = @_;
+ $self->{local_as} = $local_as if defined $local_as;
+ return $self->{local_as};
+}
+
+=head2 B<ifaddr( [$ifaddr] )>
+
+Accessor to the ifaddr attribute.
+Accepts an optional ifaddr value to be added to the ifaddr array,
+always return the current ifaddr array.
+
+=cut
+
+sub ifaddr {
+ my ( $self, $ifaddr ) = @_;
+ push @{ $self->{ifaddr} }, $ifaddr if defined $ifaddr;
+ return \@{ $self->{ifaddr} };
+}
+
+=head2 B<peer( [$peer] )>
+
+Accessor to the peer attribute.
+Accepts an optional peer to be added to the peer array,
+always return the current peer array.
+
+=cut
+
+sub peer {
+ my ( $self, $peer ) = @_;
+ push @{ $self->{peer} }, $peer if defined $peer;
+ return \@{ $self->{peer} };
+}
+
+=head2 B<member_of( [$member_of] )>
+
+Accessor to the member_of attribute.
+Accepts an optional member_of value to be be added to the member_of array,
+always return the current member_of array.
+
+=cut
+
+sub member_of {
+ my ( $self, $member_of ) = @_;
+ push @{ $self->{member_of} }, $member_of if defined $member_of;
+ return \@{ $self->{member_of} };
+}
+
+=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.
+
+=cut
+
+sub remarks {
+ my ( $self, $remark ) = @_;
+ push @{ $self->{remarks} }, $remark if defined $remark;
+ return \@{ $self->{remarks} };
+}
+
+=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.
+
+=cut
+
+sub admin_c {
+ my ( $self, $contact ) = @_;
+ push @{ $self->{admin_c} }, $contact if defined $contact;
+ return \@{ $self->{admin_c} };
+}
+
+=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.
+
+=cut
+
+sub tech_c {
+ my ( $self, $contact ) = @_;
+ push @{ $self->{tech_c} }, $contact if defined $contact;
+ return \@{ $self->{tech_c} };
+}
+
+=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.
+
+=cut
+
+sub notify {
+ my ( $self, $notify ) = @_;
+ push @{ $self->{notify} }, $notify if defined $notify;
+ return \@{ $self->{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 ) = @_;
+ push @{ $self->{mnt_by} }, $mnt_by if defined $mnt_by;
+ return \@{ $self->{mnt_by} };
+}
+
+=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.
+
+=cut
+
+sub changed {
+ my ( $self, $changed ) = @_;
+ push @{ $self->{changed} }, $changed if defined $changed;
+ return \@{ $self->{changed} };
+}
+
+=head2 B<source( [$source] )>
+
+Accessor to the source attribute.
+Accepts an optional source, always return the current source.
+
+=cut
+
+sub source {
+ my ( $self, $source ) = @_;
+ $self->{source} = $source if defined $source;
+ return $self->{source};
+}
+
+=head2 B<mp_peer( [$peer] )>
+
+Accessor to the mp_peer attribute.
+Accepts an optional peer to be added to the mp_peer array,
+always return the current mp_peer array.
+
+This attribute performs the same function as the 'peer' attribute above. The
+difference is that mp-peer allows both IPv4 and IPv6 address families to be
+specified.
+
+=cut
+
+sub mp_peer {
+ my ( $self, $mp_peer ) = @_;
+ push @{ $self->{mp_peer} }, $mp_peer if defined $mp_peer;
+ return \@{ $self->{mp_peer} };
+}
+
+=head2 B<interface( [$interface] )>
+
+Accessor to the interface attribute.
+Accepts an optional interface to be added to the interface array,
+always return the current interface array.
+
+This attribute performs the same function as the 'ifaddr' attribute above. The
+difference is that interface allows both IPv4 and IPv6 address families to be
+specified.
+
+Describes all the inter-router serial port interfaces for all the line cards.
+
+=cut
+
+sub interface {
+ my ( $self, $interface ) = @_;
+ push @{ $self->{interface} }, $interface if defined $interface;
+ return \@{ $self->{interface} };
+}
+
+1;
View
56 lib/Net/Whois/Object/Information.pm
@@ -0,0 +1,56 @@
+package Net::Whois::Object::Information;
+
+use base qw/Net::Whois::Object/;
+
+=head1 NAME
+
+Net::Whois::Object::Information - an object representation of the RPSL Information block
+
+=head1 DESCRIPTION
+
+output starting with the % sign is either a server response code or
+an informational message. A comment contains a white space after the
+% sign, while server messages start right after the % sign. Please
+see Appendix A2 "RIPE Database response codes and messages" for more
+information.
+
+* An empty line ("\n\n") is an object delimiter.
+
+* Two empty lines mean the end of a server response. The "members:" attribute lists the members of the set. The
+"members:" attribute is a list of AS numbers, or other as-set names.
+
+=head1 METHODS
+
+=head2 new ( %options )
+
+Constructor for the Net::Whois::Object::Information class
+
+=cut
+
+sub new {
+ my ( $class, %options ) = @_;
+
+ my $self = bless {}, $class;
+
+ for my $key ( keys %options ) {
+ $self->$key( $options{$key} );
+ }
+
+ return $self;
+}
+
+=head2 B<comment( [$comment] )>
+
+Accessor to the comment attribute.
+Accepts an optional comment to be added to the comment array,
+always return the current comment array.
+
+=cut
+
+sub comment {
+ my ( $self, $comment ) = @_;
+ push @{ $self->{comment} }, $comment if defined $comment;
+ return \@{ $self->{comment} };
+}
+
+1;
View
184 lib/Net/Whois/Object/KeyCert.pm
<
@@ -0,0 +1,184 @@
+package Net::Whois::Object::KeyCert;
+
+use base qw/Net::Whois::Object/;
+
+# From ripe-223
+#
+# key-cert: [mandatory] [single] [primary/look-up key]
+# method: [generated] [single] [ ]
+# owner: [generated] [multiple] [ ]
+# fingerpr: [generated] [single] [ ]
+# certif: [mandatory] [multiple] [ ]
+# remarks: [optional] [multiple] [ ]
+# notify: [optional] [multiple] [inverse key]
+# mnt-by: [mandatory] [multiple] [inverse key]
+# changed: [mandatory] [multiple] [ ]
+# source: [mandatory] [single] [ ]
+
+=head1 NAME
+
+Net::Whois::Object::KeyCert - an object representation of the RPSL KeyCert block
+
+=head1 DESCRIPTION
+
+A key-cert object is a database public key certificate that is stored
+on the server and may be used with a mntner object for authentication
+when performing updates. Currently only PGP keys are supported.
+
+=head1 METHODS
+
+=head2 B<new( %options )>
+
+Constructor for the Net::Whois::Object::InetRtr class
+
+=cut
+
+sub new {
+ my ( $class, %options ) = @_;