line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id$ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# system::freebsd::pf Brik |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
package Metabrik::System::Freebsd::Pf; |
7
|
1
|
|
|
1
|
|
835
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
8
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use base qw(Metabrik::Shell::Command); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
229
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub brik_properties { |
13
|
|
|
|
|
|
|
return { |
14
|
0
|
|
|
0
|
1
|
|
revision => '$Revision$', |
15
|
|
|
|
|
|
|
tags => [ qw(unstable packet filter fw firewall) ], |
16
|
|
|
|
|
|
|
author => 'GomoR ', |
17
|
|
|
|
|
|
|
license => 'http://opensource.org/licenses/BSD-3-Clause', |
18
|
|
|
|
|
|
|
commands => { |
19
|
|
|
|
|
|
|
edit => [ ], |
20
|
|
|
|
|
|
|
reload => [ ], |
21
|
|
|
|
|
|
|
console => [ qw(jail_name) ], |
22
|
|
|
|
|
|
|
}, |
23
|
|
|
|
|
|
|
require_binaries => { |
24
|
|
|
|
|
|
|
'pfctl' => [ ], |
25
|
|
|
|
|
|
|
}, |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub edit { |
30
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my $cmd = "sudo vi /etc/pf.conf"; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return $self->execute($cmd); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub reload { |
38
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my $cmd = "sudo pfctl -f /etc/pf.conf"; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
return $self->system($cmd); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |