#
# GeCAD RAV AntiVirus 8
#
# NOTE: the command line switches changed with scan engine 8.5 !
#

if ($rav) {
    do_log(2,"Using $rav");
    chop($output = `$rav --all --archive --mail $TEMPDIR/parts`);
    $errval = retcode($?);
    do_log(2,$output);
    if ($errval == 0 || $errval == 1) {		# no errors, no viruses found
	$scanner_errors = 0;
    } elsif ($errval == 2 || $errval == 3) {	# no errors, viruses discovered
	$scanner_errors = 0;
	@virusname = ($output =~ /Infected: (.+)/g);
	return 1;  # 'true' indicates virus found and stops further checking
    } else {
	do_log(0,"Virus scanner failure: $rav (error code: $errval)");
    }
}

# List of Return Codes
#FILE_OK              1
#FILE_INFECTED        2
#FILE_SUSPICIOUS      3
#FILE_CLEANED         4
#FILE_CLEAN_FAIL      5
#FILE_DELETED         6
#FILE_DELETE_FAIL     7
#FILE_COPIED          8
#FILE_COPY_FAIL       9
#FILE_MOVED           10
#FILE_MOVE_FAIL       11
#FILE_RENAMED         12
#FILE_RENAMED_FAIL    13

#NO_FILES             20

#ENG_ERROR            30
#SINTAX_ERR           31
#HELP_MSG             32
#VIR_LIST             33
