Object/FilterSet/AFRINIC.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 41 CC 2 SCAR 12.0
CC
2
Cov
0%
filter_set
6.0
new
2.0
BEGIN
2.0
CRAP 3.3
1 package Net::Whois::Object::FilterSet::AFRINIC;
2  
3 use strict;
4 use warnings;
5 use base qw/Net::Whois::Object/;
6  
7 # whois -t filter-set -h whois.afrinic.net
8 # % This is the AfriNIC Whois server.
9 #
10 # filter-set: [mandatory] [single] [primary/look-up key]
11 # descr: [mandatory] [multiple] [ ]
12 # filter: [optional] [single] [ ]
13 # mp-filter: [optional] [single] [ ]
14 # remarks: [optional] [multiple] [ ]
15 # org: [optional] [multiple] [inverse key]
16 # tech-c: [mandatory] [multiple] [inverse key]
17 # admin-c: [mandatory] [multiple] [inverse key]
18 # notify: [optional] [multiple] [inverse key]
19 # mnt-by: [mandatory] [multiple] [inverse key]
20 # mnt-lower: [optional] [multiple] [inverse key]
21 # changed: [mandatory] [multiple] [ ]
22 # source: [mandatory] [single] [ ]
23  
24 __PACKAGE__->attributes( 'primary', ['filter_set'] );
25 __PACKAGE__->attributes( 'mandatory', [ 'filter_set', 'descr', 'tech_c', 'admin_c', 'mnt_by', 'changed', 'source' ] );
26 __PACKAGE__->attributes( 'optional', [ 'filter', 'mp_filter', 'remarks', 'org', 'notify', 'mnt_lower' ] );
27 __PACKAGE__->attributes( 'single', [ 'filter_set', 'filter', 'mp_filter', 'source' ] );
28 __PACKAGE__->attributes( 'multiple', [ 'descr', 'remarks', 'org', 'tech_c', 'admin_c', 'notify', 'mnt_by', 'mnt_lower', 'changed' ] );
29  
30 =head1 NAME
31  
32 Net::Whois::Object::FilterSet::AFRINIC - an object representation of a RPSL FilterSet block
33  
34 =head1 DESCRIPTION
35  
36 A FilterSet object defines a set of routes that match the criteria that you
37 specify in your 'filter', in other words it filters out routes that you do
38 not want to see.
39  
40 =head1 METHODS
41  
42 =head2 new ( @options )
43  
44 Constructor for the Net::Whois::Object::FilterSet::AFRINIC class
45  
46 =cut
47  
48 sub new {
49 my ( $class, @options ) = @_;
50  
51 my $self = bless {}, $class;
52 $self->_init(@options);
53  
54 return $self;
55 }
56  
57 =head2 B<filter_set( [$filter_set] )>
58  
59 Accessor to the filter_set attribute.
60 Accepts an optional filter_set value, always return the current filter_set value.
61  
62 The filter_set attribute defines the name of the filter. It is an RPSL
63 name that starts with "fltr-".
64  
65 The name of a filter_set object can be hierarchical:
66  
67 A hierarchical filter_set name is a sequence of filter_set names and AS
68 Numbers separated by colons. At least one component of the name must be an
69 actual filter_set name (i.e. start with "fltr-"). All the set name
70 components of a hierarchical filter-name have to be filter_set names.
71  
72 =cut
73  
74 sub filter_set {
75 my ( $self, $filter_set ) = @_;
76 if ( $filter_set and $filter_set !~ /^fltr-/i ) {
77 warn "Incorrect FilterSet's name ($filter_set) : Should start with 'FLTR-'";
78 }
79  
80 return $self->_single_attribute_setget( 'filter_set', $filter_set );
81 }
82  
83 =head2 B<descr( [$descr] )>
84  
85 Accessor to the descr attribute.
86 Accepts an optional descr value to be added to the descr array,
87 always return the current descr array.
88  
89 A short description related to the object's purpose.
90  
91 =head2 B<filter( [$filter] )>
92  
93 Accessor to the filter attribute.
94 Accepts an optional filter value, always return the current filter.
95  
96 The filter attribute defines the policy filter of the set.
97  
98 A policy filter is a logical expression which, when applied to a
99 set of routes, returns a subset of these routes, the ones that
100 you have said you want to see.
101  
102 =head2 B<mp_filter( [$mp_filter] )>
103  
104 Accessor to the mp_filter attribute.
105 Accepts an optional mp_filter value, always return the current mp_filter.
106  
107 Logical expression which when applied to a set of IPv4 or IPv6 routes returns
108 a subset of these routes.
109  
110 =head2 B<remarks( [$remark] )>
111  
112 Accessor to the remarks attribute.
113 Accepts an optional remark to be added to the remarks array,
114 always return the current remarks array.
115  
116 General remarks. May include a URL or email address.
117  
118 =head2 B<tech_c( [$contact] )>
119  
120 Accessor to the tech_c attribute.
121 Accepts an optional contact to be added to the tech_c array,
122 always return the current tech_c array.
123  
124 The NIC-handle of a technical contact 'person' or 'role' object. As more than
125 one person often fulfills a role function, there may be more than one tech_c
126 listed.
127  
128 A technical contact (tech_c) must be a person responsible for the
129 day-to-day operation of the network, but does not need to be
130 physically located at the site of the network.
131  
132 =head2 B<admin_c( [$contact] )>
133  
134 Accessor to the admin_c attribute.
135 Accepts an optional contact to be added to the admin_c array,
136 always return the current admin_c array.
137  
138 The NIC-handle of an on-site contact 'person' object. As more than one person
139 often fulfills a role function, there may be more than one admin_c listed.
140  
141 An administrative contact (admin_c) must be someone who is physically
142 located at the site of the network.
143  
144 =head2 B<org( [$org] )>
145  
146 Accessor to the org attribute.
147 Accepts an optional org value to be added to the org array,
148 always return the current org array.
149  
150 The organisation responsible for this FilterSet object.
151  
152 =head2 B<notify( [$notify] )>
153  
154 Accessor to the notify attribute.
155 Accepts an optional notify value to be added to the notify array,
156 always return the current notify array.
157  
158 The email address of who last updated the database object and the date it
159 occurred.
160  
161 Every time a change is made to a database object, this attribute will show
162 the email address of the person who made those changes.
163 Please use the address format specified in RFC 822 - Standard for
164 the Format of ARPA Internet Text Message and provide the date
165 format using one of the following two formats: YYYYMMDD or YYMMDD.
166  
167 =head2 B<mnt_by( [$mnt_by] )>
168  
169 Accessor to the mnt_by attribute.
170 Accepts an optional mnt_by value to be added to the mnt_by array,
171 always return the current mnt_by array.
172  
173 Lists a registered 'mntner' used to authorize and authenticate changes to this
174 object.
175  
176 When the database details are protected by a Mntner object, then
177 only persons with access to the security information of that Mntner
178 object will be able to change details.
179  
180 =head2 B<mnt_lower( [$mnt_lower] )>
181  
182 Accessor to the mnt_lower attribute.
183 Accepts an optional mnt_lower value to be added to the mnt_lower array,
184 always return the current mnt_lower array.
185  
186 Sometimes there is a hierarchy of maintainers. In these cases, mnt_lower is
187 used as well as mnt_by.
188  
189 =head2 B<changed( [$changed] )>
190  
191 Accessor to the changed attribute.
192 Accepts an optional changed value to be added to the changed array,
193 always return the current changed array.
194  
195 The email address of who last updated the database object and the date it
196 occurred.
197  
198 Every time a change is made to a database object, this attribute will show
199 the email address of the person who made those changes.
200 Please use the address format specified in RFC 822 - Standard for
201 the Format of ARPA Internet Text Message and provide the date
202 format using one of the following two formats: YYYYMMDD or YYMMDD.
203  
204 =head2 B<source( [$source] )>
205  
206 Accessor to the source attribute.
207 Accepts an optional source, always return the current source.
208  
209 The database where the object is registered.
210  
211 =cut
212  
213 1;