diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2007-12-10 01:22:51 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2007-12-12 01:22:02 +0100 |
commit | 133f953a758db394fa4a6865853463447b8a67bd (patch) | |
tree | 76daeae46a88fb70d241d2850040895ab0ff308f /Network | |
parent | ef0a1cfecfdf30c41d6d90c039644901cd97e877 (diff) |
Add file notification support to IfacesConfig. There's room for improvement here though.
Diffstat (limited to 'Network')
-rw-r--r-- | Network/Ifaces.pm | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Network/Ifaces.pm b/Network/Ifaces.pm index 6c72269..4c951c9 100644 --- a/Network/Ifaces.pm +++ b/Network/Ifaces.pm @@ -3886,4 +3886,45 @@ sub set &set_interfaces_config (\%hash); } +sub get_files +{ + my (%dist_attrib, %config_hash, %hash, %fn); + my (@ifaces, @files); + my ($file, $proc); + my ($i, $j); + + %hash = &get_interfaces_info (); + %dist_attrib = &get_interface_parse_table (); + %fn = %{$dist_attrib{"fn"}}; + $proc = $dist_attrib{"ifaces_get"}; + + # FIXME: is proc necessary? why not using hash keys? + if ($proc) + { + @ifaces = &$proc (); + } + else + { + @ifaces = keys %hash; + } + + &add_dialup_iface (\@ifaces); + + # FIXME: this doesn't work for entries with %entry_name% + foreach $i (@ifaces) + { + foreach $j (keys (%fn)) + { + ${$dist_attrib{"fn"}}{$j} = &Utils::Parse::expand ($fn{$j}, + "iface", $i, + "type", &get_interface_type ($i)); + + $file = ${$dist_attrib{"fn"}}{$j}; + push @files, $file if ($file =~ /^\//); + } + } + + return \@files; +} + 1; |