3 # Broadcast to other webmin servers
7 require './servers-lib.pl';
8 our (%text, %access, %in, %config);
10 $access{'find'} || &error($text{'find_ecannot'});
14 if (defined($in{'scan'})) {
15 # send to all addresses on the given network
16 $in{'scan'} =~ /^(\d+\.\d+\.\d+)\.0$/ || &error($text{'find_escan'});
17 for(my $i=0; $i<256; $i++) {
18 push(@broad, "$1.$i");
20 $limit = $config{'scan_time'};
21 $in{'port'} =~ /^\d+$/ || &error($text{'find_eport'});
24 # broadcast to some useful addresses
25 my $myip = &get_my_address();
27 push(@broad, &address_to_broadcast($myip, 0));
29 push(@broad, "255.255.255.255");
33 # Add local network addresses
34 if (&foreign_check("net") && !defined($in{'scan'})) {
35 &foreign_require("net", "net-lib.pl");
36 foreach my $a (&foreign_call("net", "active_interfaces")) {
37 push(@broad, $a->{'broadcast'}) if ($a->{'broadcast'});
41 # Get and display responses
42 &ui_print_unbuffered_header(undef, $text{'find_title'}, "");
43 if (defined($in{'scan'})) {
44 print &text('find_scanning', "<tt>$in{'scan'}</tt>"),"<p>\n";
47 print &text('find_broading', join(" , ", map { "<tt>$_</tt>" } @broad)),"<p>\n";
49 &find_servers(\@broad, $limit, 0, $in{'defuser'}, $in{'defpass'}, undef, undef,
52 &ui_print_footer("", $text{'index_return'});