![]() |
Skyld AV
0.6
On access virus scanning for Linux
|
Scans files for viruses. More...
#include <VirusScan.h>

Public Types | |
| enum | Status { SCANOK = 0, SCANERROR = -1, SCANVIRUS = 1 } |
| Status of virus scanning. More... | |
| enum | RunStatus { RUNNING, STOPPING, STOPPED } |
Public Member Functions | |
| VirusScan (Environment *) | |
| Initializes virus scan engine. More... | |
| int | scan (const int fd) |
| Scans file for virus. More... | |
| ~VirusScan () | |
| Deletes the virus scanner. More... | |
Private Member Functions | |
| struct cl_engine * | createEngine () |
| Creates a new virus scan engine. More... | |
| int | createThread () |
| Creates a new thread for managing the scan engine. More... | |
| void | dbstat_clear () |
| Clears database status. More... | |
| int | dbstat_check () |
| Checks if database has changed. 0 = unchanged, 1 = changed. More... | |
| void | dbstat_free () |
| Frees database status. More... | |
| void | destroyEngine (cl_engine *) |
| struct cl_engine * | getEngine () |
| Gets reference to virus scan engine. More... | |
| void | releaseEngine () |
| void | log_virus_found (const int fd, const char *virname) |
| Writes log entry. More... | |
Static Private Member Functions | |
| static void * | updater (void *) |
| Thread to update engine. More... | |
Private Attributes | |
| Environment * | env |
| environment More... | |
| struct cl_stat | dbstat |
| Struture indicating if database has changed. More... | |
| struct cl_engine * | engine |
| Reference to virus scan engine. More... | |
| pthread_mutex_t | mutexEngine |
| Mutex for accessing the engine. More... | |
| pthread_mutex_t | mutexUpdate |
| Mutex for accessing the engine. More... | |
| enum RunStatus | status |
| pthread_t | updateThread |
| Thrad for updating. More... | |
| int | engineRefCount |
| Reference count of virus scan enginge. More... | |
Scans files for viruses.
Definition at line 38 of file VirusScan.h.
| enum VirusScan::RunStatus |
| Enumerator | |
|---|---|
| RUNNING | |
| STOPPING | |
| STOPPED | |
Definition at line 59 of file VirusScan.h.
| enum VirusScan::Status |
Status of virus scanning.
| Enumerator | |
|---|---|
| SCANOK |
OK. |
| SCANERROR |
An error occured. |
| SCANVIRUS |
A virus was found. |
Definition at line 44 of file VirusScan.h.
| VirusScan::VirusScan | ( | Environment * | e | ) |
Initializes virus scan engine.
Definition at line 37 of file VirusScan.cc.

| VirusScan::~VirusScan | ( | ) |
Deletes the virus scanner.
Definition at line 337 of file VirusScan.cc.

|
private |
Creates a new virus scan engine.
Definition at line 71 of file VirusScan.cc.


|
private |
Creates a new thread for managing the scan engine.
Definition at line 168 of file VirusScan.cc.


|
private |
Checks if database has changed. 0 = unchanged, 1 = changed.
Definition at line 183 of file VirusScan.cc.

|
private |
Clears database status.
Definition at line 196 of file VirusScan.cc.

|
private |
Frees database status.
Definition at line 204 of file VirusScan.cc.

|
private |
Destroys virus scan engine.
| e | virus scan engine |
Definition at line 131 of file VirusScan.cc.


|
private |
Gets reference to virus scan engine.
Definition at line 147 of file VirusScan.cc.

|
private |
Writes log entry.
| fd | file descriptor |
| virname | name of virus |
Definition at line 214 of file VirusScan.cc.


|
private |
Decreases the viurs engine reference count.
Definition at line 232 of file VirusScan.cc.

| int VirusScan::scan | ( | const int | fd | ) |
Scans file for virus.
Definition at line 243 of file VirusScan.cc.


|
staticprivate |
Thread to update engine.
| threadPool | thread pool |
Definition at line 274 of file VirusScan.cc.


|
private |
Struture indicating if database has changed.
Definition at line 76 of file VirusScan.h.
|
private |
Reference to virus scan engine.
Definition at line 80 of file VirusScan.h.
|
private |
Reference count of virus scan enginge.
Definition at line 100 of file VirusScan.h.
|
private |
environment
Definition at line 72 of file VirusScan.h.
|
private |
Mutex for accessing the engine.
Definition at line 84 of file VirusScan.h.
|
private |
Mutex for accessing the engine.
Definition at line 88 of file VirusScan.h.
|
private |
Run status
Definition at line 92 of file VirusScan.h.
|
private |
Thrad for updating.
Definition at line 96 of file VirusScan.h.
1.8.8