clamd/scanner.h
e3aaff8e
 /*
c442ca9c
  *  Copyright (C) 2013-2019 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  *  Copyright (C) 2007-2013 Sourcefire, Inc.
086eab5c
  *
  *  Authors: Tomasz Kojm, Török Edvin
e3aaff8e
  *
  *  This program is free software; you can redistribute it and/or modify
bb34cb31
  *  it under the terms of the GNU General Public License version 2 as
  *  published by the Free Software Foundation.
e3aaff8e
  *
  *  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
48b7b4a7
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  *  MA 02110-1301, USA.
e3aaff8e
  */
 
 #ifndef __SCANNER_H
 #define __SCANNER_H
 
2086dc5c
 #include <sys/types.h>
 
d7979d4f
 #include "libclamav/others.h"
bd8603aa
 #include "libclamav/clamav.h"
064b4a0c
 #include "shared/optparser.h"
949c6fe5
 #include "thrmgr.h"
 #include "session.h"
e3aaff8e
 
8b2bdb1b
 enum scan_type { TYPE_INIT = -1, TYPE_SCAN = 0, TYPE_CONTSCAN = 1, TYPE_MULTISCAN = 2 };
 
949c6fe5
 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;
d7979d4f
     struct cl_scan_options *options;
949c6fe5
     struct cl_engine *engine;
     const struct optstruct *opts;
     threadpool_t *thr_pool;
     jobgroup_t *group;
2086dc5c
     dev_t dev;
949c6fe5
 };
e3aaff8e
 
769f37a6
 struct cb_context {
     const char *filename;
     unsigned long long virsize;
     char virhash[33];
1f1bf36b
     struct scan_cb_data *scandata;
769f37a6
 };
 
d7979d4f
 int scanfd(const client_conn_t *conn, unsigned long int *scanned, const struct cl_engine *engine, struct cl_scan_options *options, const struct optstruct *opts, int odesc, int stream);
 int scanstream(int odesc, unsigned long int *scanned, const struct cl_engine *engine, struct cl_scan_options *options, const struct optstruct *opts, char term);
a2a004df
 int scan_callback(STATBUF *sb, char *filename, const char *msg, enum cli_ftw_reason reason, struct cli_ftw_cbdata *data);
51bbedb1
 int scan_pathchk(const char *path, struct cli_ftw_cbdata *data);
769f37a6
 void hash_callback(int fd, unsigned long long size, const unsigned char *md5, const char *virname, void *ctx);
 void msg_callback(enum cl_msg severity, const char *fullmsg, const char *msg, void *ctx);
1f1bf36b
 void clamd_virus_found_cb(int fd, const char *virname, void *context);
e3aaff8e
 
 #endif