Last change
on this file was 3265, checked in by Bruno Cornec, 10 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 |
|
---|
10 | package MondoRescue::Net;
|
---|
11 |
|
---|
12 | use strict 'vars';
|
---|
13 | use Data::Dumper;
|
---|
14 | use English;
|
---|
15 | use Cwd;
|
---|
16 | use ProjectBuilder::Base;
|
---|
17 | use IO::Interface::Simple;
|
---|
18 | use lib qw (lib);
|
---|
19 |
|
---|
20 | # Inherit from the "Exporter" module which handles exporting functions.
|
---|
21 |
|
---|
22 | use Exporter;
|
---|
23 |
|
---|
24 | # Export, by default, all the functions into the namespace of
|
---|
25 | # any code which uses this module.
|
---|
26 |
|
---|
27 | our @ISA = qw(Exporter);
|
---|
28 | our @EXPORT = qw(mr_net_get_config);
|
---|
29 |
|
---|
30 | =pod
|
---|
31 |
|
---|
32 | =head1 NAME
|
---|
33 |
|
---|
34 | MondoRescue::Net, part of the mondorescue.org
|
---|
35 |
|
---|
36 | =head1 DESCRIPTION
|
---|
37 |
|
---|
38 | This 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 |
|
---|
46 | This function returns a hash of the network configuration of the system
|
---|
47 |
|
---|
48 | =cut
|
---|
49 |
|
---|
50 | #$pbdebug = 2;
|
---|
51 |
|
---|
52 | sub mr_net_get_config {
|
---|
53 |
|
---|
54 | my %mr_net;
|
---|
55 | my $mr_net;
|
---|
56 | pb_log(2,"mr_net_get_config start\n");
|
---|
57 | my @interfaces = IO::Interface::Simple->interfaces;
|
---|
58 |
|
---|
59 | for my $if (@interfaces) {
|
---|
60 | $mr_net{$if} = \$if;
|
---|
61 | }
|
---|
62 |
|
---|
63 | return(\%mr_net);
|
---|
64 | }
|
---|
65 |
|
---|
66 |
|
---|
67 | =back
|
---|
68 |
|
---|
69 | =head1 WEB SITES
|
---|
70 |
|
---|
71 | The 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 |
|
---|
75 | For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel>
|
---|
76 |
|
---|
77 | =head1 AUTHORS
|
---|
78 |
|
---|
79 | The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>.
|
---|
80 |
|
---|
81 | =head1 COPYRIGHT
|
---|
82 |
|
---|
83 | MondoRescue is distributed under the GPL v2.0 license or later,
|
---|
84 | described in the file C<COPYING> included with the distribution.
|
---|
85 |
|
---|
86 | =cut
|
---|
87 |
|
---|
88 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.