Skip to main content
Version: 16.10.0

API overview

Types

The API makes available three enumerations for use by clients as argument types to certain API functions. Include the header file glasswall.core2.api.h in your source file and use the enumerators when calling the API functions.

Policy_format

The enumeration Policy_format is used to specify the format of the policies file. The following enumerator is available:

PF_XML

Analysis_format

The enumeration Analysis_format is used to specify the format of the analysis file. The following enumerator is available:

AF_XML

ft_t

The enumeration ft_t is used to indicate the file type (file format) of a file. Include header file filetype.h in your source code files to use them.

Return types

Most of the functions in the Glasswall API return a value that indicates success or failure. The values and their meaning are listed below.

ValueSystem nameMeaningProcessing response
1gw2ret_ok_withcleaningThe file was processed successfully. Sanitisations or remedies, or both, have been applied.Managed file produced
0gw2ret_okThe file was processed successfully. No sanitisations or remedies have been applied.Managed file produced
-1gw2ret_generalfailGeneral failure during processing, a system or resource problemEngine Error.
-2gw2ret_unexpectedEndOfFileEnd of file, or End of file marker was detected unexpectedly.File Processed but discarded.
-3gw2ret_licenseExpiredLicense file expired, data incorrect or missing.Engine Error.
-4gw2ret_incorrectSessionSetupA policy file setting is not a valid value (see XSD). Or a registration is incompatible. e.g. trying to register and input file and input buffer when you can only have one source.Engine Error.
-5gw2ret_incorrectPolicySetupPolicy file unable to be loaded or content error.Engine Error.
-6gw2ret_unableToLoadInputUnable to load input file or access the buffer containing it.Engine Error.
-7gw2ret_fileTypeUnknownUnable to determine filetypeUnrecognized File.
-8gw2ret_unknownSessionIDSession ID used in API call did not appear in list of active Sessions. Session either not created or already deleted.Engine Error.
-9gw2ret_argumentErrorOne of the arguments in a API call was invalid.Engine Error.
-10gw2ret_unableToLoadImportUnable to load import data file or access the buffer containing it.Engine Error.
-11gw2ret_cameraDidNotInitialiseA camera plugin failed to initialize.Engine Error.
-12gw2ret_noCamerasConnectedNo camera plugins have been loaded.Engine Error.
-13gw2ret_engineeringOnlyGoesToFileUnused. Reserved for future use.Engine Error.
-14gw2ret_unableToWriteOutputUnable to write output file or the buffer expecting it.Engine Error.
-15gw2ret_unableToWriteExportUnable to write export data file or the buffer expecting it.Engine Error.
-16gw2ret_fileRejectedFile was Processed successfully but disallowed by policy setting. See analysis or GW2FileErrorMsg API call.File Processed but discarded.
-17gw2ret_unableToWriteExportTextDumpUnable to write text export output file.Engine Error.
-18gw2ret_unableToWriteAnalysisReportUnable to write analysis report output file.Engine Error.
-19gw2ret_inputTooLargeInput file size is above 2GiB limit.Invalid File.
-20gw2ret_inputZeroBytesInput file size is 0 bytes.Invalid File.

Clean recognised

ValueSystem name
1gw2ret_ok_withcleaning
0gw2ret_ok

CorruptedRecognised

ValueSystem name
-2gw2ret_unexpectedEndOfFile
-16gw2ret_fileRejected

Unrecognised file

ValueSystem name
-7gw2ret_fileTypeUnknown

Engine error

ValueSystem name
-1gw2ret_generalfail
-3gw2ret_licenseExpired
-4gw2ret_incorrectSessionSetup
-5gw2ret_incorrectPolicySetup
-6gw2ret_unableToLoadInput
-8gw2ret_unknownSessionID
-9gw2ret_argumentError
-10gw2ret_unableToLoadImport
-11gw2ret_cameraDidNotInitialise
-12gw2ret_noCamerasConnected
-13gw2ret_engineeringOnlyGoesToFile
-14gw2ret_unableToWriteOutput
-15gw2ret_unableToWriteExport
-17gw2ret_unableToWriteExportTextDump
-18gw2ret_unableToWriteAnalysisReport

Invalid file

ValueSystem name
-19gw2ret_inputTooLarge
-20gw2ret_inputZeroBytes

Each of the functions described in API functions assumes that one of these values is returned unless stated otherwise in the detailed description.