NAME
SAVI - Perl module interface to Sophos Anti-Virus Engine
DESCRIPTION
Initialization
- $savi = new SAVI();
-
Creates a new instance of the virus scanning engine. Returns a reference to an object of type SAVI on success or a numeric error code on failure.
SAVI methods
- $error = $savi->load_data(vdl_dir, ide_dir);
-
Explicitly loads or reloads virus data. Virus data is automatically loaded the first time it is needed, or can be explicitly loaded with this function. This function can also be used to refresh virus data within an existing SAVI object. The optional parameters define where the main virus data and the ancillary ide files can be found. If neither are supplied, the default environment variable SAV_IDE is used. If the second parameter is not supplied the value of the first will be used for both. Returns undef on success or a numeric error code on failure.
- $version = $savi->version();
-
Returns a reference to an object of type SAVI::version on success, a numeric error code in the case of failure of the underlying API call, or undef upon failure to allocate memory.
- $savi->stale();
-
Returns true if the virus data in use is stale and should be reloaded. This is implemented by saving the mtime of the IDE directory when the virus data is loaded and comparing the current mtime of that directory to the saved value. If the current mtime is greater than the saved value, the virus data is assumed to be stale.
- @options = $savi->options();
-
Returns an array listing valid options for the in-use version of the SAVI engine.
- $error = $savi->set(param, value);
-
Sets the given parameter to the given value. Returns undef on success and a numeric error code on failure.
- ($value, $error) = $savi->get(param);
-
Returns the current value of the given parameter. $error is undef on success and a numeric error code on failure.
- $results = $savi->scan(path);
-
Initiates a scan on the given file. Returns a reference to an object of type SAVI::results on success, or a numeric error code on failure.
- $results = $savi->scan_fh(FH);
-
Initiates a scan on the given file handle. Returns a reference to an object of type SAVI::results on success, or a numeric error code on failure.
- $savi->error_string(code);
-
Returns an error message corresponding to the given code. Can also be called as SAVI->error_string(code) if the failure resulted from initializing the $savi object itself.
SAVI::version methods
- @ide_list = $version->ide_list
-
Returns a list of references to objects of type SAVI::ide, describing what virus definition files are in use.
SAVI::ide methods
SAVI::results methods
AUTHOR
Paul B. Henson <henson@acm.org>
SEE ALSO
perl(1).