/*- * Copyright (c) 2002 Granch Ltd. All rigts reserved. * * All or some portions of this file are derived from material licensed * to the Grahcn Ltd. and are reproduced herein with the permission of * Granch Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE GRANCH LTD. AND THEIR CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * Author : Rashid N. Achilov E-Mail shelton@sentry.granch.ru * * @(#)localtypes.h 0.91.3 (Granch Ltd.) 23/01/03 */ /*------------------------------------------------------------------------- Kaspersky Anti-Virus mail filter, based on libmilter API UNIX FreeBSD 4.6 version Global types definition. -------------------------------------------------------------------------*/ #include struct local_flags // Local flags structure { unsigned _isdaemon :1; // Go to daemon mode unsigned _mode_reject :1; // Default mode - REJECT unsigned _mode_discard :1; // Default mode - DISCARD unsigned _openlog :1; // System log is opened unsigned _pidfile :1; // PID file is presented unsigned _alloc_config :1; // Memory to config file allocated unsigned :2; // Reserved bits }; struct conn_flags // Connection flag structure { unsigned _infected :1; // This mail is infected unsigned _firstheader :1; // First header line already was unsigned _tempsave :1; // Open temp/save file unsigned _firstrcpt :1; // First recipient already was given unsigned :4; // Reserved bits }; struct mlfiPriv // Mail filter private data storage { char *mlfi_fname; // Temp/save filename char *mlfi_connectfrom; // Connect from: container char *mlfi_mailfrom; // MAIL FROM: container char *mlfi_helofrom; // HELO from: container char *mlfi_rcptto; // First RCPT TO: container FILE *mlfi_fp; // File handle struct tm *ptm; // Time containver char *_kavreply; // KAV reply buffer struct conn_flags _cflags; // Connection flags short int recipients; // Number of recipients in mail short int headerlines; // Header lines counter short int body_parts; // Mail body can be split in a chunks int body_length; // Message body (accomplished) length }; struct config_flags // Config file flags structure { unsigned _isdaemon :1; // Go to daemon mode unsigned _mode_reject :1; // Default mode - REJECT unsigned _mode_discard :1; // Default mode - DISCARD unsigned :5; // Reserved bits }; struct local_config // Config file description structure { char *progname; // Mandatory field - program name char *progversion; // Mandatory field - program version char *sendmail_pipe; // Pipe to use with sendmail char *KAV_pipe; // Pipe to use with KAV char *pidfile; // PID number keeper char *temp_directory; // Directory to keep mail to check short int KAV_timeout; // Timeout to connect to KAV short int sendmail_timeout; // Timeout to connect to sendmail short int debug_level; // Level of debugging messages struct config_flags _idflags; // Config file flags };