#
# ESET Software NOD32 - Client/Server Version
#

if ($nod32cli) {
    do_log(2,"Using $nod32cli");
    chop($output = `$nod32cli -a -r -d recurse --heur standard $TEMPDIR/parts`);
    $errval = retcode($?);
    do_log(2,$output);
    if ($errval == 0) {			# no errors, no viruses found
	$scanner_errors = 0;
    } elsif ($errval == 10) {		# 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: $nod32cli (error code: $errval)");
    }
}

# List of Return Codes
#define NOD32_EXIT_CODE_OK             0
#define NOD32_EXIT_CODE_NO_SERVER      1
#define NOD32_EXIT_CODE_INTERNAL_ERROR 2
#define NOD32_EXIT_CODE_VIRUS          10
#define NOD32_EXIT_CODE_CLEANED        11
#define NOD32_EXIT_CODE_SCANNING_ERROR 12
