31 |
rules => [ |
rules => [ |
32 |
q( |
q( |
33 |
foreach my $regex (qw(from to proto on)) { |
foreach my $regex (qw(from to proto on)) { |
34 |
if ($in =~ s/^.*($regex)\s+(\S*)//) { |
if ($in =~ s/\s*($regex)\s+(\S*)//) { |
35 |
$atom->{$regex} = $2; |
$atom->{type} = 'VALUES_LIST'; |
36 |
} |
$atom->{type2} = 'PF_RULE'; |
37 |
|
$atom->{values}{$regex} = $2; |
38 |
} |
} |
39 |
foreach my $regex (qw(in|out log pass|block quick)) { |
} |
40 |
if ($in =~ s/^.*\s+($regex)\s+.*$//) { |
foreach my $regex ('in|out', 'log', 'pass|block', 'quick', 'keep state', 'all') { |
41 |
$atom->{$regex} = $1; |
if ($in =~ s/\s*($regex)//) { |
42 |
|
$atom->{type} = 'VALUES_LIST'; |
43 |
|
$atom->{type2} = 'PF_RULE'; |
44 |
|
$atom->{list} ||= []; |
45 |
|
push @{$atom->{list}}, $1; |
46 |
} |
} |
47 |
} |
} |
48 |
if ($in =~ s/^.*port\s+?(\.*?)\s+?(\.*?)\s*.*$//) { |
if ($in =~ s/\s*port\s+(\S+)\s+(\S+)//) { |
49 |
$atom->{port} = $2; |
$atom->{type} = 'VALUES'; |
50 |
$atom->{cmp} = $1; |
$atom->{type2} = 'PF_RULE'; |
51 |
|
$atom->{values}{port} = $2; |
52 |
|
$atom->{values}{cmp} = $1; |
53 |
} |
} |
54 |
) |
) |
55 |
], |
], |