Tizen Native API
6.5
|
It provides provides APIs checking URL reputation to see if the URL is risky or not.
Required Header
#include <csr-web-protection.h> #include <csr-web-protection-types.h>
Overview
It provides provides APIs checking URL reputation to see if the URL is risky or not. Actual operation is performed by an underlying anti malware engine which will be provided by a device manufacturer.
Functions | |
int | csr_wp_context_create (csr_wp_context_h *handle) |
Initializes and returns a CSR Web Protection API handle. | |
int | csr_wp_context_destroy (csr_wp_context_h handle) |
Releases all system resources associated with a Web Protection API handle. | |
int | csr_wp_set_ask_user (csr_wp_context_h handle, csr_wp_ask_user_e ask_user) |
Sets a popup option for risky URL checked. | |
int | csr_wp_set_popup_message (csr_wp_context_h handle, const char *message) |
Sets a popup message of a client in case for a risky URL. | |
int | csr_wp_check_url (csr_wp_context_h handle, const char *url, csr_wp_check_result_h *result) |
Checks URL reputation against the engine vendor's database. | |
int | csr_wp_result_get_risk_level (csr_wp_check_result_h result, csr_wp_risk_level_e *level) |
Extracts a risk level of the url from the result handle. | |
int | csr_wp_result_get_detailed_url (csr_wp_check_result_h result, char **detailed_url) |
Extracts an url of vendor's web site that contains detailed information about the risk from the result handle. | |
int | csr_wp_result_get_user_response (csr_wp_check_result_h result, csr_wp_user_response_e *response) |
Extracts a user response of a popup from the result handle. | |
Typedefs | |
typedef struct __csr_wp_context_s * | csr_wp_context_h |
CSR WP context handle. | |
typedef struct __csr_wp_check_result_h * | csr_wp_check_result_h |
CSR WP scan result handle. |
Typedef Documentation
typedef struct __csr_wp_check_result_h* csr_wp_check_result_h |
CSR WP scan result handle.
- Warning:
- This is not for use by third-party applications.
- Since :
- 3.0
typedef struct __csr_wp_context_s* csr_wp_context_h |
CSR WP context handle.
- Warning:
- This is not for use by third-party applications.
- Since :
- 3.0
Enumeration Type Documentation
enum csr_wp_ask_user_e |
enum csr_wp_risk_level_e |
Enumeration for risk level of a url.
- Warning:
- This is not for use by third-party applications.
- Since :
- 3.0
- Enumerator:
Enumeration for the user response for a popup.
- Warning:
- This is not for use by third-party applications.
- Since :
- 3.0
Function Documentation
int csr_wp_check_url | ( | csr_wp_context_h | handle, |
const char * | url, | ||
csr_wp_check_result_h * | result | ||
) |
Checks URL reputation against the engine vendor's database.
- Warning:
- This is not for use by third-party applications.
Checks whether accessing the URL is risky or not and returns a result handle with the risk level for the URL.
- Since :
- 3.0
- Privilege Level:
- partner
- Privilege:
- http://tizen.org/privilege/antivirus.webprotect
- Remarks:
- result will be released when handle is released using csr_wp_context_destroy().
- Parameters:
-
[in] handle CSR WP context handle returned by csr_wp_context_create() [in] url URL to check [out] result A pointer of the result handle with the Risk level for the URL
- Returns:
- CSR_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
CSR_ERROR_NONE Successful CSR_ERROR_INVALID_HANDLE Invalid handle CSR_ERROR_OUT_OF_MEMORY Not enough memory CSR_ERROR_PERMISSION_DENIED Permission denied CSR_ERROR_NOT_SUPPORTED Device needed to run API is not supported CSR_ERROR_INVALID_PARAMETER url or result is invalid CSR_ERROR_SOCKET Socket error between client and server CSR_ERROR_SERVER Server has been failed for some reason CSR_ERROR_USER_RESPONSE_FAILED Getting user response is failed. result will be allocated on this error CSR_ERROR_ENGINE_NOT_EXIST No engine exists CSR_ERROR_ENGINE_DISABLED Engine is in disabled state CSR_ERROR_ENGINE_NOT_ACTIVATED Engine is not activated CSR_ERROR_ENGINE_INTERNAL Engine Internal error CSR_ERROR_SYSTEM System error
int csr_wp_context_create | ( | csr_wp_context_h * | handle | ) |
Initializes and returns a CSR Web Protection API handle.
- Warning:
- This is not for use by third-party applications.
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 :
- 3.0
- Privilege Level:
- partner
- Privilege:
- http://tizen.org/privilege/antivirus.webprotect
- Remarks:
- handle should be released using csr_wp_context_destroy().
- Multiple handles can be obtained.
- Parameters:
-
[out] handle A pointer of CSR WP context handle
- Returns:
- CSR_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
CSR_ERROR_NONE Successful CSR_ERROR_OUT_OF_MEMORY Not enough memory CSR_ERROR_INVALID_PARAMETER handle is invalid CSR_ERROR_SYSTEM System error
- See also:
- csr_wp_context_destroy()
int csr_wp_context_destroy | ( | csr_wp_context_h | handle | ) |
Releases all system resources associated with a Web Protection API handle.
- Warning:
- This is not for use by third-party applications.
- Since :
- 3.0
- Privilege Level:
- partner
- Privilege:
- http://tizen.org/privilege/antivirus.webprotect
- Parameters:
-
[in] handle CSR WP context handle returned by csr_wp_context_create()
- Returns:
- CSR_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
CSR_ERROR_NONE Successful CSR_ERROR_INVALID_HANDLE Invalid handle CSR_ERROR_SOCKET Socket error between client and server CSR_ERROR_SERVER Server has been failed for some reason CSR_ERROR_ENGINE_INTERNAL Engine Internal error CSR_ERROR_SYSTEM System error
- See also:
- csr_wp_context_create()
int csr_wp_result_get_detailed_url | ( | csr_wp_check_result_h | result, |
char ** | detailed_url | ||
) |
Extracts an url of vendor's web site that contains detailed information about the risk from the result handle.
- Warning:
- This is not for use by third-party applications.
- Since :
- 3.0
- Privilege Level:
- partner
- Privilege:
- http://tizen.org/privilege/antivirus.webprotect
- Remarks:
- detailed_url must be released using free().
- Parameters:
-
[in] result A result handle returned by csr_wp_check_url() [out] detailed_url A pointer of an url that contains detailed information about the risk If the risk level is CSR_WP_RISK_MEDIUM or CSR_WP_RISK_HIGH, this url should be provided by the engine
- Returns:
- CSR_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
CSR_ERROR_NONE Successful CSR_ERROR_INVALID_HANDLE Invalid result handle CSR_ERROR_INVALID_PARAMETER detailed_url is invalid CSR_ERROR_SYSTEM System error
- See also:
- csr_wp_check_url()
int csr_wp_result_get_risk_level | ( | csr_wp_check_result_h | result, |
csr_wp_risk_level_e * | level | ||
) |
Extracts a risk level of the url from the result handle.
- Warning:
- This is not for use by third-party applications.
- Since :
- 3.0
- Privilege Level:
- partner
- Privilege:
- http://tizen.org/privilege/antivirus.webprotect
- Parameters:
-
[in] result A result handle returned by csr_wp_check_url() [out] level A pointer of the risk level for the given URL
- Returns:
- CSR_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
CSR_ERROR_NONE Successful CSR_ERROR_INVALID_HANDLE Invalid result handle CSR_ERROR_INVALID_PARAMETER level is invalid CSR_ERROR_SYSTEM System error
- See also:
- csr_wp_check_url()
int csr_wp_result_get_user_response | ( | csr_wp_check_result_h | result, |
csr_wp_user_response_e * | response | ||
) |
Extracts a user response of a popup from the result handle.
- Warning:
- This is not for use by third-party applications.
- Since :
- 3.0
- Privilege Level:
- partner
- Privilege:
- http://tizen.org/privilege/antivirus.webprotect
- Parameters:
-
[in] result A result handle returned by csr_wp_check_url() [out] response A pointer of the user response
- Returns:
- CSR_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
CSR_ERROR_NONE Successful CSR_ERROR_INVALID_HANDLE Invalid result handle CSR_ERROR_INVALID_PARAMETER response is invalid CSR_ERROR_SYSTEM System error
- See also:
- csr_wp_check_url()
- csr_wp_user_response_e
int csr_wp_set_ask_user | ( | csr_wp_context_h | handle, |
csr_wp_ask_user_e | ask_user | ||
) |
Sets a popup option for risky URL checked.
- Warning:
- This is not for use by third-party applications.
If CSR_WP_ASK_USER_YES is set, a popup will be prompted to a user when a URL turns out risky. If CSR_WP_ASK_USER_NO is set, no popup will be prompted even when a URL turns out risky.
- Since :
- 3.0
- Privilege Level:
- partner
- Privilege:
- http://tizen.org/privilege/antivirus.webprotect
- Remarks:
- This option is disabled(CSR_WP_ASK_USER_NO) as a default.
- Parameters:
-
[in] handle CSR WP context handle returned by csr_wp_context_create() [in] ask_user A popup option in case for a risky URL
- Returns:
- CSR_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
CSR_ERROR_NONE Successful CSR_ERROR_INVALID_HANDLE Invalid handle CSR_ERROR_INVALID_PARAMETER ask_user is invalid CSR_ERROR_SYSTEM System error
- See also:
- csr_wp_context_create()
int csr_wp_set_popup_message | ( | csr_wp_context_h | handle, |
const char * | message | ||
) |
Sets a popup message of a client in case for a risky URL.
- Warning:
- This is not for use by third-party applications.
Default message is "Risky URL which may harm your device is detected".
- Since :
- 3.0
- Privilege Level:
- partner
- Privilege:
- http://tizen.org/privilege/antivirus.webprotect
- Remarks:
- Meaningful only when ask user option is set by csr_wp_set_ask_user().
- The message will be printed on popup for user.
- Default popup message will be used if it isn't set.
- Parameters:
-
[in] handle CSR WP context handle returned by csr_wp_context_create() [in] message A message to print on a popup
- Returns:
- CSR_ERROR_NONE on success, otherwise a negative error value
- Return values:
-
CSR_ERROR_NONE Successful CSR_ERROR_INVALID_HANDLE Invalid handle CSR_ERROR_INVALID_PARAMETER message is too long or empty. Max size is 64 bytes CSR_ERROR_SYSTEM System error
- See also:
- csr_wp_context_create()