~ubuntu-branches/ubuntu/dapper/clamav/dapper-security

« back to all changes in this revision

Viewing changes to libclamav/filetypes.h

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2009-04-29 17:17:14 UTC
  • mfrom: (1.1.8 upstream) (0.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090429171714-9rb08pcxwl02e0bq
Tags: 0.94.dfsg.2-1ubuntu0.3~dapper2
No change rebuild from backports

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (C) 2002 - 2005 Tomasz Kojm <tkojm@clamav.net>
3
 
 *  With enhancements from Thomas Lamy <Thomas.Lamy@in-online.net>
 
2
 *  Copyright (C) 2007-2008 Sourcefire, Inc.
 
3
 *
 
4
 *  Authors: Tomasz Kojm
4
5
 *
5
6
 *  This program is free software; you can redistribute it and/or modify
6
7
 *  it under the terms of the GNU General Public License version 2 as
22
23
 
23
24
#include <sys/types.h>
24
25
 
25
 
#define MAGIC_BUFFER_SIZE 256
 
26
#include "clamav.h"
 
27
#include "cltypes.h"
 
28
 
 
29
#define MAGIC_BUFFER_SIZE 1024
26
30
#define CL_TYPENO 500
27
31
#define MAX_EMBEDDED_OBJ 10
28
32
 
29
33
typedef enum {
30
 
    CL_TYPE_UNKNOWN_TEXT = CL_TYPENO,
31
 
    CL_TYPE_UNKNOWN_DATA,
 
34
    CL_TYPE_TEXT_ASCII = CL_TYPENO, /* X3.4, ISO-8859, non-ISO ext. ASCII */
 
35
    CL_TYPE_TEXT_UTF8,
 
36
    CL_TYPE_TEXT_UTF16LE,
 
37
    CL_TYPE_TEXT_UTF16BE,
 
38
    CL_TYPE_BINARY_DATA,
 
39
    /* Please do not add any new types above this line */
 
40
    CL_TYPE_ERROR,
32
41
    CL_TYPE_MSEXE,
 
42
    CL_TYPE_PE_DISASM,
33
43
    CL_TYPE_ELF,
34
 
    CL_TYPE_DATA,
35
44
    CL_TYPE_POSIX_TAR,
36
45
    CL_TYPE_OLD_TAR,
37
46
    CL_TYPE_GZ,
52
61
    CL_TYPE_CRYPTFF,
53
62
    CL_TYPE_PDF,
54
63
    CL_TYPE_UUENCODED,
 
64
    CL_TYPE_SCRIPT,
55
65
    CL_TYPE_HTML_UTF16,
56
66
    CL_TYPE_RTF,
57
67
 
64
74
    CL_TYPE_CABSFX,
65
75
    CL_TYPE_ARJSFX,
66
76
    CL_TYPE_NULSFT, /* on the fly */
67
 
    CL_TYPE_AUTOIT
 
77
    CL_TYPE_AUTOIT,
 
78
    CL_TYPE_IGNORED /* please don't add anything below */
68
79
} cli_file_t;
69
80
 
 
81
struct cli_ftype {
 
82
    cli_file_t type;
 
83
    uint32_t offset;
 
84
    unsigned char *magic;
 
85
    char *tname;
 
86
    struct cli_ftype *next;
 
87
    uint16_t length;
 
88
};
 
89
 
70
90
struct cli_matched_type {
71
 
    cli_file_t type;
 
91
    struct cli_matched_type *next;
72
92
    off_t offset;
 
93
    cli_file_t type;
73
94
    unsigned short cnt;
74
 
    struct cli_matched_type *next;
75
95
};
76
96
 
77
 
cli_file_t cli_filetype(const unsigned char *buf, size_t buflen);
 
97
cli_file_t cli_ftcode(const char *name);
 
98
void cli_ftfree(struct cli_ftype *ftypes);
 
99
cli_file_t cli_filetype(const unsigned char *buf, size_t buflen, const struct cl_engine *engine);
78
100
cli_file_t cli_filetype2(int desc, const struct cl_engine *engine);
79
101
int cli_addtypesigs(struct cl_engine *engine);
80
102