Paul B. Henson > SAVI-Perl > SAVI

Download:
SAVI-Perl-0.30.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  1
View/Report Bugs
Module Version: 0.30   Source  

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 ^

$version->string

Returns the version number of the product.

$version->major

Returns the major portion of the version number of the virus engine.

$version->minor

Returns the minor portion of the version number of the virus engine.

$version->count

Returns the number of viruses recognized by the engine.

@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 ^

$ide->name

Returns the name of the virus definition file.

$ide->date

Returns the release date of the virus definition file.

SAVI::results methods ^

$results->infected

Returns true if the scan discovered a virus.

$results->viruses

Returns a list of the viruses discovered by the scan.

AUTHOR ^

Paul B. Henson <henson@acm.org>

SEE ALSO ^

perl(1).

syntax highlighting: