source: MondoRescue/branches/3.2/MondoRescue/lib/MondoRescue/Net.pm @ 3265

Last change on this file since 3265 was 3265, checked in by Bruno Cornec, 7 years ago
  • Add a new binary mr-net-get-config to coput the network configuration and generate the appropriate portion of the configuration file
File size: 1.7 KB
Line 
1#!/usr/bin/perl -w
2#
3# Network subroutines brought by the MondoRescue project
4#
5# $Id$
6#
7# Copyright B. Cornec 2008-2014
8# Provided under the GPL v2
9
10package MondoRescue::Net;
11
12use strict 'vars';
13use Data::Dumper;
14use English;
15use Cwd;
16use ProjectBuilder::Base;
17use IO::Interface::Simple;
18use lib qw (lib);
19
20# Inherit from the "Exporter" module which handles exporting functions.
21
22use Exporter;
23
24# Export, by default, all the functions into the namespace of
25# any code which uses this module.
26
27our @ISA = qw(Exporter);
28our @EXPORT = qw(mr_net_get_config);
29
30=pod
31
32=head1 NAME
33
34MondoRescue::Net, part of the mondorescue.org
35
36=head1 DESCRIPTION
37
38This modules provides low level and generic functions for the Mondorescue project
39
40=head1 USAGE
41
42=over 4
43
44=item B<mr_net_get_config>
45
46This function returns a hash of the network configuration of the system
47
48=cut
49
50#$pbdebug = 2;
51
52sub mr_net_get_config {
53
54my %mr_net;
55my $mr_net;
56pb_log(2,"mr_net_get_config start\n");
57my @interfaces = IO::Interface::Simple->interfaces;
58
59for my $if (@interfaces) {
60    $mr_net{$if} = \$if;
61}
62
63return(\%mr_net);
64}
65
66
67=back
68
69=head1 WEB SITES
70
71The main Web site of the project is available at L<http://www.mondorescue.org>. Bug reports should be filled using the trac instance of the project at L<http://trac.mondorescue.org/>.
72
73=head1 USER MAILING LIST
74
75For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel>
76
77=head1 AUTHORS
78
79The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>.
80
81=head1 COPYRIGHT
82
83MondoRescue is distributed under the GPL v2.0 license or later,
84described in the file C<COPYING> included with the distribution.
85
86=cut
87
88
Note: See TracBrowser for help on using the repository browser.