Skyld AV  0.6
On access virus scanning for Linux
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Environment.cc
Go to the documentation of this file.
1 /*
2  * File: Environment.cc
3  *
4  * Copyright 2013 Heinrich Schuchardt <xypron.glpk@gmx.de>
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19 
24 #include "Environment.h"
25 
30  excludepath = new StringSet();
31  localfs = new StringSet();
32  nomarkfs = new StringSet();
33  nomarkmnt = new StringSet();
34  scache = new ScanCache(this);
35  nThreads = 4;
36  cacheMaxSize = 10000;
38 }
39 
47  return cleanCacheOnUpdate;
48 }
49 
56  return excludepath;
57 }
58 
65  return nomarkfs;
66 }
67 
74  return nomarkmnt;
75 }
76 
84  return localfs;
85 }
86 
93  return cacheMaxSize;
94 }
95 
101 void Environment::setCacheMaxSize(unsigned int size) {
102  cacheMaxSize = size;
103 }
104 
111  return scache;
112 }
113 
120  return nThreads;
121 }
122 
130  cleanCacheOnUpdate = value;
131 }
132 
139  nThreads = n;
140 }
141 
146  delete localfs;
147  delete excludepath;
148  delete nomarkfs;
149  delete nomarkmnt;
150  delete scache;
151 }
ScanCache * scache
Cache for scan results.
Definition: Environment.h:77
int cleanCacheOnUpdate
Clean cache when the virus scanner receives a new pattern file.
Definition: Environment.h:85
virtual ~Environment()
Destroys the environment.
Definition: Environment.cc:145
StringSet * getLocalFileSystems()
Gets the list of file systems considered local. This list can be used to decide if scan results shall...
Definition: Environment.cc:83
StringSet * excludepath
Paths to be excluded from scanning.
Definition: Environment.h:57
void setCacheMaxSize(unsigned int)
Sets the maximum number of entries in the cache with scan results.
Definition: Environment.cc:101
unsigned int cacheMaxSize
Maximum cache size.
Definition: Environment.h:81
Set of pointers to strings.
Definition: StringSet.h:56
StringSet * getNoMarkMounts()
Gets the list of mounts not to be scanned.
Definition: Environment.cc:73
Environment()
Creates a new environment.
Definition: Environment.cc:29
StringSet * nomarkmnt
Mounts that shall not be scanned.
Definition: Environment.h:69
void setCleanCacheOnUpdate(int)
Sets if cache shall be cleaned when the virus scanner receives a new pattern file.
Definition: Environment.cc:129
int isCleanCacheOnUpdate()
Determines if cache shall be cleaned when the virus scanner receives a new pattern file...
Definition: Environment.cc:46
Cache for virus scanning results.
Definition: ScanCache.h:108
void setNumberOfThreads(int)
sets the number of threads used to call the virus scanner.
Definition: Environment.cc:138
ScanCache * getScanCache()
Gets the scan cache.
Definition: Environment.cc:110
StringSet * getNoMarkFileSystems()
Gets the list of file systems that shall not be scanned.
Definition: Environment.cc:64
Envronment.
StringSet * localfs
File systems for local drives.
Definition: Environment.h:61
int getNumberOfThreads()
Gets the number of threads used to call the virus scanner.
Definition: Environment.cc:119
StringSet * nomarkfs
File systems which shall not be scanned.
Definition: Environment.h:65
int nThreads
Number of threads for virus scanning.
Definition: Environment.h:73
unsigned int getCacheMaxSize()
Gets the maximum number of entries in the cache with scan results.
Definition: Environment.cc:92
StringSet * getExcludePaths()
Gets the set of paths that shall not be scanned.
Definition: Environment.cc:55