jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [networks/] [platform/] [common.pm] - Blame information for rev 23

 

Line No. Rev Author Line
11simandlpackage HotSaNICmod::common;
2 
3sub version {
4 ($VERSION = '$Revision: 1.6 $') =~ s/.*(\d+\.\d+).*/$1/;
5 return "common.pm $VERSION";
6 }
7 
8sub configure {
9 my %MODCONF=HotSaNICparser::get_moduleconfig(".",(IPTABLES=>"var",INTIF=>"var",EXTIF=>"var",DEVINT=>"array",DEVEXT=>"array",STYLE=>"var"));
10 if ($MODCONF{IPTABLES} eq "") { $MODCONF{IPTABLES}=get_netfilter(); }
11 if ($MODCONF{STYLE} ne "") { $MODCONF{GRAPH_BASE}=$MODCONF{STYLE}; }
12 (my $extif=$MODCONF{EXTIF}) =~ s/,/ /g;
13 (my $intif=$MODCONF{INTIF}) =~ s/,/ /g;
14 foreach (@{$MODCONF{DEVEXT}}) { push @{$MODCONF{DEV}},"ext,$extif,$_"; }
15 foreach (@{$MODCONF{DEVINT}}) { push @{$MODCONF{DEV}},"int,$intif,$_"; }
16 return %MODCONF;
17 }
18 
19sub get_netfilter {
20 my @list=grep /iptables$/,HotSaNICparser::locate_files("bin/iptables");
21 if (! @list) { @list=grep /ipchains$/,HotSaNICparser::locate_files("bin/ipchains"); }
22 my $CMD=shift @list;
23 return $CMD;
24 }
25 
26sub get_names {
27 my $entry=shift || ",";
28 
29 my $host="";
30 my $community="";
31 
32 my ($side,$interfaces,$item,$description)=split /,/,$entry;
33 $name=$item;
34 ($dbname="$side$name") =~ s/\//_/g;
35 $file=$dbname;
36 
37 return ($host,$community,$item,$dbname,$name,$file,$description);
38 }
391;
40 

Powered by WebSVN 2.2.1