| 1 | package Parser::IPTables::Save; | ||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Carp qw/ croak /; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Tie::File; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||
| 10 | =head1 NAME | ||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||
| 12 | Parser::IPTables::Save - A parser for iptables-save output files. | ||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||
| 14 | =head1 VERSION | ||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||
| 16 | Version 0.04 | ||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||
| 18 | =cut | ||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||
| 20 | 1 | our $VERSION = '0.04'; | |||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||
| 23 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||
| 25 | Quick summary of what the module does. | ||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||
| 27 | Perhaps a little code snippet. | ||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||
| 29 | use Parser::IPTables::Save; | ||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||
| 31 | my $iptables_save = Parser::IPTables::Save->new('/tmp/iptables.out'); | ||||||||||||||||||||||||||||||||||
| 32 | $iptables_save->table('filter'); | ||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||
| 34 | $iptables_save->create({ chain => 'POSTROUTING', source => '192.168.1.0/24', target => 'MASQUERADE', comment => 'Rule to masquerade' }); | ||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||
| 36 | $iptables_save->move(3, -1); | ||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||
| 38 | $iptables_save->delete(8); | ||||||||||||||||||||||||||||||||||
| 39 | $iptables_save->delete(9); | ||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||
| 41 | my @rules = $iptables_save->fetch_rules(); | ||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||
| 43 | $iptables_save->disable(10); | ||||||||||||||||||||||||||||||||||
| 44 | $iptables_save->enable(10); | ||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||
| 46 | $iptables_save->save(); | ||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||
| 49 | =head1 METHODS | ||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||
| 51 | =head2 create | ||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||
| 53 | Create a new rule | ||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||
| 55 | $iptables_save->create({ chain => 'POSTROUTING', source => '192.168.1.0/24', target => 'MASQUERADE', comment => 'Rule to masquerade' }); | ||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||
| 57 | =cut | ||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | sub create { | ||||||||||||||||||||||||||||||||
|
Subroutine
create: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 60 | 0 | my($self, $rule, $index) = @_; | |||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||
| 62 | 0 | ▶ | if($index) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 63 | # replace | ||||||||||||||||||||||||||||||||||
| 64 | 0 | splice(@{ $self->{rules}}, $index, 0, ($rule)); | |||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||
| 66 | else { | ||||||||||||||||||||||||||||||||||
| 67 | 0 | unshift(@{ $self->{rules} }, $rule); | |||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||
| 72 | =head2 delete | ||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||
| 74 | Delete a rule | ||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||
| 76 | $iptables_save->delete(8); | ||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||
| 78 | =cut | ||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | sub delete { | ||||||||||||||||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||
| 82 | 0 | my($self, $index) = @_; | |||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||
| 84 | 0 | delete @{ $self->{rules}}[$index]; | |||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||
| 88 | =head2 disable | ||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||
| 90 | disable a rule | ||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||
| 92 | # disable rule with index 5 | ||||||||||||||||||||||||||||||||||
| 93 | $iptables_save->disable(5); | ||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||
| 95 | =cut | ||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||
| 97 | 0 | ▶ | sub disable { | ||||||||||||||||||||||||||||||||
|
Subroutine
disable: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||
| 99 | 0 | my($self, $index) = @_; | |||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||
| 101 | 0 | @{ $self->{rules}}[$index]->{disabled} = 1; | |||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||
| 103 | 0 | return; | |||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||
| 108 | =head2 enable | ||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||
| 110 | enable a rule | ||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||
| 112 | # enable a rule previously disabled | ||||||||||||||||||||||||||||||||||
| 113 | $iptables_save->enable(5); | ||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||
| 115 | =cut | ||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||
| 117 | 0 | ▶ | sub enable { | ||||||||||||||||||||||||||||||||
|
Subroutine
enable: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||
| 119 | 0 | my($self, $index) = @_; | |||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||
| 121 | 0 | @{ $self->{rules}}[$index]->{disabled} = 0; | |||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||
| 123 | 0 | return; | |||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||
| 128 | =head2 new | ||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||
| 130 | =cut | ||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||
| 132 | 1 | ▶ | sub new { | ||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=5 SCAR=18.3
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||
| 134 | 1 | my($proto, $iptables_save_file) = @_; | |||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | unless( $proto && defined($iptables_save_file) ) { croak "Parser::IPTables::Save->new(): usage error"; } | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$proto and defined $iptables_save_file
MC/DC0%0/2
$proto and defined $iptables_save_file
$proto
defined $iptables_save_file
Truth table33%1/3
A and B
A= $protoB= defined $iptables_save_file
| |||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||
| 138 | 1 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||
| 140 | 1 | my $self = {}; | |||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||
| 142 | # open iptables-save output file | ||||||||||||||||||||||||||||||||||
| 143 | 1 | ▶ | tie my @file_array, 'Tie::File', $iptables_save_file or croak("Error opening file $iptables_save_file $!"); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||
| 145 | 1 | $self->{file_array} = \@file_array; | |||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||
| 147 | 1 | bless($self, $class); | |||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||
| 149 | 1 | return $self; | |||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||
| 154 | =head2 table | ||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||
| 156 | Set table name | ||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||
| 158 | $iptables_save->table('filter'); | ||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||
| 160 | =cut | ||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||
| 162 | 1 | ▶ | sub table { | ||||||||||||||||||||||||||||||||
|
Subroutine
table: called CC=36 SCAR=43.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||
| 164 | 1 | my($self, $table_name) = @_; | |||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||
| 166 | # set table name | ||||||||||||||||||||||||||||||||||
| 167 | 1 | $self->{table_name} = $table_name; | |||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||
| 169 | 1 | my $get_lines = 0; | |||||||||||||||||||||||||||||||||
| 170 | 1 | my @rules; | |||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||
| 172 | # set line of | ||||||||||||||||||||||||||||||||||
| 173 | 1 | my $i = 0; | |||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||
| 175 | 1 | foreach my $line (@{ $self->{file_array} }) { | |||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||
| 177 | 7 | ▶ | if($line eq '*'.$self->{table_name}) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 178 | 1 | $get_lines = 1; | |||||||||||||||||||||||||||||||||
| 179 | 1 | $self->{initial_line} = ($i + 1); | |||||||||||||||||||||||||||||||||
| 180 | 1 | next; | |||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||
| 183 | # packet counters | ||||||||||||||||||||||||||||||||||
| 184 | 6 | ▶ | if($get_lines == 1 && substr($line, 0, 1) eq ':') { | ||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
$get_lines == 1 and substr($line, 0, 1) eq ":"
MC/DC100%2/2
$get_lines == 1 and substr($line, 0, 1) eq ":"
$get_lines == 1
substr($line, 0, 1) eq ":"
Truth table100%3/3
A and B
A= $get_lines == 1B= substr($line, 0, 1) eq ":"
| |||||||||||||||||||||||||||||||||||
| 185 | 3 | $self->{initial_line}++; | |||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||
| 187 | ▶ | elsif($get_lines == 1 && (substr($line, 0, 2) eq '-A' || substr($line, 0, 3) eq '#-A')) { | |||||||||||||||||||||||||||||||||
|
Condition83%5/6
$get_lines == 1 and substr($line, 0, 2) eq "-A" || substr($line, 0, 3) eq "#-A"
substr($line, 0, 2) eq "-A" or substr($line, 0, 3) eq "#-A"
MC/DC66%2/3
$get_lines == 1 and substr($line, 0, 2) eq "-A" || substr($line, 0, 3) eq "#-A"
$get_lines == 1
substr($line, 0, 2) eq "-A"
substr($line, 0, 3) eq "#-A"
Truth table75%3/4
A and B or C
A= $get_lines == 1B= substr($line, 0, 2) eq "-A"C= substr($line, 0, 3) eq "#-A"
| |||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||
| 189 | 1 | my $rule = {}; | |||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||
| 191 | # if rule is disabled | ||||||||||||||||||||||||||||||||||
| 192 | 1 | ▶ | $rule->{disabled} = 1 if(substr($line, 0, 1) eq '#'); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||
| 194 | # chain | ||||||||||||||||||||||||||||||||||
| 195 | 1 | ▶ | $rule->{chain} = $1 if($line =~ /-A\s+([\w]+)/g); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||
| 197 | # protocol | ||||||||||||||||||||||||||||||||||
| 198 | 1 | ▶ | if($line =~ /-p\s+([\!\w\d]+)/g) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 199 | 1 | $rule->{proto} = $1; | |||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||||
| 201 | # when get only ! character | ||||||||||||||||||||||||||||||||||
| 202 | 1 | ▶ | if($rule->{proto} =~ /^\!$/) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 203 | 0 | ▶ | $rule->{proto} = '! '.$1 if($line =~ /-p\s+\!\s+([\!\w\d]+)/); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||
| 207 | # module | ||||||||||||||||||||||||||||||||||
| 208 | 1 | my @modules; | |||||||||||||||||||||||||||||||||
| 209 | 1 | ▶ | while($line =~ /-m\s+([\w\d]+)/g) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 210 | 1 | push(@modules, $1); | |||||||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||||||||
| 212 | 1 | $rule->{module} = \@modules; | |||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||
| 214 | # source | ||||||||||||||||||||||||||||||||||
| 215 | 1 | ▶ | if($line =~ /-s\s+([\w\d\!\-\.\/]+)/g) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 216 | 1 | $rule->{source} = $1; | |||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||
| 218 | # when get only ! character | ||||||||||||||||||||||||||||||||||
| 219 | 1 | ▶ | if($rule->{source} =~ /^\!$/) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | $rule->{source} = '! '.$1 if($line =~ /-s\s+\!\s+([\w\d\!\-\.\/]+)/); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||
| 224 | # destination | ||||||||||||||||||||||||||||||||||
| 225 | 1 | ▶ | if($line =~ /-d\s+([\w\d\!\-\.\/]+)/g) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 226 | 1 | $rule->{destination} = $1; | |||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||||
| 228 | # when get only ! character | ||||||||||||||||||||||||||||||||||
| 229 | 1 | ▶ | if($rule->{destination} =~ /^\!$/) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 230 | 1 | ▶ | $rule->{destination} = '! '.$1 if($line =~ /-d\s+\!\s+([\w\d\!\-\.\/]+)/); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||
| 232 | } | ||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||
| 234 | # state | ||||||||||||||||||||||||||||||||||
| 235 | 1 | ▶ | if($line =~ /--state\s+(\w+)/g) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 236 | 0 | $rule->{state} = $1; | |||||||||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||||
| 239 | # source port | ||||||||||||||||||||||||||||||||||
| 240 | 1 | ▶ | if($line =~ /--sport\s+([\w\:]+)/g) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 241 | 0 | $rule->{port_source} = $1; | |||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||||
| 243 | # when get only ! character | ||||||||||||||||||||||||||||||||||
| 244 | 0 | ▶ | if($rule->{port_source} =~ /^\!$/) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 245 | 0 | ▶ | $rule->{port_source} = '! '.$1 if($line =~ /-d\s+\!\s+([\w\:]+)/); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||||||||
| 247 | } | ||||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||||
| 249 | # destination port | ||||||||||||||||||||||||||||||||||
| 250 | 1 | ▶ | if($line =~ /--dport\s+([\w\:]+)/g) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 251 | 1 | $rule->{port_destination} = $1; | |||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||
| 253 | # when get only ! character | ||||||||||||||||||||||||||||||||||
| 254 | 1 | ▶ | if($rule->{port_destination} =~ /^\!$/) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 255 | 0 | ▶ | $rule->{port_destination} = '! '.$1 if($line =~ /-d\s+\!\s+([\w\:]+)/); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 256 | } | ||||||||||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||||||||
| 260 | # target | ||||||||||||||||||||||||||||||||||
| 261 | 1 | ▶ | $rule->{target} = $1 if($line =~ /-j\s+([\w]+)/); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||||||||
| 263 | # target param1 | ||||||||||||||||||||||||||||||||||
| 264 | 1 | ▶ | $rule->{target_param1} = $2 if($line =~ /-j\s+(.*?)\s+([\w\-]*)/); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||
| 266 | # target param2 | ||||||||||||||||||||||||||||||||||
| 267 | 1 | ▶ | $rule->{target_param2} = $3 if($line =~ /-j\s+(.*?)\s+([\w\-]*)\s+([\w\-\.\:]*)/); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 268 | |||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||
| 270 | # prevent target_param1 and targer_param2 from get --comment | ||||||||||||||||||||||||||||||||||
| 271 | 1 | ▶ | if($rule->{target_param1} && $rule->{target_param1} eq '--comment') { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$rule->{"target_param1"} and $rule->{"target_param1"} eq "--comment"
MC/DC0%0/2
$rule->{"target_param1"} and $rule->{"target_param1"} eq "--comment"
$rule->{"target_param1"}
$rule->{"target_param1"} eq "--comment"
Truth table33%1/3
A and B
A= $rule->{"target_param1"}B= $rule->{"target_param1"} eq "--comment"
| |||||||||||||||||||||||||||||||||||
| 272 | 0 | $rule->{target_param1} = ''; | |||||||||||||||||||||||||||||||||
| 273 | 0 | $rule->{target_param2} = ''; | |||||||||||||||||||||||||||||||||
| 274 | } | ||||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||||
| 276 | |||||||||||||||||||||||||||||||||||
| 277 | # comment | ||||||||||||||||||||||||||||||||||
| 278 | 1 | ▶ | $rule->{comment} = $1 if($line =~ /--comment\s+\"(.*)\"/); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||
| 281 | 1 | push(@rules, $rule); | |||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||||
| 283 | } | ||||||||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||||||||
| 285 | 6 | ▶ | last if($get_lines == 1 && $line eq 'COMMIT'); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$get_lines == 1 and $line eq "COMMIT"
MC/DC100%2/2
$get_lines == 1 and $line eq "COMMIT"
$get_lines == 1
$line eq "COMMIT"
Truth table100%3/3
A and B
A= $get_lines == 1B= $line eq "COMMIT"
| |||||||||||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||||||||
| 287 | 5 | $i++; | |||||||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||||||||
| 289 | } | ||||||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||||||
| 291 | # number of rules | ||||||||||||||||||||||||||||||||||
| 292 | 1 | $self->{number_of_rules} = @rules; | |||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||
| 294 | # save rules on object | ||||||||||||||||||||||||||||||||||
| 295 | 1 | $self->{rules} = \@rules; | |||||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||||||
| 297 | 1 | ▶ | return $self->{table_name} if($self->{table_name}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||||||||
| 299 | 0 | return 0; | |||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||||||||
| 304 | =head2 fetch_rules | ||||||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||||
| 306 | =cut | ||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||
| 308 | 0 | ▶ | sub fetch_rules { | ||||||||||||||||||||||||||||||||
|
Subroutine
fetch_rules: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||||||||
| 310 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 311 | |||||||||||||||||||||||||||||||||||
| 312 | 0 | ▶ | croak("You need set a table name: \$obj->table('tablename');") if(! $self->{table_name}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 313 | |||||||||||||||||||||||||||||||||||
| 314 | # set index foreach row | ||||||||||||||||||||||||||||||||||
| 315 | 0 | my @trules; | |||||||||||||||||||||||||||||||||
| 316 | 0 | my $i = 0; | |||||||||||||||||||||||||||||||||
| 317 | 0 | foreach my $row (@{ $self->{rules} }) { | |||||||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||||||||
| 319 | 0 | $row->{id} = $i; | |||||||||||||||||||||||||||||||||
| 320 | 0 | $i++; | |||||||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||||||||
| 322 | 0 | push(@trules, $row); | |||||||||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||||||||
| 324 | } | ||||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||||
| 326 | # save trules on object | ||||||||||||||||||||||||||||||||||
| 327 | 0 | $self->{rules} = \@trules; | |||||||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||||||
| 329 | # if wants a array | ||||||||||||||||||||||||||||||||||
| 330 | 0 | ▶ | return @{ $self->{rules} } if wantarray(); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||||||
| 332 | # if wants a arrayref | ||||||||||||||||||||||||||||||||||
| 333 | 0 | return $self->{rules}; | |||||||||||||||||||||||||||||||||
| 334 | |||||||||||||||||||||||||||||||||||
| 335 | } | ||||||||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||||||||
| 338 | =head2 DESTROY | ||||||||||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||||||||
| 340 | =cut | ||||||||||||||||||||||||||||||||||
| 341 | |||||||||||||||||||||||||||||||||||
| 342 | 1 | ▶ | sub DESTROY { | ||||||||||||||||||||||||||||||||
|
Subroutine
DESTROY: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 343 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 344 | 1 | untie $self->{file_array}; | |||||||||||||||||||||||||||||||||
| 345 | } | ||||||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||||||
| 347 | |||||||||||||||||||||||||||||||||||
| 348 | =head2 move | ||||||||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||||||
| 350 | Move rules | ||||||||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||||||||
| 352 | # Move rule of index 1, 3 positions down | ||||||||||||||||||||||||||||||||||
| 353 | $iptables_save->move(1, 3); | ||||||||||||||||||||||||||||||||||
| 354 | |||||||||||||||||||||||||||||||||||
| 355 | =cut | ||||||||||||||||||||||||||||||||||
| 356 | |||||||||||||||||||||||||||||||||||
| 357 | 0 | ▶ | sub move { | ||||||||||||||||||||||||||||||||
|
Subroutine
move: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||||||||
| 359 | 0 | my($self, $index, $move) = @_; | |||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||||
| 361 | # Get rule | ||||||||||||||||||||||||||||||||||
| 362 | 0 | my $rule = @{ $self->{rules}}[$index]; | |||||||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||||||||
| 364 | # Prevent eg: index 0, move -1 | ||||||||||||||||||||||||||||||||||
| 365 | 0 | ▶ | if($move < 0) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 366 | 0 | $move *= -1; | |||||||||||||||||||||||||||||||||
| 367 | 0 | ▶ | return if(($index - $move) < 0); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 368 | } | ||||||||||||||||||||||||||||||||||
| 369 | |||||||||||||||||||||||||||||||||||
| 370 | # delete rule on current position | ||||||||||||||||||||||||||||||||||
| 371 | 0 | delete @{ $self->{rules}}[$index]; | |||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||
| 373 | # prevent erro where $move > 0 | ||||||||||||||||||||||||||||||||||
| 374 | 0 | ▶ | $move++ if($move > 0); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||||||||
| 376 | # replace | ||||||||||||||||||||||||||||||||||
| 377 | 0 | splice(@{ $self->{rules}}, ($index + $move), 0, ($rule)); | |||||||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||||||||
| 379 | } | ||||||||||||||||||||||||||||||||||
| 380 | |||||||||||||||||||||||||||||||||||
| 381 | |||||||||||||||||||||||||||||||||||
| 382 | =head2 save | ||||||||||||||||||||||||||||||||||
| 383 | |||||||||||||||||||||||||||||||||||
| 384 | $iptables_save->save(); | ||||||||||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||||||||
| 386 | =cut | ||||||||||||||||||||||||||||||||||
| 387 | |||||||||||||||||||||||||||||||||||
| 388 | 0 | ▶ | sub save { | ||||||||||||||||||||||||||||||||
|
Subroutine
save: not called CC=17 SCAR=57.2
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 389 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 390 | |||||||||||||||||||||||||||||||||||
| 391 | 0 | my @trules; | |||||||||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||||||||
| 393 | 0 | foreach my $rule (@{ $self->{rules} }) { | |||||||||||||||||||||||||||||||||
| 394 | |||||||||||||||||||||||||||||||||||
| 395 | # if deleted rule | ||||||||||||||||||||||||||||||||||
| 396 | 0 | ▶ | next if(!$rule); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 397 | |||||||||||||||||||||||||||||||||||
| 398 | # Mount rule | ||||||||||||||||||||||||||||||||||
| 399 | 0 | my $str_rule = ''; | |||||||||||||||||||||||||||||||||
| 400 | |||||||||||||||||||||||||||||||||||
| 401 | # if rule is disabled | ||||||||||||||||||||||||||||||||||
| 402 | 0 | ▶ | $str_rule .= '#' if($rule->{disabled}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 403 | |||||||||||||||||||||||||||||||||||
| 404 | # chain | ||||||||||||||||||||||||||||||||||
| 405 | 0 | $str_rule .= '-A '.$rule->{chain}.' '; | |||||||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||||||||
| 407 | # protocol | ||||||||||||||||||||||||||||||||||
| 408 | 0 | ▶ | $str_rule .= '-p '.$rule->{proto}.' ' if($rule->{proto}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 409 | |||||||||||||||||||||||||||||||||||
| 410 | # modules | ||||||||||||||||||||||||||||||||||
| 411 | 0 | foreach my $module (@{ $rule->{module} }) { | |||||||||||||||||||||||||||||||||
| 412 | 0 | $str_rule .= '-m '.$module.' '; | |||||||||||||||||||||||||||||||||
| 413 | } | ||||||||||||||||||||||||||||||||||
| 414 | |||||||||||||||||||||||||||||||||||
| 415 | # interface input | ||||||||||||||||||||||||||||||||||
| 416 | 0 | ▶ | $str_rule .= '-i '.$rule->{iface_input}.' ' if($rule->{iface_input}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 417 | |||||||||||||||||||||||||||||||||||
| 418 | # interface output | ||||||||||||||||||||||||||||||||||
| 419 | 0 | ▶ | $str_rule .= '-o '.$rule->{iface_output}.' ' if($rule->{iface_output}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 420 | |||||||||||||||||||||||||||||||||||
| 421 | # source | ||||||||||||||||||||||||||||||||||
| 422 | 0 | ▶ | $str_rule .= '-s '.$rule->{source}.' ' if($rule->{source}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 423 | |||||||||||||||||||||||||||||||||||
| 424 | # destination | ||||||||||||||||||||||||||||||||||
| 425 | 0 | ▶ | $str_rule .= '-d '.$rule->{destination}.' ' if($rule->{destination}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 426 | |||||||||||||||||||||||||||||||||||
| 427 | # state | ||||||||||||||||||||||||||||||||||
| 428 | 0 | ▶ | $str_rule .= '--state '.$rule->{state}.' ' if($rule->{state}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 429 | |||||||||||||||||||||||||||||||||||
| 430 | # source port | ||||||||||||||||||||||||||||||||||
| 431 | 0 | ▶ | $str_rule .= '--sport '.$rule->{port_source}.' ' if($rule->{port_source}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 432 | |||||||||||||||||||||||||||||||||||
| 433 | # destination port | ||||||||||||||||||||||||||||||||||
| 434 | 0 | ▶ | $str_rule .= '--dport '.$rule->{port_destination}.' ' if($rule->{port_destination}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 435 | |||||||||||||||||||||||||||||||||||
| 436 | # target | ||||||||||||||||||||||||||||||||||
| 437 | 0 | ▶ | $str_rule .= '-j '.$rule->{target}.' ' if($rule->{target}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 438 | |||||||||||||||||||||||||||||||||||
| 439 | # target param1 | ||||||||||||||||||||||||||||||||||
| 440 | 0 | ▶ | $str_rule .= $rule->{target_param1}.' ' if($rule->{target_param1}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 441 | |||||||||||||||||||||||||||||||||||
| 442 | # target param2 | ||||||||||||||||||||||||||||||||||
| 443 | 0 | ▶ | $str_rule .= $rule->{target_param2}.' ' if($rule->{target_param2}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 444 | |||||||||||||||||||||||||||||||||||
| 445 | # comment | ||||||||||||||||||||||||||||||||||
| 446 | 0 | ▶ | $str_rule .= '--comment "'.$rule->{comment}.'" ' if($rule->{comment}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 447 | |||||||||||||||||||||||||||||||||||
| 448 | 0 | push(@trules, $str_rule); | |||||||||||||||||||||||||||||||||
| 449 | } | ||||||||||||||||||||||||||||||||||
| 450 | |||||||||||||||||||||||||||||||||||
| 451 | 0 | splice(@{ $self->{file_array} }, $self->{initial_line}, $self->{number_of_rules}, @trules); | |||||||||||||||||||||||||||||||||
| 452 | |||||||||||||||||||||||||||||||||||
| 453 | } | ||||||||||||||||||||||||||||||||||
| 454 | |||||||||||||||||||||||||||||||||||
| 455 | |||||||||||||||||||||||||||||||||||
| 456 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||
| 457 | |||||||||||||||||||||||||||||||||||
| 458 | Geovanny Junio, C<< <geovannyjs at gmail.com> >> | ||||||||||||||||||||||||||||||||||
| 459 | |||||||||||||||||||||||||||||||||||
| 460 | =head1 BUGS | ||||||||||||||||||||||||||||||||||
| 461 | |||||||||||||||||||||||||||||||||||
| 462 | Please report any bugs or feature requests to C<bug-parser-iptables-save at rt.cpan.org>, or through | ||||||||||||||||||||||||||||||||||
| 463 | the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Parser-IPTables-Save>. I will be notified, and then you'll | ||||||||||||||||||||||||||||||||||
| 464 | automatically be notified of progress on your bug as I make changes. | ||||||||||||||||||||||||||||||||||
| 465 | |||||||||||||||||||||||||||||||||||
| 466 | |||||||||||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||||||||
| 468 | |||||||||||||||||||||||||||||||||||
| 469 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||
| 470 | |||||||||||||||||||||||||||||||||||
| 471 | You can find documentation for this module with the perldoc command. | ||||||||||||||||||||||||||||||||||
| 472 | |||||||||||||||||||||||||||||||||||
| 473 | perldoc Parser::IPTables::Save | ||||||||||||||||||||||||||||||||||
| 474 | |||||||||||||||||||||||||||||||||||
| 475 | |||||||||||||||||||||||||||||||||||
| 476 | You can also look for information at: | ||||||||||||||||||||||||||||||||||
| 477 | |||||||||||||||||||||||||||||||||||
| 478 | =over 4 | ||||||||||||||||||||||||||||||||||
| 479 | |||||||||||||||||||||||||||||||||||
| 480 | =item * RT: CPAN's request tracker | ||||||||||||||||||||||||||||||||||
| 481 | |||||||||||||||||||||||||||||||||||
| 482 | L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Parser-IPTables-Save> | ||||||||||||||||||||||||||||||||||
| 483 | |||||||||||||||||||||||||||||||||||
| 484 | =item * AnnoCPAN: Annotated CPAN documentation | ||||||||||||||||||||||||||||||||||
| 485 | |||||||||||||||||||||||||||||||||||
| 486 | L<http://annocpan.org/dist/Parser-IPTables-Save> | ||||||||||||||||||||||||||||||||||
| 487 | |||||||||||||||||||||||||||||||||||
| 488 | =item * CPAN Ratings | ||||||||||||||||||||||||||||||||||
| 489 | |||||||||||||||||||||||||||||||||||
| 490 | L<http://cpanratings.perl.org/d/Parser-IPTables-Save> | ||||||||||||||||||||||||||||||||||
| 491 | |||||||||||||||||||||||||||||||||||
| 492 | =item * Search CPAN | ||||||||||||||||||||||||||||||||||
| 493 | |||||||||||||||||||||||||||||||||||
| 494 | L<http://search.cpan.org/dist/Parser-IPTables-Save/> | ||||||||||||||||||||||||||||||||||
| 495 | |||||||||||||||||||||||||||||||||||
| 496 | =back | ||||||||||||||||||||||||||||||||||
| 497 | |||||||||||||||||||||||||||||||||||
| 498 | |||||||||||||||||||||||||||||||||||
| 499 | =head1 ACKNOWLEDGEMENTS | ||||||||||||||||||||||||||||||||||
| 500 | |||||||||||||||||||||||||||||||||||
| 501 | |||||||||||||||||||||||||||||||||||
| 502 | =head1 LICENSE AND COPYRIGHT | ||||||||||||||||||||||||||||||||||
| 503 | |||||||||||||||||||||||||||||||||||
| 504 | Copyright 2010 Geovanny Junio. | ||||||||||||||||||||||||||||||||||
| 505 | |||||||||||||||||||||||||||||||||||
| 506 | This program is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||||||||||
| 507 | under the terms of either: the GNU General Public License as published | ||||||||||||||||||||||||||||||||||
| 508 | by the Free Software Foundation; or the Artistic License. | ||||||||||||||||||||||||||||||||||
| 509 | |||||||||||||||||||||||||||||||||||
| 510 | See http://dev.perl.org/licenses/ for more information. | ||||||||||||||||||||||||||||||||||
| 511 | |||||||||||||||||||||||||||||||||||
| 512 | |||||||||||||||||||||||||||||||||||
| 513 | =cut | ||||||||||||||||||||||||||||||||||
| 514 | |||||||||||||||||||||||||||||||||||
| 515 | 1 | 1; # End of Parser::IPTables::Save | |||||||||||||||||||||||||||||||||