0d01fcb2 |
/* |
ed5307d9 |
* Copyright (C) 2002 - 2005 Tomasz Kojm <tkojm@clamav.net> |
0d01fcb2 |
* 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 |
30738099 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA. |
0d01fcb2 |
*/
|
2fe19b26 |
#ifndef __FILETYPES_H
#define __FILETYPES_H
|
d53647d5 |
#include <sys/types.h>
|
1e7a21fb |
#define MAGIC_BUFFER_SIZE 256 |
2fe19b26 |
#define CL_TYPENO 500 |
d53647d5 |
#define SFX_MAX_TESTS 10 |
0d01fcb2 |
typedef enum { |
06d4e856 |
CL_TYPE_UNKNOWN_TEXT = CL_TYPENO,
CL_TYPE_UNKNOWN_DATA,
CL_TYPE_MSEXE, |
0c27bce8 |
CL_TYPE_ELF, |
06d4e856 |
CL_TYPE_DATA, |
255e314c |
CL_TYPE_POSIX_TAR,
CL_TYPE_OLD_TAR, |
06d4e856 |
CL_TYPE_GZ,
CL_TYPE_ZIP,
CL_TYPE_BZ,
CL_TYPE_RAR,
CL_TYPE_MSSZDD,
CL_TYPE_MSOLE2,
CL_TYPE_MSCAB,
CL_TYPE_MSCHM, |
5afe9ae6 |
CL_TYPE_SIS, |
06d4e856 |
CL_TYPE_SCRENC, |
856d9c84 |
CL_TYPE_GRAPHICS, |
ed5307d9 |
CL_TYPE_RIFF, |
c85a3e42 |
CL_TYPE_BINHEX, |
c5a962df |
CL_TYPE_TNEF, |
e2cf58ed |
CL_TYPE_CRYPTFF, |
030362e3 |
CL_TYPE_PDF, |
165d8543 |
CL_TYPE_UUENCODED, |
36fbf46f |
CL_TYPE_PST, /* Microsoft Outlook binary email folder (.pst file) */ |
1e7a21fb |
CL_TYPE_HTML_UTF16, |
f9d258e2 |
CL_TYPE_RTF, |
b83d8323 |
|
12565a07 |
/* bigger numbers have higher priority (in o-t-f detection) */ |
06d4e856 |
CL_TYPE_HTML, /* on the fly */ |
8f56d5c7 |
CL_TYPE_MAIL, /* magic + on the fly */ |
ed2cd7c1 |
CL_TYPE_SFX, /* foo SFX marker */ |
59139c8a |
CL_TYPE_ZIPSFX, /* on the fly */ |
b408821a |
CL_TYPE_RARSFX, /* on the fly */
CL_TYPE_CABSFX |
2fe19b26 |
|
0d01fcb2 |
} cli_file_t;
|
ed2cd7c1 |
struct cli_matched_type {
cli_file_t type; |
d53647d5 |
off_t offset;
unsigned short cnt; |
ed2cd7c1 |
struct cli_matched_type *next;
};
|
59afa53d |
cli_file_t cli_filetype(const unsigned char *buf, size_t buflen); |
1e7a21fb |
cli_file_t cli_filetype2(int desc, const struct cl_engine *engine); |
f477691c |
int cli_addtypesigs(struct cl_engine *engine); |
0d01fcb2 |
#endif |