#
# List hosts that provide a specific service.
#
($_SERVICE, $_sort_order) = split(/,/, $html_script_args);
($_service = $_SERVICE) =~ tr/?!/ \//;
my $myurl="saint_info_servers.pl,$html_script_args";

&make_service_exclusion_info;

my $txtstr="$server_severities{$_service} Vulnerable/$server_counts{$_service} total.";
if ( $Exclusions::display_ignored &&
      $Exclusions::server_severities_ignored{$_service} )
{     $txtstr="$server_severities{$_service} Vulnerable" .
              "[$Exclusions::server_severities_ignored{$_service} Ignored Vulns Only]/" .
              "$server_counts{$_service} total.";
}

&generate_html_header(\*::CLIENT,"Host Table - $_service Servers");

print CLIENT <<EOF
<CENTER><H1>Host Table - $_service Servers </H1></CENTER>
<hr><UL><UL>

<h3> 
$txtstr
Vulnerability counts in parentheses.
</h3>

<H4> Sort hosts by:
<a href="saint_info_servers.pl,$_SERVICE,name,">name</a> |
<a href="saint_info_servers.pl,$_SERVICE,domain,">domain</a> |
<a href="saint_info_servers.pl,$_SERVICE,type,">system type</a> |
<a href="saint_info_servers.pl,$_SERVICE,subnet,">subnet</a> |
<a href="saint_info_servers.pl,$_SERVICE,severity,">problem count</a> |
<a href="saint_info_servers.pl,$_SERVICE,severity_type,">problem type</a>
</H4>
EOF
;

&print_show_hide_html_message(\*::CLIENT,$myurl);
print CLIENT "<P>\n";

@_hosts = keys %{$servers{$_service}};
do "$html_root/reporting/sort_hosts.pl";
print CLIENT $@ if $@;

print CLIENT <<EOF;
<hr> <a href=$HTML_STARTPAGE> Back to the SAINT start page </a> |
<a href=analysis.pl> Back to SAINT Reporting and Analysis </a>
</UL></UL>
EOF
;

&generate_html_footer(\*::CLIENT);
