2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
17 * @file csr-content-screening-types.h
18 * @author Dongsun Lee (ds73.lee@samsung.com)
20 * @brief Content screening CAPI enums, handles and callbacks
24 #ifndef __CSR_CONTENT_SCREENING_TYPES_H_
25 #define __CSR_CONTENT_SCREENING_TYPES_H_
34 * @addtogroup CAPI_CSR_FRAMEWORK_CS_MODULE
40 * @deprecated Deprecated since 7.5.
42 * @brief Enumeration for severity level of a detected malware.
46 CSR_CS_SEVERITY_LOW = 0x01, /**< Low Severity. User can choose how to handle between skip, ignore and remove. */
47 CSR_CS_SEVERITY_MEDIUM = 0x02, /**< Medium Severity. User can choose how to handle between skip, ignore and remove. */
48 CSR_CS_SEVERITY_HIGH = 0x03 /**< High Severity. User can choose how to handle between skip and remove. */
49 } csr_cs_severity_level_e;
53 * @deprecated Deprecated since 7.5.
55 * @brief Enumeration for the option of asking user about handling a detected malware.
59 CSR_CS_ASK_USER_NO = 0x00, /**< Do not ask the user even if malicious contents were found.*/
60 CSR_CS_ASK_USER_YES = 0x01 /**< Ask the user when malicious contents were found. */
65 * @deprecated Deprecated since 7.5.
67 * @brief Enumeration for the user response from popup.
71 CSR_CS_USER_RESPONSE_USER_NOT_ASKED = 0x00, /**< No response from user. */
72 CSR_CS_USER_RESPONSE_REMOVE = 0x01, /**< A user decided to remove a detected malicious content and it was removed. */
73 CSR_CS_USER_RESPONSE_PROCESSING_ALLOWED = 0x02, /**< A user decided to process a detected malware. */
74 CSR_CS_USER_RESPONSE_PROCESSING_DISALLOWED = 0x03, /**< A user decided not to process a detected malware. */
75 } csr_cs_user_response_e;
79 * @deprecated Deprecated since 7.5.
81 * @brief Enumeration for the action types for the detected malware files.
85 CSR_CS_ACTION_REMOVE = 0x00, /**< Remove the detected malware file. */
86 CSR_CS_ACTION_IGNORE = 0x01, /**< Ignore the detected malware file. */
87 CSR_CS_ACTION_UNIGNORE = 0x02 /**< Unignore the previously ignored file. */
92 * @deprecated Deprecated since 7.5.
94 * @brief Enumeration for maximum core usage during scanning.
98 CSR_CS_CORE_USAGE_DEFAULT = 0x00, /**< Use default setting value. */
99 CSR_CS_CORE_USAGE_ALL = 0x01, /**< Use all cores during scanning. */
100 CSR_CS_CORE_USAGE_HALF = 0x02, /**< Use half cores during scanning. */
101 CSR_CS_CORE_USAGE_SINGLE = 0x03 /**< Use a single core during scanning. */
102 } csr_cs_core_usage_e;
106 * @deprecated Deprecated since 7.5.
108 * @brief Content screening APIs context handle.
111 typedef struct __csr_cs_context_s *csr_cs_context_h;
115 * @deprecated Deprecated since 7.5.
117 * @brief Detected malware handle.
120 typedef struct __csr_cs_malware_s *csr_cs_malware_h;
124 * @deprecated Deprecated since 7.5.
126 * @brief Detected malware list handle.
129 typedef struct __csr_cs_malware_list_s *csr_cs_malware_list_h;
133 * @deprecated Deprecated since 7.5.
135 * @brief Engine info handle.
138 typedef struct __csr_cs_engine_s *csr_cs_engine_h;
142 * @deprecated Deprecated since 7.5.
144 * @brief Called when each file scanning is done without malware.
146 * @remarks Only for asynchronous scan functions.
147 * @remarks Called for each file or application which is not detected malware.
148 * @param[in] file_path A path of the file scanned. It would be package path if it's in application
149 * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method
150 * @see csr_cs_set_file_scanned_cb()
151 * @see csr_cs_scan_files_async()
152 * @see csr_cs_scan_dir_async()
153 * @see csr_cs_scan_dirs_async()
155 typedef void (*csr_cs_file_scanned_cb)(const char *file_path, void *user_data);
159 * @deprecated Deprecated since 7.5.
161 * @brief Called when each file scanning is done with malware.
163 * @remarks Only for asynchronous scan functions.
164 * @remarks Called for each file or application which is detected malware.
165 * @remarks @a malware will be released when a context is released using csr_cs_context_destroy().
166 * @param[in] malware The detected malware handle
167 * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method
168 * @see csr_cs_set_detected_cb()
169 * @see csr_cs_scan_files_async()
170 * @see csr_cs_scan_dir_async()
171 * @see csr_cs_scan_dirs_async()
173 typedef void (*csr_cs_detected_cb)(csr_cs_malware_h malware, void *user_data);
177 * @deprecated Deprecated since 7.5.
179 * @brief Called when scanning is finished successfully.
181 * @remarks Only for asynchronous scan functions.
182 * @remarks Called only once at the end of scanning when success.
183 * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method
184 * @see csr_cs_set_completed_cb()
185 * @see csr_cs_scan_files_async()
186 * @see csr_cs_scan_dir_async()
187 * @see csr_cs_scan_dirs_async()
189 typedef void (*csr_cs_completed_cb)(void *user_data);
193 * @deprecated Deprecated since 7.5.
195 * @brief Called when scanning is cancelled by csr_cs_cancel_scanning().
197 * @remarks Only for asynchronous scan functions.
198 * @remarks Called only once at the end of scanning by being cancelled.
199 * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method
200 * @see csr_cs_set_cancelled_cb()
201 * @see csr_cs_cancel_scanning()
202 * @see csr_cs_scan_files_async()
203 * @see csr_cs_scan_dir_async()
204 * @see csr_cs_scan_dirs_async()
206 typedef void (*csr_cs_cancelled_cb)(void *user_data);
210 * @deprecated Deprecated since 7.5.
212 * @brief Called when scanning is stopped with an error.
213 * @details The following error codes can be delivered.\n
214 * #CSR_ERROR_FILE_DO_NOT_EXIST,\n
215 * #CSR_ERROR_SOCKET,\n
216 * #CSR_ERROR_SERVER,\n
217 * #CSR_ERROR_ENGINE_NOT_EXIST,\n
218 * #CSR_ERROR_ENGINE_DISABLED,\n
219 * #CSR_ERROR_ENGINE_NOT_ACTIVATED,\n
220 * #CSR_ERROR_ENGINE_PERMISSION,\n
221 * #CSR_ERROR_ENGINE_INTERNAL
223 * @remarks Only for asynchronous scan functions.
224 * @remarks Called only once at the end of scanning when failed with error.
225 * @param[in] error_code Error code of #csr_error_e defined in csr-error.h
226 * @param[in] user_data A pointer of a user data. It's provided by client when calling asynchronous scanning method
227 * @see csr_cs_set_error_cb()
228 * @see csr_cs_scan_files_async()
229 * @see csr_cs_scan_dir_async()
230 * @see csr_cs_scan_dirs_async()
232 typedef void (*csr_cs_error_cb)(int error_code, void *user_data);