~ubuntu-branches/ubuntu/intrepid/dansguardian/intrepid-security

« back to all changes in this revision

Viewing changes to ClamAV.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Wirt
  • Date: 2008-04-06 14:47:06 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080406144706-2r26l1rougdmb1sd
Tags: 2.9.9.3-2
This time build with gcc 4.3 (Closes: #454889) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef __HPP_CLAMAV
2
 
#define __HPP_CLAMAV
3
 
 
4
 
//  This program is free software; you can redistribute it and/or modify
5
 
//  it under the terms of the GNU General Public License as published by
6
 
//  the Free Software Foundation; either version 2 of the License, or
7
 
//  (at your option) any later version.
8
 
//
9
 
//  This program is distributed in the hope that it will be useful,
10
 
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
//  GNU General Public License for more details.
13
 
//
14
 
//  You should have received a copy of the GNU General Public License
15
 
//  along with this program; if not, write to the Free Software
16
 
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 
 
18
 
//  Written by Aecio F. Neto (afn@harvest.com.br)
19
 
//              Harvest Consultoria (www.harvest.com.br)
20
 
//
21
 
//  and somewhat hacked by mad@madness.at ;-)
22
 
//
23
 
 
24
 
#include <clamav.h>
25
 
#include <fstream>
26
 
#include <string>
27
 
#include <syslog.h>
28
 
#include <time.h>
29
 
 
30
 
#include "VirusEngine.hpp"
31
 
#include "OptionContainer.hpp"
32
 
 
33
 
using namespace std;
34
 
 
35
 
// this class implements the VirusEngine api for clamav/clamscan
36
 
//
37
 
class ClamEngine:public VirusEngine
38
 
{
39
 
private:
40
 
  const char *virname;
41
 
  const char *err_str;
42
 
  struct cl_node *root;
43
 
  struct cl_limits limits;
44
 
  struct cl_stat dbstat;
45
 
 
46
 
  string vname;                 // extra virus name field, in case we manually need to set one
47
 
  // (e.g. forked scanning needs this; child->parent data handover)
48
 
  string errstr;
49
 
 
50
 
public:
51
 
    ClamEngine ();
52
 
    virtual ~ ClamEngine ();
53
 
 
54
 
  virtual int loadEngine ();
55
 
  virtual int reloadEngine ();
56
 
  virtual int unloadEngine ();
57
 
 
58
 
  virtual int scanFile (const char *_fname);
59
 
 
60
 
  virtual const char *getVirusName ();
61
 
  virtual const char *getErrString ();
62
 
 
63
 
  virtual void setVirusName (const char *_vname);
64
 
  virtual void setErrString (const char *_err_str);
65
 
};
66
 
 
67
 
#endif