9b8e00a0 |
/* |
eb308794 |
* Copyright (C) 2002 - 2005 Tomasz Kojm <tkojm@clamav.net> |
9b8e00a0 |
* With enhancements from Thomas Lamy <Thomas.Lamy@in-online.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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. |
9b8e00a0 |
*/
|
888f5794 |
#ifndef __FILETYPES_H
#define __FILETYPES_H
|
994ae437 |
#include <sys/types.h>
|
a7f5fd00 |
#define MAGIC_BUFFER_SIZE 50 |
888f5794 |
#define CL_TYPENO 500 |
994ae437 |
#define SFX_MAX_TESTS 10 |
9b8e00a0 |
typedef enum { |
3805ebcb |
CL_TYPE_UNKNOWN_TEXT = CL_TYPENO,
CL_TYPE_UNKNOWN_DATA,
CL_TYPE_MSEXE, |
094116b2 |
CL_TYPE_ELF, |
3805ebcb |
CL_TYPE_DATA, |
a7f5fd00 |
CL_TYPE_POSIX_TAR,
CL_TYPE_OLD_TAR, |
3805ebcb |
CL_TYPE_GZ,
CL_TYPE_ZIP,
CL_TYPE_BZ,
CL_TYPE_RAR,
CL_TYPE_MSSZDD,
CL_TYPE_MSOLE2,
CL_TYPE_MSCAB,
CL_TYPE_MSCHM, |
bf45bf13 |
CL_TYPE_SIS, |
3805ebcb |
CL_TYPE_SCRENC, |
7ec67e94 |
CL_TYPE_GRAPHICS, |
eb308794 |
CL_TYPE_RIFF, |
667ab9c6 |
CL_TYPE_BINHEX, |
846e4186 |
CL_TYPE_TNEF, |
2c6f9d57 |
CL_TYPE_CRYPTFF, |
f87214c3 |
CL_TYPE_PDF, |
3953039b |
CL_TYPE_UUENCODED, |
888f5794 |
|
ece009c0 |
/* bigger numbers have higher priority (in o-t-f detection) */ |
3805ebcb |
CL_TYPE_HTML, /* on the fly */ |
d1bccafe |
CL_TYPE_MAIL, /* magic + on the fly */ |
a85bd2ac |
CL_TYPE_SFX, /* foo SFX marker */ |
4705a377 |
CL_TYPE_ZIPSFX, /* on the fly */ |
d1bccafe |
CL_TYPE_RARSFX /* on the fly */ |
888f5794 |
|
9b8e00a0 |
} cli_file_t;
|
a85bd2ac |
struct cli_matched_type {
cli_file_t type; |
994ae437 |
off_t offset;
unsigned short cnt; |
a85bd2ac |
struct cli_matched_type *next;
};
|
9b8e00a0 |
cli_file_t cli_filetype(const char *buf, size_t buflen); |
a7f5fd00 |
cli_file_t cli_filetype2(int desc); |
5612732c |
int cli_addtypesigs(struct cl_engine *engine); |
9b8e00a0 |
#endif |