37 |
$atom->{values}{$regex} = $2; |
$atom->{values}{$regex} = $2; |
38 |
} |
} |
39 |
} |
} |
40 |
foreach my $regex ('in|out', 'log', 'pass|block', 'quick', 'keep state', 'all') { |
foreach my $regex ('in|out', 'log', 'pass|block|antispoof|scrub', 'quick', 'keep state', 'all') { |
41 |
if ($in =~ s/\s*($regex)//) { |
if ($in =~ s/\s*($regex)//) { |
42 |
$atom->{type} = 'VALUES_LIST'; |
$atom->{type} = 'VALUES_LIST'; |
43 |
$atom->{type2} = 'PF_RULE'; |
$atom->{type2} = 'PF_RULE'; |
45 |
push @{$atom->{list}}, $1; |
push @{$atom->{list}}, $1; |
46 |
} |
} |
47 |
} |
} |
48 |
if ($in =~ s/\s*port\s+(\S+)\s+(\S+)//) { |
if ($in =~ s/\s*port\s+{(.*)}//) { |
49 |
|
$atom->{type} = 'VALUES_LIST'; |
50 |
|
$atom->{type2} = 'PF_RULE'; |
51 |
|
@{$atom->{port}} = split(/\s*,\s*/, $1); |
52 |
|
} |
53 |
|
elsif ($in =~ s/\s*port\s+(\S+)\s+(\S+)//) { |
54 |
$atom->{type} = 'VALUES'; |
$atom->{type} = 'VALUES'; |
55 |
$atom->{type2} = 'PF_RULE'; |
$atom->{type2} = 'PF_RULE'; |
56 |
$atom->{values}{port} = $2; |
$atom->{values}{port} = $2; |