--- loncom/lonnet/perl/lonnet.pm 2010/09/03 19:20:54 1.1048.2.4 +++ loncom/lonnet/perl/lonnet.pm 2010/12/08 04:51:26 1.1048.2.5 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1048.2.4 2010/09/03 19:20:54 raeburn Exp $ +# $Id: lonnet.pm,v 1.1048.2.5 2010/12/08 04:51:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -9534,6 +9534,7 @@ sub get_dns { my %libserv; my $loaded; my %name_to_host; + my %internetdom; sub parse_hosts_tab { my ($file) = @_; @@ -9541,7 +9542,7 @@ sub get_dns { next if ($configline =~ /^(\#|\s*$ )/x); next if ($configline =~ /^\^/); chomp($configline); - my ($id,$domain,$role,$name,$protocol)=split(/:/,$configline); + my ($id,$domain,$role,$name,$protocol,$intdom)=split(/:/,$configline); $name=~s/\s//g; if ($id && $domain && $role && $name) { $hostname{$id}=$name; @@ -9557,6 +9558,9 @@ sub get_dns { } else { $protocol{$id} = 'http'; } + if (defined($intdom)) { + $internetdom{$id} = $intdom; + } } } } @@ -9655,6 +9659,13 @@ sub get_dns { my @uniq = grep(!$seen{$_}++, values(%hostdom)); return @uniq; } + + sub internet_dom { + &load_hosts_tab() if (!$loaded); + + my ($lonid) = @_; + return $internetdom{$lonid}; + } } {