1
// This program is free software; you can redistribute it and/or modify
2
// it under the terms of the GNU General Public License as published by
3
// the Free Software Foundation; either version 2 of the License, or
4
// (at your option) any later version.
6
// This program is distributed in the hope that it will be useful,
7
// but WITHOUT ANY WARRANTY; without even the implied warranty of
8
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
// GNU General Public License for more details.
11
// You should have received a copy of the GNU General Public License
12
// along with this program; if not, write to the Free Software
13
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
// Written by Nerijus Baliunas
16
// adapted by mad@madness.at
21
extern OptionContainer o;
24
KAVEngine::KAVEngine ()
28
KAVEngine::~KAVEngine ()
34
KAVEngine::scanFile (const char *filename)
38
kav_ctx ctx = kav_new ();
39
kav_set_timeout (ctx, o.virus_scanner_timeout);
41
if (kav_check_file (ctx, filename) == -1)
44
kav_error = kav_get_error (ctx);
47
cout << kav_strerror (kav_error) << " (" << kav_error << ")";
49
cout << ": (" << strerror (errno) << ")\n";
53
setErrString (kav_strerror (kav_error));
58
isinfected = kav_result_get_status (ctx);
59
virname = kav_result_get_report (ctx);
61
if (isinfected == KAV_STATUS_CLEAN || isinfected == KAV_STATUS_CORRUPTED_FOUND)
62
isinfected = AV_CLEAN;
64
isinfected = AV_VIRUS;