~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to docs/html/node46.html

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
8
8
<HTML>
9
9
<HEAD>
10
 
<TITLE>Engine structure</TITLE>
11
 
<META NAME="description" CONTENT="Engine structure">
 
10
<TITLE>Database loading</TITLE>
 
11
<META NAME="description" CONTENT="Database loading">
12
12
<META NAME="keywords" CONTENT="clamdoc">
13
13
<META NAME="resource-type" CONTENT="document">
14
14
<META NAME="distribution" CONTENT="global">
18
18
 
19
19
<LINK REL="STYLESHEET" HREF="clamdoc.css">
20
20
 
 
21
<LINK REL="next" HREF="node47.html">
21
22
<LINK REL="previous" HREF="node45.html">
22
23
<LINK REL="up" HREF="node43.html">
23
24
<LINK REL="next" HREF="node47.html">
26
27
<BODY >
27
28
 
28
29
<DIV CLASS="navigation"><!--Navigation Panel-->
29
 
<A NAME="tex2html805"
 
30
<A NAME="tex2html821"
30
31
  HREF="node47.html">
31
32
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
32
 
<A NAME="tex2html801"
 
33
<A NAME="tex2html817"
33
34
  HREF="node43.html">
34
35
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
35
 
<A NAME="tex2html797"
 
36
<A NAME="tex2html811"
36
37
  HREF="node45.html">
37
38
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
38
 
<A NAME="tex2html803"
 
39
<A NAME="tex2html819"
39
40
  HREF="node1.html">
40
41
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>  
41
42
<BR>
42
 
<B> Next:</B> <A NAME="tex2html806"
43
 
  HREF="node47.html">Limits</A>
44
 
<B> Up:</B> <A NAME="tex2html802"
45
 
  HREF="node43.html">Initialization</A>
46
 
<B> Previous:</B> <A NAME="tex2html798"
47
 
  HREF="node45.html">Error handling</A>
48
 
 &nbsp; <B>  <A NAME="tex2html804"
 
43
<B> Next:</B> <A NAME="tex2html822"
 
44
  HREF="node47.html">Error handling</A>
 
45
<B> Up:</B> <A NAME="tex2html818"
 
46
  HREF="node43.html">API</A>
 
47
<B> Previous:</B> <A NAME="tex2html812"
 
48
  HREF="node45.html">Initialization</A>
 
49
 &nbsp; <B>  <A NAME="tex2html820"
49
50
  HREF="node1.html">Contents</A></B> 
50
51
<BR>
51
52
<BR></DIV>
52
53
<!--End of Navigation Panel-->
53
54
 
54
 
<H3><A NAME="SECTION00074300000000000000">
55
 
Engine structure</A>
 
55
<H3><A NAME="SECTION00073300000000000000">
 
56
Database loading</A>
56
57
</H3>
57
 
    When all required databases are loaded you should prepare the detection
58
 
    engine by calling <code>cl_engine_compile()</code>. In case of failure you
59
 
    should still free the memory allocated to the engine with
60
 
    <code>cl_engine_free()</code>:
 
58
    The following set of functions provides an interface for loading
 
59
    the virus database:
61
60
    <PRE>
62
 
        int cl_engine_compile(struct cl_engine *engine);
 
61
        const char *cl_retdbdir(void);
 
62
 
 
63
        int cl_load(const char *path, struct cl_engine *engine,
 
64
                    unsigned int *signo, unsigned int options);
63
65
</PRE>
64
 
    In our example:
 
66
    <code>cl_retdbdir()</code> returns the default (hardcoded) path to the directory
 
67
    with ClamAV databases.
 
68
    <code>cl_load()</code> loads a single database file or all databases from a
 
69
    given directory (when <code>path</code> points to a directory). The second
 
70
    argument is used for passing in the pointer to the engine that should
 
71
    be previously allocated with <code>cl_engine_new()</code>. A number of loaded
 
72
    signatures will be <SPAN  CLASS="textbf">added</SPAN> to <code>signo</code> <A NAME="tex2html23"
 
73
  HREF="footnode.html#foot336"><SUP><SPAN CLASS="arabic">10</SPAN></SUP></A>. The last argument can
 
74
    pass the following flags:
 
75
    
 
76
<UL>
 
77
<LI><SPAN  CLASS="textbf">CL_DB_STDOPT</SPAN>
 
78
<BR>
 
79
This is an alias for a recommended set of scan options.
 
80
</LI>
 
81
<LI><SPAN  CLASS="textbf">CL_DB_PHISHING</SPAN>
 
82
<BR>
 
83
Load phishing signatures.
 
84
</LI>
 
85
<LI><SPAN  CLASS="textbf">CL_DB_PHISHING_URLS</SPAN>
 
86
<BR>
 
87
Initialize the phishing detection module and load .wdb and .pdb files.
 
88
</LI>
 
89
<LI><SPAN  CLASS="textbf">CL_DB_PUA</SPAN>
 
90
<BR>
 
91
Load signatures for Potentially Unwanted Applications.
 
92
</LI>
 
93
<LI><SPAN  CLASS="textbf">CL_DB_OFFICIAL_ONLY</SPAN>
 
94
<BR>
 
95
Only load official signatures from digitally signed databases.
 
96
</LI>
 
97
<LI><SPAN  CLASS="textbf">CL_DB_BYTECODE</SPAN>
 
98
<BR>
 
99
Load bytecode.
 
100
    
 
101
</LI>
 
102
</UL>
 
103
    <code>cl_load()</code> returns <code>CL_SUCCESS</code> on success and another code on
 
104
    failure.
65
105
    <PRE>
66
 
        if((ret = cl_engine_compile(engine)) != CL_SUCCESS) {
67
 
            printf("cl_engine_compile() error: %s\n", cl_strerror(ret));
68
 
            cl_engine_free(engine);
69
 
            return 1;
70
 
        }
 
106
            ...
 
107
            struct cl_engine *engine;
 
108
            unsigned int sigs = 0;
 
109
            int ret;
 
110
 
 
111
        if((ret = cl_init()) != CL_SUCCESS) {
 
112
            printf("cl_init() error: %s\n", cl_strerror(ret));
 
113
            return 1;
 
114
        }
 
115
 
 
116
        if(!(engine = cl_engine_new())) {
 
117
            printf("Can't create new engine\n");
 
118
            return 1;
 
119
        }
 
120
 
 
121
        ret = cl_load(cl_retdbdir(), engine, &amp;sigs, CL_DB_STDOPT);
71
122
</PRE>
72
123
 
73
124
<P>
74
125
<BR><HR>
75
126
<ADDRESS>
76
127
Tomasz Kojm
77
 
2009-10-28
 
128
2010-03-10
78
129
</ADDRESS>
79
130
</BODY>
80
131
</HTML>