- enum name change : CSR_ENABLE -> CSR_STATE_ENABLE, CSR_DISABLE -> CSR_STATE_DISABLE
- error code change : CSR_ERROR_UNKNOWN -> CSR_ERROR_SYSTEM
- user_data parameter after other parameters in callback functions
- error description for error callback
- @pre tag added in async scanning method
- csr_cs_cancel_scanning description changed
- @detail tag right after @brief
Change-Id: Ib0c60f40a43fd14ba10e5f2758d1ebc7f3512e23
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
auto ec = retFiles.first;
return std::make_pair(Callback::Id::OnError, [this, ec] {
if (this->m_cb.onError)
- this->m_cb.onError(this->m_userdata, ec);
+ this->m_cb.onError(ec, this->m_userdata);
});
}
auto ec = ret.first;
return std::make_pair(Callback::Id::OnError, [this, ec] {
if (this->m_cb.onError)
- this->m_cb.onError(this->m_userdata, ec);
+ this->m_cb.onError(ec, this->m_userdata);
return;
});
m_results.emplace_back(std::move(resultPtr));
if (m_cb.onDetected)
- m_cb.onDetected(m_userdata, reinterpret_cast<csr_cs_malware_h>(ret.second));
+ m_cb.onDetected(reinterpret_cast<csr_cs_malware_h>(ret.second), m_userdata);
} else {
DEBUG("[Scanned] file[" << file << "]");
if (m_cb.onScanned)
- m_cb.onScanned(m_userdata, file.c_str());
+ m_cb.onScanned(file.c_str(), m_userdata);
}
}
return *this;
}
- std::function<void(void *, const char *)> onScanned;
- std::function<void(void *, csr_cs_malware_h)> onDetected;
+ std::function<void(const char *, void *)> onScanned;
+ std::function<void(csr_cs_malware_h, void *)> onDetected;
std::function<void(void *)> onCompleted;
std::function<void(void *)> onCancelled;
- std::function<void(void *, int)> onError;
+ std::function<void(int, void *)> onError;
};
}
bool _isValid(const csr_state_e &state) noexcept
{
switch (state) {
- case CSR_ENABLE:
- case CSR_DISABLE:
+ case CSR_STATE_ENABLE:
+ case CSR_STATE_DISABLE:
return true;
default:
return CSR_ERROR_OUT_OF_MEMORY;
} catch (const std::exception &e) {
ERROR("std exception: " << e.what());
- return CSR_ERROR_UNKNOWN;
+ return CSR_ERROR_SYSTEM;
} catch (...) {
ERROR("Unknown exception occured!");
- return CSR_ERROR_UNKNOWN;
+ return CSR_ERROR_SYSTEM;
}
}
{
EXCEPTION_GUARD_START
- if (this->m_db.getEngineState(CSR_ENGINE_CS) != CSR_ENABLE)
+ if (this->m_db.getEngineState(CSR_ENGINE_CS) != CSR_STATE_ENABLE)
ThrowExc(EngineDisabled, "engine is disabled");
setCoreUsage(context.coreUsage);
{
EXCEPTION_GUARD_START
- if (this->m_db.getEngineState(CSR_ENGINE_CS) != CSR_ENABLE)
+ if (this->m_db.getEngineState(CSR_ENGINE_CS) != CSR_STATE_ENABLE)
ThrowExc(EngineDisabled, "engine is disabled");
setCoreUsage(context.coreUsage);
{
EXCEPTION_GUARD_START
- if (this->m_db.getEngineState(CSR_ENGINE_CS) != CSR_ENABLE)
+ if (this->m_db.getEngineState(CSR_ENGINE_CS) != CSR_STATE_ENABLE)
ThrowExc(EngineDisabled, "engine is disabled");
auto lastScanTime = this->m_db.getLastScanTime(dir, this->m_dataVersion);
bool _isValid(const csr_state_e &state)
{
switch (state) {
- case CSR_ENABLE:
- case CSR_DISABLE:
+ case CSR_STATE_ENABLE:
+ case CSR_STATE_DISABLE:
return true;
default:
{
EXCEPTION_GUARD_START
- if (this->m_db.getEngineState(context.engineId) != CSR_ENABLE)
+ if (this->m_db.getEngineState(context.engineId) != CSR_STATE_ENABLE)
ThrowExc(EngineDisabled, "engine is disabled");
if (context.engineId == CSR_ENGINE_CS) {
{
EXCEPTION_GUARD_START
- if (this->m_db.getEngineState(context.engineId) != CSR_ENABLE)
+ if (this->m_db.getEngineState(context.engineId) != CSR_STATE_ENABLE)
ThrowExc(EngineDisabled, "engine is disabled");
if (context.engineId == CSR_ENGINE_CS) {
{
EXCEPTION_GUARD_START
- if (this->m_db.getEngineState(context.engineId) != CSR_ENABLE)
+ if (this->m_db.getEngineState(context.engineId) != CSR_STATE_ENABLE)
ThrowExc(EngineDisabled, "engine is disabled");
if (context.engineId == CSR_ENGINE_CS) {
{
EXCEPTION_GUARD_START
- if (this->m_db.getEngineState(context.engineId) != CSR_ENABLE)
+ if (this->m_db.getEngineState(context.engineId) != CSR_STATE_ENABLE)
ThrowExc(EngineDisabled, "engine is disabled");
if (context.engineId == CSR_ENGINE_CS) {
{
EXCEPTION_GUARD_START
- if (this->m_db.getEngineState(context.engineId) != CSR_ENABLE)
+ if (this->m_db.getEngineState(context.engineId) != CSR_STATE_ENABLE)
ThrowExc(EngineDisabled, "engine is disabled");
if (context.engineId == CSR_ENGINE_CS) {
{
EXCEPTION_GUARD_START
- if (this->m_db.getEngineState(context.engineId) != CSR_ENABLE)
+ if (this->m_db.getEngineState(context.engineId) != CSR_STATE_ENABLE)
ThrowExc(EngineDisabled, "engine is disabled");
csr_activated_e activated = CSR_NOT_ACTIVATED;
auto state = this->m_db.getEngineState(context.engineId);
return BinaryQueue::Serialize(CSR_ERROR_NONE,
- static_cast<int>(state) == -1 ? static_cast<int>(CSR_DISABLE) :
+ static_cast<int>(state) == -1 ? static_cast<int>(CSR_STATE_DISABLE) :
static_cast<int>(state)).pop();
EXCEPTION_GUARD_END
return BinaryQueue::Serialize(CSR_ERROR_OUT_OF_MEMORY).pop();
} catch (const std::exception &e) {
ERROR("std exception: " << e.what());
- return BinaryQueue::Serialize(CSR_ERROR_UNKNOWN).pop();
+ return BinaryQueue::Serialize(CSR_ERROR_SYSTEM).pop();
} catch (...) {
ERROR("Unknown exception occured in logic");
- return BinaryQueue::Serialize(CSR_ERROR_UNKNOWN).pop();
+ return BinaryQueue::Serialize(CSR_ERROR_SYSTEM).pop();
}
}
{
EXCEPTION_GUARD_START
- if (this->m_db.getEngineState(CSR_ENGINE_WP) != CSR_ENABLE)
+ if (this->m_db.getEngineState(CSR_ENGINE_WP) != CSR_STATE_ENABLE)
ThrowExc(EngineDisabled, "engine is disabled");
WpEngineContext engineContext(this->m_loader);
* @remarks Only for asynchronous scan functions.
* @remarks Called for each file or application which is not detected malware.
*
- * @param[in] user_data A pointer of a user data. It's provided by client
- * when calling asyncronous scanning method.
* @param[in] file_path A path of the file scanned. It would be package path if it's
* in application.
+ * @param[in] user_data A pointer of a user data. It's provided by client
+ * when calling asyncronous scanning method.
*
* @see csr_cs_set_file_scanned_cb()
* @see csr_cs_scan_files_async()
* @see csr_cs_scan_dir_async()
* @see csr_cs_scan_dirs_async()
*/
-typedef void (*csr_cs_file_scanned_cb)(void *user_data, const char *file_path);
+typedef void (*csr_cs_file_scanned_cb)(const char *file_path, void *user_data);
/**
* @brief Called when each file scanning is done with malware.
* @remarks Only for asynchronous scan functions.
* @remarks Called for each file or application which is detected malware.
*
+ * @param[in] malware The detected malware handle.
* @param[in] user_data A pointer of a user data. It's provided by client
* when calling asyncronous scanning method.
- * @param[in] malware The detected malware handle.
*
* @see csr_cs_set_detected_cb()
* @see csr_cs_scan_files_async()
* @see csr_cs_scan_dir_async()
* @see csr_cs_scan_dirs_async()
*/
-typedef void (*csr_cs_detected_cb)(void *user_data, csr_cs_malware_h malware);
+typedef void (*csr_cs_detected_cb)(csr_cs_malware_h malware, void *user_data);
/**
* @brief Called when scanning is finished successfully.
/**
* @brief Called when scanning is stopped with an error.
*
+ * @details The following error codes can be delivered.\n
+ * #CSR_ERROR_FILE_DO_NOT_EXIST,\n
+ * #CSR_ERROR_SOCKET,\n
+ * #CSR_ERROR_SERVER,\n
+ * #CSR_ERROR_ENGINE_NOT_EXIST,\n
+ * #CSR_ERROR_ENGINE_DISABLED,\n
+ * #CSR_ERROR_ENGINE_NOT_ACTIVATED,\n
+ * #CSR_ERROR_ENGINE_PERMISSION,\n
+ * #CSR_ERROR_ENGINE_INTERNAL
+ *
* @since_tizen 3.0
*
* @remarks Only for asynchronous scan functions.
* @remarks Called only once at the end of scanning when failed with error.
*
+ * @param[in] error_code Error code of #csr_error_e defined in csr-error.h
* @param[in] user_data A pointer of a user data. It's provided by client
* when calling asynchronous scanning method.
- * @param[in] error_code Error code of #csr_error_e defined in csr-error.h
*
* @see csr_cs_set_error_cb()
* @see csr_cs_scan_files_async()
* @see csr_cs_scan_dir_async()
* @see csr_cs_scan_dirs_async()
*/
-typedef void (*csr_cs_error_cb)(void *user_data, int error_code);
+typedef void (*csr_cs_error_cb)(int error_code, void *user_data);
/**
* @}
/**
* @brief Initializes and returns a Content Screening API handle.
*
+ * @details A Content Screening API handle (or CSR CS handle) is obtained by this method.
+ * The handle is required for subsequent CSR CS API calls.
+ *
* @since_tizen 3.0
*
* @remarks The @a handle should be released using csr_cs_context_destroy().
* @remarks Multiple handles can be obtained.
*
- * @details A Content Screening API handle (or CSR CS handle) is obtained by this method.
- * The handle is required for subsequent CSR CS API calls.
- *
* @param[out] handle A pointer of CSR CS context handle.
*
* @return #CSR_ERROR_NONE on success, otherwise a negative error value
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE @a handle may be null
* @retval #CSR_ERROR_OUT_OF_MEMORY Not enough memory
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_context_destroy()
*/
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid handle
* @retval #CSR_ERROR_SOCKET Socket error between client and server
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_context_create()
*/
/**
* @brief Sets a popup option for malware detected.
*
- * @since_tizen 3.0
- *
- * @remarks This option is disabled(#CSR_CS_NOT_ASK_USER) as a default.
- *
* @details If #CSR_CS_ASK_USER is set, a popup will be prompted to a user when a malware
* is detected. If #CSR_CS_NOT_ASK_USER is set which is default value, no popup
* will be prompted even if a malware is detected. User can allow, disallow and
* remove detected malware by popup. Selection can be different between malware's
* severity.
*
+ * @since_tizen 3.0
+ *
+ * @remarks This option is disabled(#CSR_CS_NOT_ASK_USER) as a default.
+ *
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] ask_user Popup option to set or unset.
*
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a ask_user is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_context_create()
* @see csr_cs_context_destroy()
/**
* @brief Sets a popup message of a client in case that a malware is detected.
*
+ * @details Default message is "Malware which may harm your device is detected.".
+ *
* @since_tizen 3.0
*
* @remarks Meaningful only when ask user option is set by csr_cs_set_ask_user().
* @remarks The message will be printed on popup for user.
* @remarks Default popup message will be used if it isn't set.
*
- * @details Default message is "Malware which may harm your device is detected.".
- *
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] message A message to print on a popup.
*
* @retval #CSR_ERROR_INVALID_HANDLE Invalid handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a message is too long or empty. Max size
* is 64 bytes.
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_context_create()
* @see csr_cs_context_destroy()
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a usage is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_context_create()
* @see csr_cs_context_destroy()
*
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid handle
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_context_create()
* @see csr_cs_context_destroy()
/**
* @brief Scans a data buffer for malware.
*
+ * @details @a malware result of this method is not available for being judged by
+ * csr_cs_judge_detected_malware() because it's data, not file, so cannot being
+ * removed or ignored.
+ *
* @since_tizen 3.0
* @privlevel partner
* @privilege %http://tizen.org/privilege/antivirus.scan
* @remarks The @a malware will be released when @a handle is released using
* csr_cs_context_destroy().
*
- * @details @a malware result of this method is not available for being judged by
- * csr_cs_judge_detected_malware() because it's data, not file, so cannot being
- * removed or ignored.
- *
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] data A scan target data.
* @param[in] length A size of a scan target data.
* @retval #CSR_ERROR_ENGINE_DISABLED Engine is in disabled state
* @retval #CSR_ERROR_ENGINE_NOT_ACTIVATED Engine is not activated
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_context_create()
* @see csr_cs_context_destroy()
* @retval #CSR_ERROR_ENGINE_NOT_ACTIVATED Engine is not activated
* @retval #CSR_ERROR_ENGINE_PERMISSION Insufficient permission of engine
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_context_create()
* @see csr_cs_context_destroy()
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a callback is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_scan_files_async()
* @see csr_cs_scan_dir_async()
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a callback is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_scan_files_async()
* @see csr_cs_scan_dir_async()
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a callback is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_scan_files_async()
* @see csr_cs_scan_dir_async()
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a callback is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_scan_files_async()
* @see csr_cs_scan_dir_async()
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a callback is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_scan_files_async()
* @see csr_cs_scan_dir_async()
/**
* @brief Scan files specified by an array of file paths for malware.
*
- * @since_tizen 3.0
- * @privlevel partner
- * @privilege %http://tizen.org/privilege/antivirus.scan
- *
- * @remarks Asynchronous function.
- * @remarks The caller should set callback functions before call this method.
- * @remarks Detected malware which is provided to the callback will be released when
- * @a handle is released using csr_cs_context_destroy().
- *
* @details If scanning of the single file is done without detected malware,
* csr_cs_file_scanned_cb() called and else if malware detected
* csr_cs_detected_cb() called. If scanning is cancelled by
* setter methods to @a handle and if callback is not registered, it will just
* skipped to be called.
*
+ * @since_tizen 3.0
+ * @privlevel partner
+ * @privilege %http://tizen.org/privilege/antivirus.scan
+ *
+ * @remarks Asynchronous function.
+ * @remarks The caller should set callback functions before call this method.
+ * @remarks Detected malware which is provided to the callback will be released when
+ * @a handle is released using csr_cs_context_destroy().
+ *
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] file_paths An array of scan target files.
* @param[in] count A number of scan target files.
* @retval #CSR_ERROR_ENGINE_DISABLED Engine is in disabled state
* @retval #CSR_ERROR_ENGINE_NOT_ACTIVATED Engine is not activated
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
+ *
+ * @pre It is required to set callbacks, csr_cs_completed_cb, csr_cs_error_cb(),
+ * csr_cs_cancel_scanning(), csr_cs_detected_cb(), and/or csr_cs_file_scanned_cb().
*
* @see csr_cs_set_file_scanned_cb()
* @see csr_cs_set_detected_cb()
/**
* @brief Scans a directory specified by directory path for malware.
*
- * @since_tizen 3.0
- * @privlevel partner
- * @privilege %http://tizen.org/privilege/antivirus.scan
- *
- * @remarks Asynchronous function.
- * @remarks The caller should set callback functions before calls this method.
- * @remarks Detected malware which is provided to the callback will be released when
- * @a handle is released using csr_cs_context_destroy().
- *
* @details If scanning of the single file is done without detected malware,
* csr_cs_file_scanned_cb() called and else if malware detected
* csr_cs_detected_cb() called. If scanning is cancelled by
* setter methods to @a handle and if callback is not registered, it will just
* skipped to be called.
*
+ * @since_tizen 3.0
+ * @privlevel partner
+ * @privilege %http://tizen.org/privilege/antivirus.scan
+ *
+ * @remarks Asynchronous function.
+ * @remarks The caller should set callback functions before calls this method.
+ * @remarks Detected malware which is provided to the callback will be released when
+ * @a handle is released using csr_cs_context_destroy().
+ *
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] dir_path A path of scan target directory.
* @param[in] user_data The pointer of a user data. It can be null. It is used on
* @retval #CSR_ERROR_ENGINE_DISABLED Engine is in disabled state
* @retval #CSR_ERROR_ENGINE_NOT_ACTIVATED Engine is not activated
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
+ *
+ * @pre It is required to set callbacks, csr_cs_completed_cb, csr_cs_error_cb(),
+ * csr_cs_cancel_scanning(), csr_cs_detected_cb(), and/or csr_cs_file_scanned_cb().
*
* @see csr_cs_set_file_scanned_cb()
* @see csr_cs_set_detected_cb()
/**
* @brief Scan directories specified by an array of directory paths for malware.
*
- * @since_tizen 3.0
- * @privlevel partner
- * @privilege %http://tizen.org/privilege/antivirus.scan
- *
- * @remarks Asynchronous function.
- * @remarks The caller should set callback functions before calls this method.
- * @remarks Detected malware which is provided to the callback will be released when
- * @a handle is released using csr_cs_context_destroy().
- *
* @details If scanning of the single file is done without detected malware,
* csr_cs_file_scanned_cb() called and else if malware detected
* csr_cs_detected_cb() called. If scanning is cancelled by
* setter methods to @a handle and if callback is not registered, it will just
* skipped to be called.
*
+ * @since_tizen 3.0
+ * @privlevel partner
+ * @privilege %http://tizen.org/privilege/antivirus.scan
+ *
+ * @remarks Asynchronous function.
+ * @remarks The caller should set callback functions before calls this method.
+ * @remarks Detected malware which is provided to the callback will be released when
+ * @a handle is released using csr_cs_context_destroy().
+ *
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] dir_paths An array of scan target directories.
* @param[in] count A number of scan target directories.
* @retval #CSR_ERROR_ENGINE_DISABLED Engine is in disabled state
* @retval #CSR_ERROR_ENGINE_NOT_ACTIVATED Engine is not activated
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
+ *
+ * @pre It is required to set callbacks, csr_cs_completed_cb, csr_cs_error_cb(),
+ * csr_cs_cancel_scanning(), csr_cs_detected_cb(), and/or csr_cs_file_scanned_cb().
*
* @see csr_cs_set_file_scanned_cb()
* @see csr_cs_set_detected_cb()
/**
- * @brief Cancels a running scanning task.
+ * @brief Cancels a running scanning task, asynchronously.
*
* @since_tizen 3.0
*
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid handle
* @retval #CSR_ERROR_NO_TASK No task to cancel
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_scan_files_async()
* @see csr_cs_scan_dir_async()
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid detected malware handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a severity is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*/
int csr_cs_malware_get_severity(csr_cs_malware_h malware,
csr_cs_severity_level_e *severity);
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid detected malware handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a name is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*/
int csr_cs_malware_get_name(csr_cs_malware_h malware, char **name);
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid detected malware handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a detailed_url is invalid.
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*/
int csr_cs_malware_get_detailed_url(csr_cs_malware_h malware, char **detailed_url);
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid detected malware handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a timestamp is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*/
int csr_cs_malware_get_timestamp(csr_cs_malware_h malware, time_t *timestamp);
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid detected malware handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a file_name is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*/
int csr_cs_malware_get_file_name(csr_cs_malware_h malware, char **file_name);
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid result handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a response is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*/
int csr_cs_malware_get_user_response(csr_cs_malware_h malware,
csr_cs_user_response_e *response);
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid result handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a is_app is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*/
int csr_cs_malware_is_app(csr_cs_malware_h malware, bool *is_app);
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid detected malware handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a pkg_id is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*/
int csr_cs_malware_get_pkg_id(csr_cs_malware_h malware, char **pkg_id);
/**
* @brief Judges how a detected malware file is handled.
*
+ * @details Detected malware will removed by #CSR_CS_ACTION_REMOVE action. File or
+ * application which contains malware will be removed.
+ * Detected malware will ignored by #CSR_CS_ACTION_IGNORE action. File or
+ * application which contains malware will be ignored and will not be treated
+ * as malware until this API called with #CSR_CS_ACTION_UNIGNORE action.
+ *
* @since_tizen 3.0
* @privlevel platform
* @privilege %http://tizen.org/privilege/antivirus.admin
*
* @remarks Detected malware can be removed or ignored.
*
- * @remarks Detected malware will removed by #CSR_CS_ACTION_REMOVE action. File or
- * application which contains malware will be removed.
- * Detected malware will ignored by #CSR_CS_ACTION_IGNORE action. File or
- * application which contains malware will be ignored and will not be treated
- * as malware until this API called with #CSR_CS_ACTION_UNIGNORE action.
- *
* @param[in] handle CSR CS context handle returned by csr_cs_context_create().
* @param[in] malware A handle of a detected malware.
* @param[in] action An action to be taken.
* @retval #CSR_ERROR_SOCKET Socket error between client and server
* @retval #CSR_ERROR_SERVER Server has been failed for some reason
* @retval #CSR_ERROR_DB DB transaction error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*/
int csr_cs_judge_detected_malware(csr_cs_context_h handle, csr_cs_malware_h malware,
csr_cs_action_e action);
* @retval #CSR_ERROR_SOCKET Socket error between client and server
* @retval #CSR_ERROR_SERVER Server has been failed for some reason
* @retval #CSR_ERROR_DB DB transaction error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_cs_scan_data()
* @see csr_cs_scan_file()
* @retval #CSR_ERROR_SOCKET Socket error between client and server
* @retval #CSR_ERROR_SERVER Server has been failed for some reason
* @retval #CSR_ERROR_DB DB transaction error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*/
int csr_cs_get_detected_malwares(csr_cs_context_h handle, const char *dir_paths[],
size_t count, csr_cs_malware_list_h *list,
* @retval #CSR_ERROR_SOCKET Socket error between client and server
* @retval #CSR_ERROR_SERVER Server has been failed for some reason
* @retval #CSR_ERROR_DB DB transaction error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*/
int csr_cs_get_ignored_malware(csr_cs_context_h handle, const char *file_path,
csr_cs_malware_h *malware);
* @retval #CSR_ERROR_SOCKET Socket error between client and server
* @retval #CSR_ERROR_SERVER Server has been failed for some reason
* @retval #CSR_ERROR_DB DB transaction error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*/
int csr_cs_get_ignored_malwares(csr_cs_context_h handle, const char *dir_paths[],
size_t count, csr_cs_malware_list_h *list,
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid list
* @retval #CSR_ERROR_INVALID_PARAMETER @a index or @a malware is invalid.
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*/
int csr_cs_malware_list_get_malware(csr_cs_malware_list_h list, size_t index,
csr_cs_malware_h *malware);
* @since_tizen 3.0
*/
typedef enum {
- CSR_ENABLE = 0x01, /**< Enable engine */
- CSR_DISABLE = 0x02 /**< Disable engine */
+ CSR_STATE_ENABLE = 0x01, /**< Enable engine */
+ CSR_STATE_DISABLE = 0x02 /**< Disable engine */
} csr_state_e;
/**
* @retval #CSR_ERROR_ENGINE_NOT_EXIST No engine exists
* @retval #CSR_ERROR_ENGINE_NOT_ACTIVATED Engine is not activated
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_engine_destroy()
*/
* @retval #CSR_ERROR_INVALID_PARAMETER @a vendor is invalid
* @retval #CSR_ERROR_PERMISSION_DENIED Permission denied
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_get_current_engine()
*/
* @retval #CSR_ERROR_INVALID_PARAMETER @a name is invalid
* @retval #CSR_ERROR_PERMISSION_DENIED Permission denied
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_get_current_engine()
*/
* @retval #CSR_ERROR_INVALID_PARAMETER @a version is invalid
* @retval #CSR_ERROR_PERMISSION_DENIED Permission denied
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_get_current_engine()
*/
* @retval #CSR_ERROR_INVALID_PARAMETER @a version is invalid
* @retval #CSR_ERROR_PERMISSION_DENIED Permission denied
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_get_current_engine()
*/
* @retval #CSR_ERROR_INVALID_PARAMETER @a time is invalid
* @retval #CSR_ERROR_PERMISSION_DENIED Permission denied
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_get_current_engine()
*/
* @retval #CSR_ERROR_INVALID_PARAMETER @a activated is invalid
* @retval #CSR_ERROR_PERMISSION_DENIED Permission denied
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_get_current_engine()
*/
* @retval #CSR_ERROR_INVALID_PARAMETER @a state is invalid
* @retval #CSR_ERROR_PERMISSION_DENIED Permission denied
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_get_current_engine()
*/
* @retval #CSR_ERROR_INVALID_PARAMETER @a state is invalid
* @retval #CSR_ERROR_PERMISSION_DENIED Permission denied
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_get_current_engine()
*/
CSR_ERROR_ENGINE_NOT_EXIST = TIZEN_ERROR_CSR | 0x12, /**< No engine exists*/
CSR_ERROR_ENGINE_DISABLED = TIZEN_ERROR_CSR | 0x13, /**< Engine is in disabled state*/
CSR_ERROR_ENGINE_NOT_ACTIVATED = TIZEN_ERROR_CSR | 0x14, /**< Engine is not activated*/
- CSR_ERROR_ENGINE_INTERNAL = TIZEN_ERROR_CSR | 0x19, /**< Engine Internal error*/
- CSR_ERROR_UNKNOWN = TIZEN_ERROR_CSR | 0xFF, /**< The error with unknown reason */
+ CSR_ERROR_ENGINE_INTERNAL = TIZEN_ERROR_CSR | 0x19, /**< Engine internal error*/
+ CSR_ERROR_SYSTEM = TIZEN_ERROR_CSR | 0xFF, /**< System error*/
} csr_error_e;
/**
* @brief Initializes and returns a CSR Web Protection API handle.
*
+ * @details A Web Protection API handle (or CSR WP handle) is obtained by this method.
+ * The handle is required for subsequent CSR WP API calls.
+ *
* @since_tizen 3.0
*
* @remarks The @a handle should be released using csr_wp_context_destroy().
* @remarks Multiple handles can be obtained.
*
- * @details A Web Protection API handle (or CSR WP handle) is obtained by this method.
- * The handle is required for subsequent CSR WP API calls.
- *
* @param[out] handle A pointer of CSR WP context handle.
*
* @return #CSR_ERROR_NONE on success, otherwise a negative error value
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_OUT_OF_MEMORY Not enough memory
* @retval #CSR_ERROR_INVALID_PARAMETER @a handle is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_wp_context_destroy()
*/
* @retval #CSR_ERROR_SOCKET Socket error between client and server
* @retval #CSR_ERROR_SERVER Server has been failed for some reason
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_wp_context_create()
*/
/**
* @brief Sets a popup option for risky URL checked.
*
- * @since_tizen 3.0
- *
- * @remarks This option is disabled(#CSR_WP_NOT_ASK_USER) as a default.
- *
* @details If #CSR_WP_ASK_USER is set, a popup will be prompted to a user when a URL
* turns out risky. If #CSR_WP_NOT_ASK_USER is set, no popup will be prompted
* even when a URL turns out risky.
*
+ * @since_tizen 3.0
+ *
+ * @remarks This option is disabled(#CSR_WP_NOT_ASK_USER) as a default.
+ *
* @param[in] handle CSR WP context handle returned by csr_wp_context_create().
* @param[in] ask_user A popup option in case for a risky URL.
*
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a ask_user is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_wp_context_create()
*/
/**
* @brief Sets a popup message of a client in case for a risky URL.
*
+ * @details Default message is "Risky URL which may harm your device is detected".
+ *
* @since_tizen 3.0
*
* @remarks Meaningful only when ask user option is set by csr_wp_set_ask_user().
* @remarks The message will be printed on popup for user.
* @remarks Default popup message will be used if it isn't set.
*
- * @details Default message is "Risky URL which may harm your device is detected".
- *
* @param[in] handle CSR WP context handle returned by csr_wp_context_create().
* @param[in] message A message to print on a popup.
*
* @retval #CSR_ERROR_INVALID_HANDLE Invalid handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a message is too long or empty. Max size
* is 64 bytes.
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_wp_context_create()
*/
/**
* @brief Checks URL reputation against the engine vendor's database.
*
+ * @details Checks whether accessing the URL is risky or not and returns a result handle
+ * with the risk level for the URL.
+ *
* @since_tizen 3.0
* @privlevel partner
* @privilege %http://tizen.org/privilege/antivirus.webprotect
* @remarks The @a result will be released when @a handle is released using
* csr_wp_context_destroy().
*
- * @details Checks whether accessing the URL is risky or not and returns a result handle
- * with the risk level for the URL.
- *
* @param[in] handle CSR WP context handle returned by csr_wp_context_create().
* @param[in] url URL to check.
* @param[out] result A pointer of the result handle with the Risk level for the URL.
* @retval #CSR_ERROR_ENGINE_DISABLED Engine is in disabled state
* @retval #CSR_ERROR_ENGINE_NOT_ACTIVATED Engine is not activated
* @retval #CSR_ERROR_ENGINE_INTERNAL Engine Internal error
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_wp_context_create()
* @see csr_wp_set_ask_user()
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid result handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a level is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_wp_check_url()
*/
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid result handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a detailed_url is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_wp_check_url()
*/
* @retval #CSR_ERROR_NONE Successful
* @retval #CSR_ERROR_INVALID_HANDLE Invalid result handle
* @retval #CSR_ERROR_INVALID_PARAMETER @a response is invalid
- * @retval #CSR_ERROR_UNKNOWN Error with unknown reason
+ * @retval #CSR_ERROR_SYSTEM System error
*
* @see csr_wp_check_url()
* @see #csr_wp_user_response_e
Db::Manager db(TEST_DB_FILE, TEST_DB_SCRIPTS);
- db.setEngineState(CSR_ENGINE_CS, CSR_ENABLE);
- db.setEngineState(CSR_ENGINE_WP, CSR_DISABLE);
+ db.setEngineState(CSR_ENGINE_CS, CSR_STATE_ENABLE);
+ db.setEngineState(CSR_ENGINE_WP, CSR_STATE_DISABLE);
- ASSERT_IF(db.getEngineState(CSR_ENGINE_CS), CSR_ENABLE);
- ASSERT_IF(db.getEngineState(CSR_ENGINE_WP), CSR_DISABLE);
+ ASSERT_IF(db.getEngineState(CSR_ENGINE_CS), CSR_STATE_ENABLE);
+ ASSERT_IF(db.getEngineState(CSR_ENGINE_WP), CSR_STATE_DISABLE);
- db.setEngineState(CSR_ENGINE_CS, CSR_DISABLE);
- ASSERT_IF(db.getEngineState(CSR_ENGINE_CS), CSR_DISABLE);
+ db.setEngineState(CSR_ENGINE_CS, CSR_STATE_DISABLE);
+ ASSERT_IF(db.getEngineState(CSR_ENGINE_CS), CSR_STATE_DISABLE);
EXCEPTION_GUARD_END
}
errorCnt(0) {}
};
-void on_scanned(void *userdata, const char *file)
+void on_scanned(const char *file, void *userdata)
{
BOOST_MESSAGE("on_scanned. file[" << file << "] scanned!");
auto ctx = reinterpret_cast<AsyncTestContext *>(userdata);
ctx->scannedCnt++;
}
-void on_detected(void *userdata, csr_cs_malware_h detected)
+void on_detected(csr_cs_malware_h detected, void *userdata)
{
Test::ScopedCstr file_name;
ASSERT_IF(csr_cs_malware_get_file_name(detected, &file_name.ptr), CSR_ERROR_NONE);
ctx->detectedList.push_back(detected);
}
-void on_error(void *userdata, int ec)
+void on_error(int ec, void *userdata)
{
BOOST_MESSAGE("on_error. async request done with error code[" << ec << "]");
auto ctx = reinterpret_cast<AsyncTestContext *>(userdata);
ASSERT_SUCCESS(csr_engine_get_activated(e.get(), &activated));
ASSERT_IF(activated, CSR_ACTIVATED);
- csr_state_e state = CSR_ENABLE;
+ csr_state_e state = CSR_STATE_ENABLE;
ASSERT_SUCCESS(csr_engine_set_state(e.get(), state));
ASSERT_SUCCESS(csr_engine_get_state(e.get(), &state));
- ASSERT_IF(state, CSR_ENABLE);
+ ASSERT_IF(state, CSR_STATE_ENABLE);
EXCEPTION_GUARD_END
}
Engine e(CSR_ENGINE_CS);
- csr_state_e state = CSR_ENABLE;
+ csr_state_e state = CSR_STATE_ENABLE;
// enable
- ASSERT_SUCCESS(csr_engine_set_state(e.get(), CSR_ENABLE));
+ ASSERT_SUCCESS(csr_engine_set_state(e.get(), CSR_STATE_ENABLE));
ASSERT_SUCCESS(csr_engine_get_state(e.get(), &state));
- ASSERT_IF(state, CSR_ENABLE);
+ ASSERT_IF(state, CSR_STATE_ENABLE);
// prepare data
auto c = Test::Context<csr_cs_context_h>();
ASSERT_SUCCESS(csr_cs_scan_data(context, data, sizeof(data), &detected));
// disable
- ASSERT_SUCCESS(csr_engine_set_state(e.get(), CSR_DISABLE));
+ ASSERT_SUCCESS(csr_engine_set_state(e.get(), CSR_STATE_DISABLE));
ASSERT_SUCCESS(csr_engine_get_state(e.get(), &state));
- ASSERT_IF(state, CSR_DISABLE);
+ ASSERT_IF(state, CSR_STATE_DISABLE);
// test operation
ASSERT_IF(csr_cs_scan_data(context, data, sizeof(data), &detected),
CSR_ERROR_ENGINE_DISABLED);
// enable
- ASSERT_SUCCESS(csr_engine_set_state(e.get(), CSR_ENABLE));
+ ASSERT_SUCCESS(csr_engine_set_state(e.get(), CSR_STATE_ENABLE));
ASSERT_SUCCESS(csr_engine_get_state(e.get(), &state));
- ASSERT_IF(state, CSR_ENABLE);
+ ASSERT_IF(state, CSR_STATE_ENABLE);
// test operation
ASSERT_SUCCESS(csr_cs_scan_data(context, data, sizeof(data), &detected));
ASSERT_SUCCESS(csr_engine_get_activated(e.get(), &activated));
ASSERT_IF(activated, CSR_ACTIVATED);
- csr_state_e state = CSR_ENABLE;
+ csr_state_e state = CSR_STATE_ENABLE;
ASSERT_SUCCESS(csr_engine_set_state(e.get(), state));
ASSERT_SUCCESS(csr_engine_get_state(e.get(), &state));
- ASSERT_IF(state, CSR_ENABLE);
+ ASSERT_IF(state, CSR_STATE_ENABLE);
EXCEPTION_GUARD_END
}
Engine e(CSR_ENGINE_WP);
- csr_state_e state = CSR_ENABLE;
+ csr_state_e state = CSR_STATE_ENABLE;
// enable
- ASSERT_SUCCESS(csr_engine_set_state(e.get(), CSR_ENABLE));
+ ASSERT_SUCCESS(csr_engine_set_state(e.get(), CSR_STATE_ENABLE));
ASSERT_SUCCESS(csr_engine_get_state(e.get(), &state));
- ASSERT_IF(state, CSR_ENABLE);
+ ASSERT_IF(state, CSR_STATE_ENABLE);
// prepare data
auto c = Test::Context<csr_wp_context_h>();
ASSERT_SUCCESS(csr_wp_check_url(context, RISK_HIGH_URL, &result));
// disable
- ASSERT_SUCCESS(csr_engine_set_state(e.get(), CSR_DISABLE));
+ ASSERT_SUCCESS(csr_engine_set_state(e.get(), CSR_STATE_DISABLE));
ASSERT_SUCCESS(csr_engine_get_state(e.get(), &state));
- ASSERT_IF(state, CSR_DISABLE);
+ ASSERT_IF(state, CSR_STATE_DISABLE);
// test operation
ASSERT_IF(csr_wp_check_url(context, RISK_HIGH_URL, &result),
CSR_ERROR_ENGINE_DISABLED);
// enable
- ASSERT_SUCCESS(csr_engine_set_state(e.get(), CSR_ENABLE));
+ ASSERT_SUCCESS(csr_engine_set_state(e.get(), CSR_STATE_ENABLE));
ASSERT_SUCCESS(csr_engine_get_state(e.get(), &state));
- ASSERT_IF(state, CSR_ENABLE);
+ ASSERT_IF(state, CSR_STATE_ENABLE);
// test operation
ASSERT_SUCCESS(csr_wp_check_url(context, RISK_HIGH_URL, &result));
ERRORDESCRIBE(CSR_ERROR_ENGINE_DISABLED);
ERRORDESCRIBE(CSR_ERROR_ENGINE_NOT_ACTIVATED);
ERRORDESCRIBE(CSR_ERROR_ENGINE_INTERNAL);
- ERRORDESCRIBE(CSR_ERROR_UNKNOWN);
+ ERRORDESCRIBE(CSR_ERROR_SYSTEM);
default: return std::string("Undefined capi error code: ")
+ std::to_string(static_cast<int>(ec));
}
struct Initializer {
Initializer()
{
- m_oldCsState = setEngineState(CSR_ENGINE_CS, CSR_ENABLE);
- m_oldWpState = setEngineState(CSR_ENGINE_WP, CSR_ENABLE);
+ m_oldCsState = setEngineState(CSR_ENGINE_CS, CSR_STATE_ENABLE);
+ m_oldWpState = setEngineState(CSR_ENGINE_WP, CSR_STATE_ENABLE);
}
~Initializer()