/[libconf]/libconf/perl-Libconf/templates/pf_template.pm
ViewVC logotype

Diff of /libconf/perl-Libconf/templates/pf_template.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by logarno, Wed Apr 30 21:15:41 2003 UTC revision 1.4 by logarno, Thu May 1 20:34:51 2003 UTC
# Line 30  package Libconf; Line 30  package Libconf;
30  $templates{pf} = {  $templates{pf} = {
31                             rules => [                             rules => [
32                                       q(                                       q(
33                                         foreach my $regex (qw(from to proto on)) {                                         foreach my $regex ('proto', 'on') {
34                                             if ($in =~ s/\s*($regex)\s+(\S*)//) {                                             if ($in =~ s/\s*$regex\s+(\S*)//) {
35                                                 $atom->{type} = 'VALUES_LIST';                                                 $atom->{type} = 'VALUES_LIST';
36                                                 $atom->{type2} = 'PF_RULE';                                                 $atom->{type2} = 'PF_RULE';
37                                                 $atom->{values}{$regex} = $2;                                                 push @{$atom->{list}}, {$regex => $1};
38                                             }                                             }
39                                         }                                         }
40                                         foreach my $regex ('in|out', 'log', 'pass|block|antispoof|scrub', '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';
                                                $atom->{list} ||= [];  
44                                                 push @{$atom->{list}}, $1;                                                 push @{$atom->{list}}, $1;
45                                             }                                             }
46                                         }                                         }
47                                         if ($in =~ s/\s*port\s+{(.*)}//) {                                         foreach my $regex ('from', 'to') {
48                                             $atom->{type} = 'VALUES_LIST';                                           $atom->{type} = 'VALUES_LIST';
49                                             $atom->{type2} = 'PF_RULE';                                           $atom->{type2} = 'PF_RULE';
50                                             @{$atom->{port}} = split(/\s*,\s*/, $1);                                           if ($in =~ s/\s*$regex\s+(\S*)\s+port\s+{(.*)}//) {
51                                         }                                             push @{$atom->{list}}, {$regex => $1, port => [split(/\s*,\s*/, $2)]};
52                                         elsif ($in =~ s/\s*port\s+(\S+)\s+(\S+)//) {                                           }
53                                             $atom->{type} = 'VALUES';                                           elsif ($in =~ s/\s*$regex\s+(\S*)\s+port\s+(\S+)\s+(\S+)//) {
54                                             $atom->{type2} = 'PF_RULE';                                             push @{$atom->{list}}, {$regex => $1, port => {port => $3, cmp => $2}};
55                                             $atom->{values}{port} = $2;                                           }
56                                             $atom->{values}{cmp} = $1;                                           elsif ($in =~ s/\s*$regex\s+(\S*)//) {
57                                         }                                             push @{$atom->{list}}, {$regex => $1};
58                                             }
59                                            }
60                                         )                                         )
61                                       ],                                       ],
62                             comments => [ ['#'] ],                             comments => [ ['#'] ],

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26