2019-02-28 13:13:14 -05:00
|
|
|
/*
|
2020-01-03 15:44:07 -05:00
|
|
|
* Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
|
2019-02-28 13:13:14 -05:00
|
|
|
* Copyright (C) 2007-2013 Sourcefire, Inc.
|
|
|
|
*
|
|
|
|
* Authors: Mickey Sola
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
* MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ONAS_CLAMONACC_H
|
|
|
|
#define __ONAS_CLAMONACC_H
|
|
|
|
|
2019-07-25 12:21:07 -04:00
|
|
|
#include "libclamav/clamav.h"
|
2019-02-28 13:13:14 -05:00
|
|
|
|
2019-05-30 17:44:03 -04:00
|
|
|
#ifndef ONAS_DEBUG
|
|
|
|
#define ONAS_DEBUG
|
|
|
|
#endif
|
|
|
|
/* dev only switch for very noisy output */
|
|
|
|
#undef ONAS_DEBUG
|
|
|
|
|
2019-04-25 16:11:39 -04:00
|
|
|
#ifndef HAVE_ATTRIB_PACKED
|
|
|
|
#define __attribute__(x)
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_PRAGMA_PACK
|
|
|
|
#pragma pack(1)
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_PRAGMA_PACK_HPPA
|
|
|
|
#pragma pack 1
|
|
|
|
#endif
|
|
|
|
|
2019-02-28 13:13:14 -05:00
|
|
|
struct onas_context {
|
2019-07-25 12:42:08 -04:00
|
|
|
const struct optstruct *opts;
|
|
|
|
const struct optstruct *clamdopts;
|
2019-02-28 13:13:14 -05:00
|
|
|
|
2019-07-25 12:42:08 -04:00
|
|
|
int printinfected;
|
|
|
|
int maxstream;
|
2019-02-28 13:13:14 -05:00
|
|
|
|
2019-07-25 12:42:08 -04:00
|
|
|
uint32_t ddd_enabled;
|
2019-02-28 13:13:14 -05:00
|
|
|
|
2019-07-25 12:42:08 -04:00
|
|
|
int fan_fd;
|
|
|
|
uint64_t fan_mask;
|
|
|
|
uint8_t retry_on_error;
|
|
|
|
uint8_t retry_attempts;
|
|
|
|
uint8_t deny_on_error;
|
2019-02-28 13:13:14 -05:00
|
|
|
|
2019-07-25 12:42:08 -04:00
|
|
|
uint64_t sizelimit;
|
|
|
|
uint64_t extinfo;
|
2019-02-28 13:13:14 -05:00
|
|
|
|
2019-07-25 12:42:08 -04:00
|
|
|
int scantype;
|
|
|
|
int isremote;
|
|
|
|
int session;
|
|
|
|
int timeout;
|
2019-02-28 13:13:14 -05:00
|
|
|
|
2019-07-25 12:42:08 -04:00
|
|
|
int64_t portnum;
|
2019-05-16 13:05:48 -07:00
|
|
|
|
2019-07-25 12:42:08 -04:00
|
|
|
int32_t maxthreads;
|
2019-04-25 16:11:39 -04:00
|
|
|
} __attribute__((packed));
|
|
|
|
|
|
|
|
#ifdef HAVE_PRAGMA_PACK
|
|
|
|
#pragma pack()
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_PRAGMA_PACK_HPPA
|
|
|
|
#pragma pack
|
|
|
|
#endif
|
2019-02-28 13:13:14 -05:00
|
|
|
|
2019-07-25 12:42:08 -04:00
|
|
|
struct onas_context *onas_init_context(void);
|
2019-09-11 11:17:49 -07:00
|
|
|
void onas_cleanup(struct onas_context *ctx);
|
|
|
|
void onas_context_cleanup(struct onas_context *ctx);
|
2019-03-26 11:34:54 -04:00
|
|
|
cl_error_t onas_check_client_connection(struct onas_context **ctx);
|
2019-02-28 13:13:14 -05:00
|
|
|
int onas_start_eloop(struct onas_context **ctx);
|
|
|
|
void help(void);
|
|
|
|
|
|
|
|
#endif
|