#  This software was derived from SATAN 1.1.1 by Dan Farmer and Wietse Venema
#  (http://www.porcupine.org/satan).
#
#
# Report vulnerability classes
#
sub sort_numeric {
	$severity_type_count{$b} <=> $severity_type_count{$a};
}

print CLIENT <<EOF;
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
  function movepic(img_name,img_src) {
  document[img_name].src=img_src;
}
</SCRIPT>
<title> Vulnerabilities - By Type</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>Vulnerabilities - By Type</H1></CENTER>
<hr>
<h3>Number of hosts per vulnerability type.</h3>
EOF

&make_severity_info();

if (sizeof(*severity_type_host_info) > 0) {
    print CLIENT <<EOF;
<ul>
EOF
    for (sort sort_numeric keys %severity_type_host_info) {
	($_type = $_) =~ tr / \//+!/;

	print CLIENT <<EOF;
	<li> 
	<a href="sara_severity_hosts.pl,$_type,">
	$_ - $severity_type_count{$_} host(s)</a>
EOF
    }
    print CLIENT <<EOF;
</ul>
	<strong>Note: hosts may appear in multiple categories. </strong>
EOF
} else {
    print CLIENT <<EOF
No vulnerability information found.
EOF
}

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
