clamonacc/clamonacc.h
953a43f3
 /*
206dbaef
  *  Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
953a43f3
  *  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
 
9e20cdf6
 // libclamav
 #include "clamav.h"
953a43f3
 
7d83fa29
 #ifndef ONAS_DEBUG
 #define ONAS_DEBUG
 #endif
 /* dev only switch for very noisy output */
 #undef ONAS_DEBUG
 
3e5b1b8b
 #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
 
953a43f3
 struct onas_context {
4fee702f
     const struct optstruct *opts;
     const struct optstruct *clamdopts;
953a43f3
 
4fee702f
     int printinfected;
     int maxstream;
953a43f3
 
4fee702f
     uint32_t ddd_enabled;
953a43f3
 
4fee702f
     int fan_fd;
     uint64_t fan_mask;
     uint8_t retry_on_error;
     uint8_t retry_attempts;
     uint8_t deny_on_error;
953a43f3
 
4fee702f
     uint64_t sizelimit;
     uint64_t extinfo;
953a43f3
 
4fee702f
     int scantype;
     int isremote;
     int session;
     int timeout;
953a43f3
 
4fee702f
     int64_t portnum;
b449411f
 
4fee702f
     int32_t maxthreads;
3e5b1b8b
 } __attribute__((packed));
 
 #ifdef HAVE_PRAGMA_PACK
 #pragma pack()
 #endif
 #ifdef HAVE_PRAGMA_PACK_HPPA
 #pragma pack
 #endif
953a43f3
 
4fee702f
 struct onas_context *onas_init_context(void);
dcad75ff
 void onas_cleanup(struct onas_context *ctx);
 void onas_context_cleanup(struct onas_context *ctx);
20b9d679
 cl_error_t onas_check_client_connection(struct onas_context **ctx);
953a43f3
 int onas_start_eloop(struct onas_context **ctx);
 void help(void);
 
 #endif