home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / system-tools-backends-2.0 / scripts / IfacesConfig.pm < prev    next >
Encoding:
Perl POD Document  |  2006-08-14  |  3.3 KB  |  80 lines

  1. #-*- Mode: perl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  
  3. # DBus object for the network interfaces config
  4. #
  5. # Copyright (C) 2005 Carlos Garnacho
  6. #
  7. # Authors: Carlos Garnacho Parro  <carlosg@gnome.org>
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU Library General Public License as published
  11. # by the Free Software Foundation; either version 2 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. # GNU Library General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Library General Public License
  20. # along with this program; if not, write to the Free Software
  21. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  22.  
  23. package IfacesConfig;
  24.  
  25. use Network::Ifaces;
  26.  
  27. use base qw(Net::DBus::Object);
  28. use Net::DBus::Exporter ($Utils::Backend::DBUS_PREFIX);
  29.  
  30. my $OBJECT_NAME = "IfacesConfig";
  31. my $OBJECT_PATH = "$Utils::Backend::DBUS_PATH/$OBJECT_NAME";
  32.  
  33. sub new
  34. {
  35.   my $class   = shift;
  36.   my $service = shift;
  37.   my $self    = $class->SUPER::new ($service, $OBJECT_PATH);
  38.  
  39.   bless $self, $class;
  40.  
  41. #  Utils::Monitor::monitor_files (&Users::Groups::get_files (),
  42. #                                 $self, $OBJECT_NAME, "changed");
  43.  
  44.   return $self;
  45. }
  46.  
  47. dbus_method ("get", [],
  48.              [[ "array", [ "struct", "string", "int32", "int32", "int32", "string", "string", "string", "string" ]],
  49.               [ "array", [ "struct", "string", "int32", "int32", "int32", "string", "string", "string", "string", "string", "int32", "string" ]],
  50.               [ "array", [ "struct", "string", "int32", "int32", "int32", "string", "string", "string", "string" ]],
  51.               [ "array", [ "struct", "string", "int32", "int32", "string", "string" ]],
  52.               [ "array", [ "struct", "string", "int32", "int32", "string", "string", "string", "int32", "int32", "string", "string", "int32", "int32", "int32", "int32" ]],
  53.               [ "array", [ "struct", "string", "int32", "int32", "string", "string", "string", "string", "int32", "int32", "int32", "int32" ]]]);
  54. dbus_method ("set",
  55.              [[ "array", [ "struct", "string", "int32", "int32", "int32", "string", "string", "string", "string" ]],
  56.               [ "array", [ "struct", "string", "int32", "int32", "int32", "string", "string", "string", "string", "string", "int32", "string" ]],
  57.               [ "array", [ "struct", "string", "int32", "int32", "int32", "string", "string", "string", "string" ]],
  58.               [ "array", [ "struct", "string", "int32", "int32", "string", "string" ]],
  59.               [ "array", [ "struct", "string", "int32", "int32", "string", "string", "string", "int32", "int32", "string", "string", "int32", "int32", "int32", "int32" ]],
  60.               [ "array", [ "struct", "string", "int32", "int32", "string", "string", "string", "string", "int32", "int32", "int32", "int32" ]]], []);
  61.  
  62. dbus_signal ("changed", []);
  63.  
  64. sub get
  65. {
  66.   my ($self) = @_;
  67.  
  68.   return &Network::Ifaces::get ();
  69. }
  70.  
  71. sub set
  72. {
  73.   my ($self, @config) = @_;
  74.  
  75.   &Network::Ifaces::set ($config[0], $config[1], $config[2],
  76.                          $config[3], $config[4], $config[5]);
  77. }
  78.  
  79. 1;
  80.