2003-07-29 15:48:06 +00:00
|
|
|
/*
|
2007-02-20 21:19:04 +00:00
|
|
|
* Copyright (C) 2002 - 2007 Tomasz Kojm <tkojm@clamav.net>
|
2003-07-29 15:48:06 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
2007-03-31 20:31:04 +00:00
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
2003-07-29 15:48:06 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2006-04-09 19:59:28 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
* MA 02110-1301, USA.
|
2003-07-29 15:48:06 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SCANNER_H
|
|
|
|
#define __SCANNER_H
|
|
|
|
|
2007-02-20 21:19:04 +00:00
|
|
|
#define TYPE_SCAN 0
|
|
|
|
#define TYPE_CONTSCAN 1
|
|
|
|
#define TYPE_MULTISCAN 2
|
|
|
|
|
2006-09-05 20:45:39 +00:00
|
|
|
#include "libclamav/clamav.h"
|
2008-12-17 21:42:54 +00:00
|
|
|
#include "shared/optparser.h"
|
2009-02-12 16:51:09 +00:00
|
|
|
#include "thrmgr.h"
|
|
|
|
#include "session.h"
|
2003-07-29 15:48:06 +00:00
|
|
|
|
2009-02-12 16:51:09 +00:00
|
|
|
struct scan_cb_data {
|
|
|
|
int scantype;
|
|
|
|
int odesc;
|
|
|
|
int type;
|
|
|
|
int infected;
|
|
|
|
int errors;
|
|
|
|
int total;
|
|
|
|
int id;
|
|
|
|
const client_conn_t *conn;
|
|
|
|
const char *toplevel_path;
|
|
|
|
unsigned long scanned;
|
|
|
|
unsigned int options;
|
|
|
|
struct cl_engine *engine;
|
|
|
|
const struct optstruct *opts;
|
|
|
|
threadpool_t *thr_pool;
|
|
|
|
jobgroup_t *group;
|
|
|
|
};
|
2003-07-29 15:48:06 +00:00
|
|
|
|
2009-02-12 16:51:09 +00:00
|
|
|
int scanfd(const int fd, const client_conn_t *conn, unsigned long int *scanned, const struct cl_engine *engine, unsigned int options, const struct optstruct *opts, int odesc, int stream);
|
|
|
|
int scanstream(int odesc, unsigned long int *scanned, const struct cl_engine *engine, unsigned int options, const struct optstruct *opts, char term);
|
|
|
|
int scan_callback(struct stat *sb, char *filename, const char *msg, enum cli_ftw_reason reason, struct cli_ftw_cbdata *data);
|
2003-07-29 15:48:06 +00:00
|
|
|
|
|
|
|
#endif
|