BlockerHelper/backends/dummy.pm

filter: Statementstmt 11.7% 19 / 162 Branchbran 0.0% 0 / 52 Conditioncond 0.0% 0 / 21 MC/DCmcdc 0.0% 0 / 14 Subroutinesub 46.1% 6 / 13 Podpod 100% 7 / 7 totaltotal 11.9% 32 / 269 CC 36 SCAR 57.4
CC
36
Cov
8%
new
600.0
ban
42.0
unban
42.0
CRAP 311.5
« BlockerHelper/backends/ipfw.pm ↑ Summary BlockerHelper/backends/pf.pm »
1 package Net::Firewall::BlockerHelper::backends::dummy;
2  
3 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use base 'Error::Helper';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Regexp::IPv4 qw($IPv4_re);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Regexp::IPv6 qw($IPv6_re);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 =head1 NAME
11  
12 Net::Firewall::BlockerHelper::backends::dummy - Example dummy backend for testing purposes.
13  
14 =head1 VERSION
15  
16 Version 0.0.1
17  
18 =cut
19  
20 1 our $VERSION = '0.0.1';
21  
22 =head1 SYNOPSIS
23  
24 use Net::Firewall::BlockerHelper::backends::dummy;
25  
26 # create a backend named ssh with a dummy backend for port 22 tcp
27 my $backend;
28 eval {
29 $backend = Net::Firewall::BlockerHelper::backends::dummy->new(
30 backend => 'dummy',
31 ports => ['22'],
32 protocols => ['tcp'],
33 name => 'ssh',
34 );
35 };
36 if ($@) {
37 print 'Error: '
38 . $Error::Helper::error
39 . "\nError String: "
40 . $Error::Helper::errorString
41 . "\nError Flag: "
42 . $Error::Helper::errorFlag . "\n";
43 }
44  
45 $backend->init;
46  
47 # start the backend
48 $backend->init_backend;
49  
50 # ban some IPs
51 $backend->ban(ban => '1.2.3.4');
52 $backend->ban(ban => '5.6.7.8');
53  
54 # unban a IP
55 $backend->unban(ban => '1.2.3.4');
56  
57 # get a list of banned IPs
58 my @banned = $backend->list;
59 foreach my $ip (@banned) {
60 print 'Banned IP: '.$ip."\n";
61 }
62  
63 # teardown the backend, re-init, and re-ban everything
64 $backend->re_init;
65  
66 # teardown the backend
67 $backend->teardown;
68  
69 =head1 METHODS
70  
71 =head2 new
72  
73 Initiates the the object.
74  
75 - options :: Backend specific options that will be passed to the backend unchecked
76 outside of making sure it is a hash ref if defined.
77 - Default :: {}
78  
79 - ports :: A array of ports to block. Checked to make sure they are positive ints or a valid
80 service name via getservbyname.
81 - Default :: []
82  
83 - protocols :: A array of protocols to block. By default will block all. This
84 is checked against /etc/protocols via the function getprotobyname.
85 - Default :: []
86  
87 - prefix :: Prefix to use. Must match the regex /^[a-zA-Z0-9]+$/
88 - default :: kur
89  
90 - name :: Name of this specific instance.
91 - default :: undef
92  
93 All errors are considered fatal, meaning if new fails it will die.
94  
95 my $backend;
96 eval {
97 $backend = Net::Firewall::BlockerHelper::backends::dummy->new(
98 backend => 'ipfw',
99 ports => ['22'],
100 protocols => ['tcp'],
101 name => 'ssh',
102 );
103 };
104 if ($@) {
105 print 'Error: '
106 . $Error::Helper::error
107 . "\nError String: "
108 . $Error::Helper::errorString
109 . "\nError Flag: "
110 . $Error::Helper::errorFlag . "\n";
111 }
112  
113 =cut
114  
115 sub new {
116 0 ▶ my ( $blank, %opts ) = @_;
Subroutine new: not called CC=24 SCAR=64.0
Pod documented
117  
118 0 my $self = {
119 perror => undef,
120 error => undef,
121 errorLine => undef,
122 errorFilename => undef,
123 errorString => "",
124 errorExtra => {
125 all_errors_fatal => 1,
126 flags => {
127 1 => 'notInited',
128 2 => 'invalidPortSpecified',
129 3 => 'portsNotArray',
130 4 => 'protocolsNotArray',
131 5 => 'invalidPortSpecified',
132 6 => 'invalidPrefixSpecified',
133 7 => 'invalidName',
134 8 => 'optionsNotHash',
135 9 => 'noBanItem',
136 10 => 'banItemNotIP',
137 11 => 'invalidBackend',
138 12 => 'backendInitError',
139 13 => 'banFailed',
140 14 => 'unbanFailed',
141 15 => 'listFailed',
142 16 => 'reInitFailed',
143 17 => 'teardownFailed',
144 18 => 'alreadyInited',
145 },
146 fatal_flags => {},
147 perror_not_fatal => 0,
148 },
149 backend => undef,
150 options => {},
151 ports => [],
152 protocols => [],
153 testing => undef,
154 test_data => undef,
155 prefix => 'kur',
156 postfix => undef,
157 frontend_obj => undef,
158 inited => 0,
159 banned => {},
160 };
161 0 bless $self;
162  
163 0 ▶ if ( defined( $opts{ports} ) && ref( $opts{ports} ) ne 'ARRAY' ) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $opts{'ports'} and ref $opts{'ports'} ne 'ARRAY') { } 0 0 0
elsif (defined $opts{'ports'}) { } 0 0 0
Condition0%0/3
defined $opts{"ports"} and ref $opts{"ports"} ne "ARRAY"
!ll&&!rl&&r
000
MC/DC0%0/2
defined $opts{"ports"} and ref $opts{"ports"} ne "ARRAY"
defined $opts{"ports"} ref $opts{"ports"} ne "ARRAY"
Truth table0%0/3
A and B
A= defined $opts{"ports"}B= ref $opts{"ports"} ne "ARRAY"
ABresult
0X0
100
111
164 0 $self->{perror} = 1;
165 0 $self->{error} = 3;
166 0 $self->{errorString} = 'ports is defined and type is not array but "' . ref( $opts{ports} ) . '"';
167 0 $self->warn;
168 } elsif ( defined( $opts{ports} ) ) {
169 0 my %ports;
170 0 foreach my $item ( @{ $opts{ports} } ) {
171 0 ▶ if ( $item =~ /^[0-9]+$/ && $item >= 1 ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($item =~ /^[0-9]+$/ and $item >= 1) { } 0 0 0
elsif ($item =~ /^[0-9]+$/ and $item < 1) { } 0 0 0
Condition0%0/3
$item =~ /^[0-9]+$/ and $item >= 1
!ll&&!rl&&r
000
MC/DC0%0/2
$item =~ /^[0-9]+$/ and $item >= 1
$item =~ /^[0-9]+$/ $item >= 1
Truth table0%0/3
A and B
A= $item =~ /^[0-9]+$/B= $item >= 1
ABresult
0X0
100
111
172 0 $ports{$item} = 1;
173 ▶ } elsif ( $item =~ /^[0-9]+$/ && $item < 1 ) {
Condition0%0/3
$item =~ /^[0-9]+$/ and $item < 1
!ll&&!rl&&r
000
MC/DC0%0/2
$item =~ /^[0-9]+$/ and $item < 1
$item =~ /^[0-9]+$/ $item < 1
Truth table0%0/3
A and B
A= $item =~ /^[0-9]+$/B= $item < 1
ABresult
0X0
100
111
174 0 $self->{perror} = 1;
175 0 $self->{error} = 2;
176 $self->{errorString}
177 0 = $item . ' is not a valid value for a port as it must be a int greater or equal to 1';
178 0 $self->warn;
179 } else {
180 # just using tcp here as protocol must be specified
181 0 my ( $name, $aliases, $port, $proto ) = getservbyname( $item, 'tcp' );
182 0 ▶ if ( !defined($port) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $port) 0 0 0
183 0 $self->{perror} = 1;
184 0 $self->{error} = 2;
185 $self->{errorString}
186 0 = $item . ' could not be resolved to a port name via getservbyname("' . $item . '", "tcp")';
187 0 $self->warn;
188 }
189 0 $ports{$port} = 1;
190 } ## end else [ if ( $item =~ /^[0-9]+$/ && $item >= 1 ) ]
191 } ## end foreach my $item ( @{ $opts{ports} } )
192 0 my @port_keys = keys(%ports);
193 0 @port_keys = sort { $a <=> $b } @port_keys;
194 0 push( @{ $self->{ports} }, @port_keys );
195 } ## end elsif ( defined( $opts{ports} ) )
196  
197 0 ▶ if ( defined( $opts{protocols} ) && ref( $opts{protocols} ) ne 'ARRAY' ) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $opts{'protocols'} and ref $opts{'protocols'} ne 'ARRAY') { } 0 0 0
elsif (defined $opts{'protocols'}) { } 0 0 0
Condition0%0/3
defined $opts{"protocols"} and ref $opts{"protocols"} ne "ARRAY"
!ll&&!rl&&r
000
MC/DC0%0/2
defined $opts{"protocols"} and ref $opts{"protocols"} ne "ARRAY"
defined $opts{"protocols"} ref $opts{"protocols"} ne "ARRAY"
Truth table0%0/3
A and B
A= defined $opts{"protocols"}B= ref $opts{"protocols"} ne "ARRAY"
ABresult
0X0
100
111
198 0 $self->{perror} = 1;
199 0 $self->{error} = 4;
200 0 $self->{errorString} = 'protocols is defined and type is not array but "' . ref( $opts{protocols} ) . '"';
201 0 $self->warn;
202 } elsif ( defined( $opts{protocols} ) ) {
203 0 my %protocols;
204 0 foreach my $item ( @{ $opts{protocols} } ) {
205 0 my ( $name, $aliases, $proto ) = getprotobyname($item);
206 # if this is undef, it means it is not a known protocol
207 0 ▶ if ( !defined($proto) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $proto) 0 0 0
208 0 $self->{perror} = 1;
209 0 $self->{error} = 5;
210 $self->{errorString}
211 0 = $item . ' could not be resolved to a port name via getservbyname("' . $item . '", "tcp")';
212 0 $self->warn;
213 }
214 0 $protocols{$item} = 1;
215 } ## end foreach my $item ( @{ $opts{protocols} } )
216 0 my @protocols_keys = keys(%protocols);
217 0 @protocols_keys = sort { $a cmp $b } @protocols_keys;
218 0 push( @{ $self->{protocols} }, @protocols_keys );
219 } ## end elsif ( defined( $opts{protocols} ) )
220  
221 # make sure prefix is sane if defiend
222 0 ▶ if ( defined( $opts{prefix} ) && $opts{prefix} !~ /^[a-zA-Z0-9]+$/ ) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $opts{'prefix'} and not $opts{'prefix'} =~ /^[a-zA-Z0-9]+$/) { } 0 0 0
elsif (defined $opts{'prefix'}) { } 0 0 0
Condition0%0/3
defined $opts{"prefix"} and not $opts{"prefix"} =~ /^[a-zA-Z0-9]+$/
!ll&&!rl&&r
000
MC/DC0%0/2
defined $opts{"prefix"} and not $opts{"prefix"} =~ /^[a-zA-Z0-9]+$/
defined $opts{"prefix"} not $opts{"prefix"} =~ /^[a-zA-Z0-9]+$/
Truth table0%0/3
A and not(B)
A= defined $opts{"prefix"}B= not $opts{"prefix"} =~ /^[a-zA-Z0-9]+$/
ABresult
0X0
100
111
223 0 $self->{perror} = 1;
224 0 $self->{error} = 6;
225 $self->{errorString}
226 0 = '"' . $opts{prefix} . '" is not a valid prefix as it does not match the regex /^[a-zA-Z0-9]+$/';
227 0 $self->warn;
228 } elsif ( defined( $opts{prefix} ) ) {
229 0 $self->{prefix} = $opts{prefix};
230 }
231  
232 # make sure we have a name and that it is valid
233 0 ▶ if ( !defined( $opts{name} ) ) {
Branch: 2 branches
BranchTrueFalseTotal
if (not defined $opts{'name'}) { } 0 0 0
elsif (not $opts{'name'} =~ /^[a-zA-Z0-9\-]+$/) { } 0 0 0
234 0 $self->{perror} = 1;
235 0 $self->{error} = 6;
236 0 $self->{errorString} = 'name is undef';
237 0 $self->warn;
238 } elsif ( $opts{name} !~ /^[a-zA-Z0-9\-]+$/ ) {
239 0 $self->{perror} = 1;
240 0 $self->{error} = 6;
241 0 $self->{errorString} = 'name set to "' . $opts{name} . '" which does not match the regexp /^[a-zA-Z0-9\-]+$/';
242 0 $self->warn;
243 }
244 0 $self->{name} = $opts{name};
245  
246 # used internally for testing
247 0 ▶ if ( defined( $opts{testing} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $opts{"testing"}) 0 0 0
248 0 $self->{testing} = $opts{testing};
249 }
250 0 ▶ if ( defined( $opts{frontend_obj} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $opts{"frontend_obj"}) 0 0 0
251 0 $self->{frontend_obj} = $opts{frontend_obj};
252 }
253  
254 0 ▶ if ( defined( $opts{options} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $opts{"options"}) 0 0 0
255 0 ▶ if ( ref( $opts{options} ) ne 'HASH' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $opts{"options"} ne "HASH") 0 0 0
256 0 $self->{perror} = 1;
257 0 $self->{error} = 8;
258 0 $self->{errorString} = 'ref for options is "' . ref( $opts{options} ) . '" and not HASH';
259 0 $self->warn;
260 }
261 0 $self->{options} = $opts{options};
262 }
263  
264 0 return $self;
265 } ## end sub new
266  
267 =head2 init
268  
269 Initiates the backend.
270  
271 No arguments are taken.
272  
273 $backend->init;
274  
275 =cut
276  
277 sub init {
278 0 ▶ my ( $self, %opts ) = @_;
Subroutine init: not called CC=3 SCAR=24.8
Pod documented
279  
280 0 $self->errorblank;
281  
282 0 ▶ if ( $self->{inited} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"inited"}) 0 0 0
283 0 $self->{error} = 18;
284 0 $self->{errorString} = 'backend has already been inited';
285 0 $self->warn;
286 }
287  
288 0 ▶ if ( $self->{testing} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"testing"}) 0 0 0
289 0 $self->{frontend_obj}->{test_data} = 'inited';
290 }
291  
292 0 $self->{inited} = 1;
293 } ## end sub init
294  
295 =head2 ban
296  
297 Bans the IP.
298  
299 $backend->ban(ban => $ip);
300  
301 =cut
302  
303 sub ban {
304 0 ▶ my ( $self, %opts ) = @_;
Subroutine ban: not called CC=6 SCAR=37.4
Pod documented
305  
306 0 $self->errorblank;
307  
308 0 ▶ if ( !$self->{inited} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"inited"}) 0 0 0
309 0 $self->{error} = 1;
310 0 $self->{errorString} = 'backend has not been inited';
311 0 $self->warn;
312 0 return;
313 }
314  
315 0 ▶ if ( !defined( $opts{ban} ) ) {
Branch: 3 branches
BranchTrueFalseTotal
if (not defined $opts{'ban'}) { } 0 0 0
elsif (ref $opts{'ban'} ne '') { } 0 0 0
elsif (not $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv4_re/ || $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv6_re/) { } 0 0 0
316 0 $self->{error} = 9;
317 0 $self->{errorString} = 'Nothing specified for the value ban';
318 0 $self->warn;
319 0 return;
320 } elsif ( ref( $opts{ban} ) ne '' ) {
321 0 $self->{error} = 10;
322 0 $self->{errorString} = 'Bad ref type for ban... ref is "' . ref( $opts{ban} ) . '"';
323 0 $self->warn;
324 0 return;
325 ▶ } elsif ( $opts{ban} !~ /$IPv4_re/
Condition0%0/3
$opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv4_re/ || $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv6_re/
l!l&&r!l&&!r
000
MC/DC0%0/2
$opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv4_re/ || $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv6_re/
$opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv4_re/ $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv6_re/
Truth table0%0/3
A || B
A= $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv4_re/B= $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv6_re/
ABresult
1X1
011
000
326 && $opts{ban} !~ /$IPv6_re/ )
327 {
328 0 $self->{error} = 10;
329 0 $self->{errorString} = 'ban item,"' . $opts{ban} . '", does not appear to be a IPv4 or IPv6 IP';
330 0 $self->warn;
331 0 return;
332 }
333  
334 0 $self->{frontend_obj}->{test_data} = 'banned ' . $opts{ban};
335  
336 0 $self->{banned}{ $opts{ban} } = 1;
337 } ## end sub ban
338  
339 =head2 unban
340  
341 Unbans the an IP.
342  
343 $backend->ban(ban => $ip);
344  
345 =cut
346  
347 sub unban {
348 0 ▶ my ( $self, %opts ) = @_;
Subroutine unban: not called CC=6 SCAR=37.4
Pod documented
349  
350 0 $self->errorblank;
351  
352 0 ▶ if ( !$self->{inited} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"inited"}) 0 0 0
353 0 $self->{error} = 1;
354 0 $self->{errorString} = 'backend has not been inited';
355 0 $self->warn;
356 0 return;
357 }
358  
359 0 ▶ if ( !defined( $opts{ban} ) ) {
Branch: 3 branches
BranchTrueFalseTotal
if (not defined $opts{'ban'}) { } 0 0 0
elsif (ref $opts{'ban'} ne '') { } 0 0 0
elsif (not $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv4_re/ || $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv6_re/) { } 0 0 0
360 0 $self->{error} = 9;
361 0 $self->{errorString} = 'Nothing specified for the value ban';
362 0 $self->warn;
363 0 return;
364 } elsif ( ref( $opts{ban} ) ne '' ) {
365 0 $self->{error} = 10;
366 0 $self->{errorString} = 'Bad ref type for ban... ref is "' . ref( $opts{ban} ) . '"';
367 0 $self->warn;
368 0 return;
369 ▶ } elsif ( $opts{ban} !~ /$IPv4_re/
Condition0%0/3
$opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv4_re/ || $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv6_re/
l!l&&r!l&&!r
000
MC/DC0%0/2
$opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv4_re/ || $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv6_re/
$opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv4_re/ $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv6_re/
Truth table0%0/3
A || B
A= $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv4_re/B= $opts{'ban'} =~ /$Net::Firewall::BlockerHelper::backends::dummy::IPv6_re/
ABresult
1X1
011
000
370 && $opts{ban} !~ /$IPv6_re/ )
371 {
372 0 $self->{error} = 10;
373 0 $self->{errorString} = 'ban item,"' . $opts{ban} . '", does not appear to be a IPv4 or IPv6 IP';
374 0 $self->warn;
375 0 return;
376 }
377  
378 0 $self->{frontend_obj}->{test_data} = 'unbanned ' . $opts{ban};
379  
380 0 delete( $self->{banned}{ $opts{ban} } );
381 } ## end sub unban
382  
383 =head2 list
384  
385 List banned IPs.
386  
387 my @banned = $backend->list;
388  
389 =cut
390  
391 sub list {
392 0 ▶ my ( $self, %opts ) = @_;
Subroutine list: not called CC=1 SCAR=6.9
Pod documented
393  
394 0 $self->errorblank;
395  
396 0 $self->{frontend_obj}->{test_data} = 'list';
397  
398 0 return keys( %{ $self->{banned} } );
399 }
400  
401 =head2 re_init
402  
403 Tells the backend to re-init it's self.
404  
405 =cut
406  
407 sub re_init {
408 0 ▶ my ( $self, %opts ) = @_;
Subroutine re_init: not called CC=1 SCAR=6.9
Pod documented
409  
410 0 $self->errorblank;
411  
412 0 $self->{frontend_obj}->{test_data} = 're_inited';
413  
414 0 $self->{inited} = 1;
415 }
416  
417 =head2 teardown
418  
419 Tears down the setup for the backend.
420  
421 $backend->teardown;
422  
423 =cut
424  
425 sub teardown {
426 0 ▶ my ( $self, %opts ) = @_;
Subroutine teardown: not called CC=1 SCAR=6.9
Pod documented
427  
428 0 $self->{inited} = 0,
429  
430 $self->errorblank;
431  
432 0 $self->{frontend_obj}->{test_data} = 'toredown';
433  
434 0 $self->{inited} = 0;
435 } ## end sub teardown
436  
437 =head1 ERROR CODES / FLAGS
438  
439 Error handling is provided by L<Error::Helper>. All
440 errors are considered fatal.
441  
442 =head2 1, notInited
443  
444 Backend has not been initted yet.
445  
446 =head2 2, invalidPortSpecified
447  
448 Port is either not a positive int or a name that can be resolved by getservbyname.
449  
450 =head2 3, portsNotArray
451  
452 The data passed to new for ports is not an array.
453  
454 =head2 4, protocolsNotArray
455  
456 The data passed to new for protocols is not an array.
457  
458 =head2 5, invalidPortSpecified
459  
460 Port is either not a positive int or a name that can be resolved by getservbyname.
461  
462 =head2 6, invalidPrefixSpecified
463  
464 The specified prefix did not match /^[a-zA-Z0-9]+$/.
465  
466 =head2 7, invalidName
467  
468 The name is either undef or does not match /^[a-zA-Z0-9\-]+$/.
469  
470 =head2 8, optionsNotHash
471  
472 The item passed to new for options is not a hash.
473  
474 =head2 9, noBanItem
475  
476 No IP specified to ban.
477  
478 =head2 10, banItemNotIP
479  
480 The item to ban is not an IP. Either wrong ref type or regexp
481 test using L<Regexp::IPv4> and L<Regexp::IPv6> failed.
482  
483 =head2 11, invalidBackend
484  
485 The specified backend failed to pass a basic sanity check of making sure it
486 matches the regexp /^[a-zA-Z0-9\_]+$/.
487  
488 =head2 12, backendInitError
489  
490 Failed to init the backend.
491  
492 =head2 13, banFailed
493  
494 Failed to ban the item.
495  
496 =head2 14, unbanFailed
497  
498 Failed to unban the item.
499  
500 =head2 15, listFailed
501  
502 Failed get a list of bans.
503  
504 =head2 16, reInitFailed
505  
506 Failed to re_init the backend.
507  
508 =head2 17, teardownFailed
509  
510 Failed to teardown the backend.
511  
512 =head2 18, alreadyInited
513  
514 Backend has already been initiated.
515  
516 =head1 AUTHOR
517  
518 Zane C. Bowers-Hadley, C<< <vvelox at vvelox.ent> >>
519  
520 =head1 BUGS
521  
522 Please report any bugs or feature requests to C<bug-net-firewall-blockerhelper at rt.cpan.org>, or through
523 the web interface at L<https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Firewall-BlockerHelper>. I will be notified, and then you'll
524 automatically be notified of progress on your bug as I make changes.
525  
526  
527  
528  
529 =head1 SUPPORT
530  
531 You can find documentation for this module with the perldoc command.
532  
533 perldoc Net::Firewall::BlockerHelper
534  
535  
536 You can also look for information at:
537  
538 =over 4
539  
540 =item * RT: CPAN's request tracker (report bugs here)
541  
542 L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Firewall-BlockerHelper>
543  
544 =item * Search CPAN
545  
546 L<https://metacpan.org/release/Net-Firewall-BlockerHelper>
547  
548 =back
549  
550  
551 =head1 ACKNOWLEDGEMENTS
552  
553  
554 =head1 LICENSE AND COPYRIGHT
555  
556 This software is Copyright (c) 2023 by Zane C. Bowers-Hadley.
557  
558 This is free software, licensed under:
559  
560 The GNU Lesser General Public License, Version 2.1, February 1999
561  
562  
563 =cut
564  
565 1 1; # End of Net::Firewall::BlockerHelper
« BlockerHelper/backends/ipfw.pm ↑ Summary BlockerHelper/backends/pf.pm »