root/5100R/branches/DEV_OpenRaQ/ui/base-firewall.mod/glue/handlers/flag_changes

Revision 764, 1.0 kB (checked in by shibuya, 4 years ago)

build for 5100R.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 #!/usr/bin/perl
2 #
3 # $Id$
4
5 use lib qw( /usr/sausalito/perl );
6 use CCE;
7 $cce = new CCE;
8 $cce->connectfd(\*STDIN,\*STDOUT);
9
10 my $oid = $cce->event_oid();
11 my $obj = $cce->event_object();
12 if ($obj->{'CLASS'} eq 'FirewallRule') {
13   if ( $obj->{'source_ports'} || $obj->{'dest_ports'} ) {
14     if ( ($obj->{'protocol'} eq "ipip") ) {
15       $cce->warn("[[base-firewall.ipip-rule-cannot-have-ports]]");
16       $cce->bye("FAIL");
17       exit(1);
18     }
19     if ( ($obj->{'protocol'} eq 'encap') ) {
20         $cce->warn("[[base-firewall.encap-rule-cannot-have-ports]]");
21         $cce->bye("FAIL");
22         exit(1);
23     }
24     if ( ($obj->{'protocol'} eq 'gre') || ($obj->{'protocol'} eq 'esp') || ($obj->{'protocol'} eq 'ah') ||($obj->{'protocol'} eq 'all') ) {
25         $cce->warn("[[base-firewall." . $obj->{'protocol'} . "-rule-cannot-have-ports]]");
26         $cce->bye("FAIL");
27         exit(1);
28     }
29
30   }
31 }
32
33 {
34   my (@oids) = $cce->find("System");
35   $cce->set($oids[0], "Firewall", { 'dirty' => 1 });
36 }
37
38 $cce->bye('SUCCESS');
39 exit(0);
Note: See TracBrowser for help on using the browser.