~ubuntu-branches/ubuntu/raring/clamav/raring

« back to all changes in this revision

Viewing changes to libclamav/matcher-ac.h

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran
  • Date: 2008-09-05 17:25:34 UTC
  • mfrom: (0.35.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080905172534-yi3f8fkye1o7u1r3
* New upstream version (closes: #497662, #497773)
  - lots of new options for clamd.conf
  - fixes CVEs CVE-2008-3912, CVE-2008-3913, CVE-2008-3914, and
    CVE-2008-1389
* No longer supports --unzip option, so typo is gone (closes: #496276)
* Translations:
  - sv (thanks Martin Bagge <brother@bsnet.se>) (closes: #491760)

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
struct cli_ac_data {
39
39
    int32_t ***offmatrix;
40
 
    uint32_t partsigs;
 
40
    uint32_t partsigs, lsigs;
 
41
    uint32_t **lsigcnt;
41
42
};
42
43
 
43
44
struct cli_ac_alt {
51
52
    uint16_t *pattern, *prefix, length, prefix_length;
52
53
    uint32_t mindist, maxdist;
53
54
    uint32_t sigid;
 
55
    uint32_t lsigid[3];
 
56
    uint16_t ch[2];
54
57
    char *virname, *offset;
55
 
    uint16_t ch[2];
 
58
    void *customdata;
56
59
    uint16_t ch_mindist[2];
57
60
    uint16_t ch_maxdist[2];
58
61
    uint16_t parts, partno, alt, alt_pattern;
59
62
    struct cli_ac_alt **alttable;
60
63
    struct cli_ac_patt *next, *next_same;
61
64
    uint8_t depth;
62
 
    uint8_t target;
63
65
    uint16_t rtype, type;
64
66
};
65
67
 
69
71
    uint8_t leaf, final;
70
72
};
71
73
 
 
74
struct cli_ac_result {
 
75
    const char *virname;
 
76
    void *customdata;
 
77
    struct cli_ac_result *next;
 
78
};
 
79
 
72
80
#include "matcher.h"
73
81
 
74
82
int cli_ac_addpatt(struct cli_matcher *root, struct cli_ac_patt *pattern);
75
 
int cli_ac_initdata(struct cli_ac_data *data, uint32_t partsigs, uint8_t tracklen);
 
83
int cli_ac_initdata(struct cli_ac_data *data, uint32_t partsigs, uint32_t lsigs, uint8_t tracklen);
 
84
int cli_ac_chklsig(const char *expr, const char *end, uint32_t *lsigcnt, unsigned int *cnt, uint64_t *ids, unsigned int parse_only);
76
85
void cli_ac_freedata(struct cli_ac_data *data);
77
 
int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **virname, const struct cli_matcher *root, struct cli_ac_data *mdata, uint32_t offset, cli_file_t ftype, int fd, struct cli_matched_type **ftoffset, unsigned int mode, const cli_ctx *ctx);
 
86
int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **virname, void **customdata, struct cli_ac_result **res, const struct cli_matcher *root, struct cli_ac_data *mdata, uint32_t offset, cli_file_t ftype, int fd, struct cli_matched_type **ftoffset, unsigned int mode, const cli_ctx *ctx);
78
87
int cli_ac_buildtrie(struct cli_matcher *root);
79
88
int cli_ac_init(struct cli_matcher *root, uint8_t mindepth, uint8_t maxdepth);
80
89
void cli_ac_free(struct cli_matcher *root);
81
 
int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hexsig, uint32_t sigid, uint16_t parts, uint16_t partno, uint16_t rtype, uint16_t type, uint32_t mindist, uint32_t maxdist, const char *offset, uint8_t target);
 
90
int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hexsig, uint32_t sigid, uint16_t parts, uint16_t partno, uint16_t rtype, uint16_t type, uint32_t mindist, uint32_t maxdist, const char *offset, const uint32_t *lsigid, unsigned int options);
82
91
void cli_ac_setdepth(uint8_t mindepth, uint8_t maxdepth);
83
92
 
84
93
#endif