version 1.1048.2.4, 2010/09/03 19:20:54
|
version 1.1048.2.5, 2010/12/08 04:51:26
|
Line 9534 sub get_dns {
|
Line 9534 sub get_dns {
|
my %libserv; |
my %libserv; |
my $loaded; |
my $loaded; |
my %name_to_host; |
my %name_to_host; |
|
my %internetdom; |
|
|
sub parse_hosts_tab { |
sub parse_hosts_tab { |
my ($file) = @_; |
my ($file) = @_; |
Line 9541 sub get_dns {
|
Line 9542 sub get_dns {
|
next if ($configline =~ /^(\#|\s*$ )/x); |
next if ($configline =~ /^(\#|\s*$ )/x); |
next if ($configline =~ /^\^/); |
next if ($configline =~ /^\^/); |
chomp($configline); |
chomp($configline); |
my ($id,$domain,$role,$name,$protocol)=split(/:/,$configline); |
my ($id,$domain,$role,$name,$protocol,$intdom)=split(/:/,$configline); |
$name=~s/\s//g; |
$name=~s/\s//g; |
if ($id && $domain && $role && $name) { |
if ($id && $domain && $role && $name) { |
$hostname{$id}=$name; |
$hostname{$id}=$name; |
Line 9557 sub get_dns {
|
Line 9558 sub get_dns {
|
} else { |
} else { |
$protocol{$id} = 'http'; |
$protocol{$id} = 'http'; |
} |
} |
|
if (defined($intdom)) { |
|
$internetdom{$id} = $intdom; |
|
} |
} |
} |
} |
} |
} |
} |
Line 9655 sub get_dns {
|
Line 9659 sub get_dns {
|
my @uniq = grep(!$seen{$_}++, values(%hostdom)); |
my @uniq = grep(!$seen{$_}++, values(%hostdom)); |
return @uniq; |
return @uniq; |
} |
} |
|
|
|
sub internet_dom { |
|
&load_hosts_tab() if (!$loaded); |
|
|
|
my ($lonid) = @_; |
|
return $internetdom{$lonid}; |
|
} |
} |
} |
|
|
{ |
{ |