#  This software was derived from SATAN 1.1.1 by Dan Farmer and Wietse Venema
#  (http://www.porcupine.org/satan).
#
#
# List all hosts in a subnet
#
($_subnet, $_sort_order) = split(/,/, $html_script_args);
print CLIENT <<EOF;
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
  function movepic(img_name,img_src) {
  document[img_name].src=img_src;
}
</SCRIPT>
<title> Host Table - Subnet $_subnet</title>
<LINK REV="made" HREF="mailto:satan\@fish.com">
<LINK REV="made" HREF="mailto:sara\@arc.com">
</HEAD>
<BODY>
EOF
if ($pi_menu) {
  $screen = &$pi_menu;
} else {
  $screen = print_menu();
}
$screen =~ s/\\n/\n/g;
print CLIENT $screen;
print CLIENT <<EOF;
</TD><TD valign=top>
<CENTER><H1>Host Table - Subnet $_subnet</h1></CENTER>
<hr>

<h3> 
$subnet_severities{$_subnet} Vulnerable/$subnet_count{$_subnet} total.
Vulnerability counts in parentheses.
</h3>

<H4> Sort hosts by:
<A HREF="sara_results_subnet.pl,$_subnet,name,">name</a> |
<A HREF="sara_results_subnet.pl,$_subnet,domain,">domain</a> |
<A HREF="sara_results_subnet.pl,$_subnet,type,">system type</a> |
<A HREF="sara_results_subnet.pl,$_subnet,severity,">problem count</a> |
<A HREF="sara_results_subnet.pl,$_subnet,severity_type,">problem type</a>
</H4>
EOF

@_hosts = split(/\s/, $all_subnets{$_subnet});
do "$html_root/reporting/sort_hosts.pl";
print CLIENT $@ if $@;

print CLIENT <<EOF;
<hr> <a href="/"> Back to the SARA start page </a> |
<a href=/reporting/analysis.pl> Back to SARA Reporting and Analysis </a>
</UL></UL></TABLE>
</BODY>
</HTML>
EOF
