summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-02-16 13:25:41 +0000
committerOlivier Blin <oblin@mandriva.org>2005-02-16 13:25:41 +0000
commitee52ec53de945615e0c725ac68206e18490800bb (patch)
treefeadb398046ebb99809a3137cec6ed3a7f8b52af
parentb8a654270fe2f980ce0da3aa4eb5bad1f4d7243a (diff)
downloaddrakx-ee52ec53de945615e0c725ac68206e18490800bb.tar
drakx-ee52ec53de945615e0c725ac68206e18490800bb.tar.gz
drakx-ee52ec53de945615e0c725ac68206e18490800bb.tar.bz2
drakx-ee52ec53de945615e0c725ac68206e18490800bb.tar.xz
drakx-ee52ec53de945615e0c725ac68206e18490800bb.zip
handle whitelist
-rw-r--r--perl-install/network/activefw.pm36
1 files changed, 36 insertions, 0 deletions
diff --git a/perl-install/network/activefw.pm b/perl-install/network/activefw.pm
index e73806ae8..4bc621253 100644
--- a/perl-install/network/activefw.pm
+++ b/perl-install/network/activefw.pm
@@ -92,6 +92,28 @@ sub unblacklist {
}
}
+sub whitelist {
+ my ($o, $addr) = @_;
+ eval {
+ $o->{daemon}->Whitelist(Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_UINT32, $addr));
+ };
+ if ($@) {
+ print "(Whitelist) exception: $@\n";
+ $o->dispatch;
+ }
+}
+
+sub unwhitelist {
+ my ($o, $addr) = @_;
+ eval {
+ $o->{daemon}->UnWhitelist(Net::DBus::Binding::Value->new(&Net::DBus::Binding::Message::TYPE_UINT32, $addr));
+ };
+ if ($@) {
+ print "(UnWhitelist) exception: $@\n";
+ $o->dispatch;
+ }
+}
+
sub set_interactive {
my ($o, $mode) = @_;
print "setting new IDS mode: $mode\n";
@@ -118,6 +140,20 @@ sub get_blacklist {
@blacklist;
}
+sub get_whitelist {
+ my ($o) = @_;
+ my @whitelist;
+ eval {
+ @whitelist = $o->{daemon}->GetWhitelist;
+ };
+ if ($@) {
+ print "(GetWhitelist) exception: $@\n";
+ $o->dispatch;
+ return;
+ }
+ @whitelist;
+}
+
sub format_date {
my ($timestamp) = @_;
strftime("%c", localtime($timestamp));