Update latest code of platform version 2.4 37/52137/1
authorKyungwook Tak <k.tak@samsung.com>
Thu, 19 Nov 2015 08:55:33 +0000 (17:55 +0900)
committerKyungwook Tak <k.tak@samsung.com>
Thu, 19 Nov 2015 08:56:24 +0000 (17:56 +0900)
Change-Id: I7a6e538ce1ba398a4bcfc6bdd67bce5a7f6fe972
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
25 files changed:
CMakeLists.txt [new file with mode: 0644]
LICENSE [new file with mode: 0644]
Makefile [deleted file]
csr-framework.pc.in [new file with mode: 0644]
doc/Tizen Web Protection API Specification.pdf
doc/Tizen Web Protection Plugin API Specification.pdf
doc/csrfw_TCSImpl_doc.h [new file with mode: 0644]
doc/csrfw_TWPImpl_doc.h [new file with mode: 0644]
doc/csrfw_doc.h [new file with mode: 0644]
doc/images/csr_framework_overview.png [new file with mode: 0644]
framework/CMakeLists.txt [new file with mode: 0644]
framework/TCSErrorCodes.h
framework/TCSImpl.c
framework/TCSImpl.h
framework/TWPImpl.c
framework/TWPImpl.h
packaging/csr-framework.spec
test/CMakeLists.txt [new file with mode: 0644]
test/Makefile [deleted file]
test/TCSTest.c
test/TCSTest.h
test/TCSTestUtils.c
test/TWPTest.h
test/TWPTestUtils.c
test/WPMakefile [deleted file]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f388c38
--- /dev/null
@@ -0,0 +1,37 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(csr-framework)
+
+INCLUDE(FindPkgConfig)
+
+STRING(REGEX MATCH "([^.]*)" SO_VERSION "${VERSION}")
+
+SET(TARGET_LIB secfw)
+SET(TARGET_TCS_TEST tcstest)
+SET(TARGET_TWP_TEST twptest)
+
+SET(GC_SECTIONS_FLAGS         "-fdata-sections -ffunction-sections -Wl,--gc-sections")
+SET(CMAKE_C_FLAGS             "${CMAKE_C_FLAGS} ${GC_SECTIONS_FLAGS}")
+SET(CMAKE_CXX_FLAGS           "${CMAKE_CXX_FLAGS} ${GC_SECTIONS_FLAGS}")
+SET(CMAKE_C_FLAGS_RELEASE     "-g -O2")
+SET(CMAKE_CXX_FLAGS_RELEASE   "-g -std=c++0x -O2")
+SET(CMAKE_C_FLAGS_DEBUG       "-g -O0 -Wp,-U_FORTIFY_SOURCE")
+SET(CMAKE_CXX_FLAGS_DEBUG     "-g -std=c++0x -O0 -Wp,-U_FORTIFY_SOURCE")
+SET(CMAKE_C_FLAGS_CCOV        "-g -O2 --coverage")
+SET(CMAKE_CXX_FLAGS_CCOV      "-g -std=c++0x -O2 --coverage")
+SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
+SET(CMAKE_EXE_LINKER_FLAGS    "-Wl,--as-needed")
+SET(CMAKE_SKIP_RPATH          "TRUE")
+
+ADD_DEFINITIONS("-Werror")
+ADD_DEFINITIONS("-Wall")
+
+SET(PC_LDFLAGS -l${TARGET_LIB})
+
+CONFIGURE_FILE(${CMAKE_PROJECT_NAME}.pc.in ${CMAKE_PROJECT_NAME}.pc @ONLY)
+INSTALL(FILES ${CMAKE_PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
+ADD_SUBDIRECTORY(framework)
+
+IF (DEFINED CSR_TEST_BUILD)
+ADD_SUBDIRECTORY(test)
+ENDIF (DEFINED CSR_TEST_BUILD)
diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..81a1a6a
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,29 @@
+
+  Copyright (c) 2013, McAfee, Inc.
+
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without modification,
+  are permitted provided that the following conditions are met:
+
+  Redistributions of source code must retain the above copyright notice, this list
+  of conditions and the following disclaimer.
+
+  Redistributions in binary form must reproduce the above copyright notice, this
+  list of conditions and the following disclaimer in the documentation and/or other
+  materials provided with the distribution.
+
+  Neither the name of McAfee, Inc. nor the names of its contributors may be used
+  to endorse or promote products derived from this software without specific prior
+  written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+  OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index 87041dc..0000000
--- a/Makefile
+++ /dev/null
@@ -1,89 +0,0 @@
-#
-#  Copyright (c) 2013, McAfee, Inc.
-#  
-#  All rights reserved.
-#  
-#  Redistribution and use in source and binary forms, with or without modification,
-#  are permitted provided that the following conditions are met:
-#  
-#  Redistributions of source code must retain the above copyright notice, this list
-#  of conditions and the following disclaimer.
-#  
-#  Redistributions in binary form must reproduce the above copyright notice, this
-#  list of conditions and the following disclaimer in the documentation and/or other
-#  materials provided with the distribution.
-#  
-#  Neither the name of McAfee, Inc. nor the names of its contributors may be used
-#  to endorse or promote products derived from this software without specific prior
-#  written permission.
-#  
-#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-#  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-#  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-#  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-#  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-#  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-#  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-#  OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-OUTDIR = lib
-TARGET = $(OUTDIR)/libsecfw.so
-SRCDIR = framework
-INCLUDE = -I. $(TCS_INC) -I../plugin
-LD_FLAGS := $(LD_FLAGS) -ldl -ltzplatform-config-1.0
-
-ifeq ($(TCS_CC), )
-       CC = gcc
-else
-       CC = $(TCS_CC)
-endif
-ifeq ($(TCS_LD), )
-       LD = ld
-else
-       LD = $(TCS_LD)
-endif
-ifeq ($(TCS_AR), )
-       AR = ar
-else
-       AR = $(TCS_AR)
-endif
-
-ifeq ($(TCS_CFG), release)
-       CFLAGS := -O3 -fPIC $(INCLUDE) -DUNIX $(CFLAGS)
-else
-       CFLAGS := -g -fPIC $(INCLUDE) -DUNIX -DDEBUG $(CFLAGS)
-endif
-
-CFLAGS := $(CFLAGS) $(PKCL_CFLAGS) $(TCS_CFLAGS)
-
-SOURCES = $(SRCDIR)/TCSImpl.c $(SRCDIR)/TWPImpl.c
-
-OBJECTS = $(OUTDIR)/TCSImpl.o $(OUTDIR)/TWPImpl.o
-
-
-$(OUTDIR)/%.o: $(SRCDIR)/%.c
-       $(CC) $(CFLAGS) -o $(OUTDIR)/$*.o -c $(SRCDIR)/$*.c
-
-all: $(OUTDIR) $(TARGET)
-
-$(TARGET): $(OBJECTS)
-       $(CC) -shared -Wl,-zdefs -o $(TARGET) $(OBJECTS) $(LD_FLAGS)
-
-#      $(AR) -cr $(TARGET) $(OBJECTS)
-
-$(OUTDIR):
-       @mkdir $(OUTDIR)
-
-distclean: clean
-       @rm -f .depend
-       @rm -rf $(OUTDIR)
-
-clean:
-       @rm -f $(TARGET)
-       @rm -f $(OBJECTS) *~
-       @rm -f *.bb *.bbg *.da *.gcov
-
-
diff --git a/csr-framework.pc.in b/csr-framework.pc.in
new file mode 100644 (file)
index 0000000..7b64623
--- /dev/null
@@ -0,0 +1,12 @@
+
+# Package Information for pkg-config
+
+prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDEDIR@
+
+Name: @CMAKE_PROJECT_NAME@
+Description: @CMAKE_PROJECT_NAME@
+Version: @VERSION@
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: -I${includedir}
index f2decdc..7730ca2 100644 (file)
Binary files a/doc/Tizen Web Protection API Specification.pdf and b/doc/Tizen Web Protection API Specification.pdf differ
index c402108..3e7191a 100644 (file)
Binary files a/doc/Tizen Web Protection Plugin API Specification.pdf and b/doc/Tizen Web Protection Plugin API Specification.pdf differ
diff --git a/doc/csrfw_TCSImpl_doc.h b/doc/csrfw_TCSImpl_doc.h
new file mode 100644 (file)
index 0000000..b3c92b5
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+    Copyright (c) 2013, McAfee, Inc.
+
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without modification,
+    are permitted provided that the following conditions are met:
+
+    Redistributions of source code must retain the above copyright notice, this list
+    of conditions and the following disclaimer.
+
+    Redistributions in binary form must reproduce the above copyright notice, this
+    list of conditions and the following disclaimer in the documentation and/or other
+    materials provided with the distribution.
+
+    Neither the name of McAfee, Inc. nor the names of its contributors may be used
+    to endorse or promote products derived from this software without specific prior
+    written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+    IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+    BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+    OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+    OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#ifndef __TIZEN_CSR_FRAME_WORK_TCS_DOC_H__
+#define __TIZEN_CSR_FRAME_WORK_TCS_DOC_H__
+/**
+ * @ingroup CAPI_CSRFW
+ * @defgroup CAPI_CSRFW_TCS_MODULE TCS
+ * @brief Content Screening API definitions, structures and macros
+ * @section CAPI_CSRFW_TCS_MODULE_HEADER Required Header
+ *   \#include <TCSImpl.h> \n
+ *   \#include <TCSErrorCodes.h>
+ * @section CAPI_CSRFW_MODULE_OVERVIEW Overview
+ * It provides APIs that the caller enables content screening.
+ *
+ */
+#endif
diff --git a/doc/csrfw_TWPImpl_doc.h b/doc/csrfw_TWPImpl_doc.h
new file mode 100644 (file)
index 0000000..2cf52f2
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+    Copyright (c) 2013, McAfee, Inc.
+
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without modification,
+    are permitted provided that the following conditions are met:
+
+    Redistributions of source code must retain the above copyright notice, this list
+    of conditions and the following disclaimer.
+
+    Redistributions in binary form must reproduce the above copyright notice, this
+    list of conditions and the following disclaimer in the documentation and/or other
+    materials provided with the distribution.
+
+    Neither the name of McAfee, Inc. nor the names of its contributors may be used
+    to endorse or promote products derived from this software without specific prior
+    written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+    IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+    BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+    OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+    OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#ifndef __TIZEN_CSR_FRAME_WORK_TWP_DOC_H__
+#define __TIZEN_CSR_FRAME_WORK_TWP_DOC_H__
+/**
+ * @ingroup CAPI_CSRFW
+ * @defgroup CAPI_CSRFW_TWP_MODULE TWP
+ * @brief Content Screening API definitions, structures and macros
+ * @section CAPI_CSRFW_TCS_MODULE_HEADER Required Header
+ *   \#include <TWPImpl.h>
+ * @section CAPI_CSRFW_MODULE_OVERVIEW Overview
+ * It provides APIs that the caller enables to block an access of malicous web site.
+ */
+
+#endif
diff --git a/doc/csrfw_doc.h b/doc/csrfw_doc.h
new file mode 100644 (file)
index 0000000..bae6776
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __TIZEN_CORE_CSRFW_DOC_H__
+#define __TIZEN_CORE_CSRFW_DOC_H__
+
+/**
+ *@defgroup CAPI_CSRFW CSR Framework
+ *@brief These APIs provide checking content screening and blocking access of malicious web site.
+ *@ingroup CAPI_SECURITY_FRAMEWORK
+ *@section CAPI_CSR_FRAMEWORK_OVERVIEW Overview
+ *<table>
+ *<tr><th>API Prefixes</th><th>Description</th></tr>
+ *<tr><td>@ref CAPI_CSRFW_TCS_MODULE</td><td>Providing APIs for content screening</td></tr>
+ *<tr><td>@ref CAPI_CSRFW_TWP_MODULE</td><td>Providing APIs for block an access of malicious web site API</td></tr>
+ *</table>
+ *
+ * It proposes the security framework on Tizen platform. Tizen content security
+ * framework will be responsible for passing the security API calls to security plug-in, which
+ * could be provided by security vendor plug-in. The framework is also responsible for
+ * error handling when there is no security vendor plug-in installed.
+ *
+ * @image html csr_framework_overview.png
+ *
+ * @section CAPI_CSR_FRAMEWORK_SOLUTION_DESCRIPTION Solution description
+ *
+ * Both content security framework and security plug-in are shared libraries in Tizen case. All
+ * the code is loaded in the application memory space. The authentication of those libraries will
+ * be covered by Tizen certificate process.
+ * Content security framework (libsecfw.so) will be linked directly to system component which is
+ * invoking the security API, while the security plug-in will be loaded in the runtime and
+ * installed along with security application package. The security application package should be
+ * signed with a trusted certificate which indicates that the package is authorized to carry
+ * security plug-in and is ready for use. And as a security consideration, Tizen installer will
+ * check this package whenever the application gets installed.
+ *
+ * @section CAPI_CSR_FRAMEWORK_CONTENT_SECURITY Content security framework
+ *
+ * API standaridizing:
+ *  - Content Security Framework will provide a set of APIs to other system modules with security
+ * features. Currently we have site engine and anti-virus engine API defined in this framework.
+ * Please refer to Tizen content screening and site engine API specification for detail.
+ * Each security vendor who wants to add their plug-in to Tizen platform, need to provide a
+ * plug-in library which conforms to the Framework API which we defined in the framework
+ * above their own engines.
+ *
+ * Plug-in managerment:
+ *  - Content security framework is responsible for plug-in loading/reloading. It will always try to
+ * load the new plug-in from "/opt/usr/share/sec_plugin/libengine.so" when content security
+ * framework is reinitialized by library open API call, in this case it is tcs_library_open(). This
+ * is saying that the newly installed security plug-in will be loaded only when
+ * tcs_library_open() gets called. During the tcs_library_close() and tcs_library_open(), the
+ * caller will keep using the old security plug-in until it close the library and reopen it.
+ *
+ * Error handling:
+ *  - Content security framework will return not implemented error code to caller if there is no
+ * plug-in found at "/opt/usr/share/sec_plugin".
+ *
+ * Concurrent Scan Support:
+ *  - The TCS security vendor plug-in must support concurrent scan in multi-tasking, so that
+ * Tizen component can have multiple threads to scan content concurrently.
+ */
+
+#endif /* __TIZEN_CORE_CSRFW_DOC_H__ */
diff --git a/doc/images/csr_framework_overview.png b/doc/images/csr_framework_overview.png
new file mode 100644 (file)
index 0000000..db0d1b5
Binary files /dev/null and b/doc/images/csr_framework_overview.png differ
diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt
new file mode 100644 (file)
index 0000000..134063d
--- /dev/null
@@ -0,0 +1,41 @@
+PKG_CHECK_MODULES(${TARGET_LIB}_DEP
+    REQUIRED
+    dlog
+    libtzplatform-config
+    )
+
+SET(${TARGET_LIB}_SRCS
+    TCSImpl.c
+    TWPImpl.c
+    )
+
+INCLUDE_DIRECTORIES(
+    SYSTEM
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${${TARGET_LIB}_DEP_INCLUDE_DIRS}
+    )
+
+ADD_LIBRARY(${TARGET_LIB} SHARED ${${TARGET_LIB}_SRCS})
+
+SET_TARGET_PROPERTIES(${TARGET_LIB}
+    PROPERTIES
+        COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default"
+        SOVERSION ${SO_VERSION}
+        VERSION ${VERSION}
+    )
+
+TARGET_LINK_LIBRARIES(${TARGET_LIB}
+    ${${TARGET_LIB}_DEP_LIBRARIES}
+    -ldl
+    -lpthread
+    )
+
+INSTALL(TARGETS ${TARGET_LIB} DESTINATION ${LIB_INSTALL_DIR})
+
+INSTALL(
+    FILES
+        TCSErrorCodes.h
+        TCSImpl.h
+        TWPImpl.h
+    DESTINATION ${INCLUDEDIR}
+    )
index 45ccad6..963cebb 100644 (file)
 #ifdef __cplusplus 
 extern "C" {
 #endif
+
 /**
- * \file TCSErrorCodes.h
- * \brief TCS Error Code Header File
+ * @file TCSErrorCodes.h
+ * @brief TCS Error Code Header File
  *  
  * This file provides the TCS error code definition.
  */
 
-#define TCS_ERROR_MODULE_GENERIC 1 /* A generic error code. */
+/**
+ * @addtogroup CAPI_CSRFW_TCS_MODULE
+ * @{
+ */
+
+
+/**
+ * @brief A generic error code.
+ * @since_tizen 2.3
+ */
+#define TCS_ERROR_MODULE_GENERIC 1
+
+/**
+ * @brief Operations cancelled.
+ * @since_tizen 2.3
+ */
+#define TCS_ERROR_CANCELLED 1
 
-#define TCS_ERROR_CANCELLED 1 /* Operations cancelled. */
+/**
+ * @brief Unable to access data.
+ * @since_tizen 2.3
+ */
+#define TCS_ERROR_DATA_ACCESS 2
 
-#define TCS_ERROR_DATA_ACCESS 2 /* Unable to access data. */
+/**
+ * @brief Invalid parameter.
+ * @since_tizen 2.3
+ */
+#define TCS_ERROR_INVALID_PARAM 3
 
-#define TCS_ERROR_INVALID_PARAM 3 /* Invalid parameter. */
+/**
+ * @brief Insufficient resource.
+ * @since_tizen 2.3
+ */
+#define TCS_ERROR_INSUFFICIENT_RES 4
 
-#define TCS_ERROR_INSUFFICIENT_RES 4 /* Insufficient resource. */
+/**
+ * @brief Unexpected internal error.
+ * @since_tizen 2.3
+ */
+#define TCS_ERROR_INTERNAL 5
 
-#define TCS_ERROR_INTERNAL 5 /* Unexpected internal error. */
+/**
+ * @brief Invalid handle.
+ * @since_tizen 2.3
+ */
+#define TCS_ERROR_INVALID_HANDLE 6
 
-#define TCS_ERROR_INVALID_HANDLE 6 /* Invalid handle. */
+/**
+ * @brief Specified functionality is not implemented in the TCS plug-in. (e.g. repair)
+ * @since_tizen 2.3
+ */
+#define TCS_ERROR_NOT_IMPLEMENTED 7
 
-#define TCS_ERROR_NOT_IMPLEMENTED 7 /* Specified functionality is not implemented in the TCS plug-in. (e.g. repair) */
+/**
+ * @}
+ */
 
 #ifdef __cplusplus
 }
index 2d8f08e..b59b3b1 100644 (file)
@@ -34,7 +34,6 @@
 #include <dlfcn.h>
 #include <malloc.h>
 
-/* For multi-user support */
 #include <tzplatform_config.h>
 
 #include "TCSImpl.h"
index fcc8a24..03a0af8 100644 (file)
@@ -37,68 +37,129 @@ extern "C" {
 #endif
 
 /**
- * \file TCSImpl.h
- * \brief TCS Header File
- *  
- * This file provides the Tizen Content Screen API functions.
+ * @addtogroup CAPI_CSRFW_TCS_MODULE
+ * @{
  */
 
-#define TCS_SA_SCANONLY 1 /* Instructs the scan functions to perform scanning only. */
-
-#define TCS_SA_SCANREPAIR 2 /* Instructs the scan functions to carry out both
-                                                                    scanning and repair/removal of detected malware. */
-
-#define TCS_CB_DETECTED 1 /* Informs the caller a malicious code has been
-                                                              detected in the scan target. The callback data
-                                                              argument pParam is set to point to a TCSDetected
-                                                              structure. */
+/**
+ * @brief Instructs the scan functions to perform scanning only.
+ * @since_tizen 2.3
+ * */
+#define TCS_SA_SCANONLY 1
 
-#define TCS_DTYPE_UNKNOWN 0 /* Scan for malicious content in an unknown data
-                                                                    type. This data type should be used when the
-                                                                    other types are not appropriate. */
+/**
+ * @brief Instructs the scan functions to carry out both scanning and repair/removal of detected malware.
+ * @since_tizen 2.3
+ */
+#define TCS_SA_SCANREPAIR 2
 
-#define TCS_DTYPE_HTML 1 /* Scan for malicious content in HTML. */
+/**
+ * @brief Informs the caller a malicious code has been detected in the scan target. \n
+ * The callback data argument pParam is set to point to a TCSDetected structure.
+ * @since_tizen 2.3
+ */
+#define TCS_CB_DETECTED 1
 
-#define TCS_DTYPE_URL 2 /* Scan for URL with malicious content.
-                                                            url-string format should conform to the
-                                                            Uniform Resource Locators (RFC 1738)
-                                                            specification. */
+/**
+ * @brief Scan for malicious content in an unknown data type. \n
+ * This data type should be used when the other types are not appropriate.
+ * @since_tizen 2.3
+ */
+#define TCS_DTYPE_UNKNOWN 0
 
-#define TCS_DTYPE_EMAIL 3 /* Scan for email-address with malicious intent.
-                                                                  email-string format should conform with
-                                                                  the Internet E-mail address format
-                                                                  (RFC 822) specification. */
+/**
+ * @brief Scan for malicious content in HTML.
+ * @since_tizen 2.3
+ */
+#define TCS_DTYPE_HTML 1
 
-#define TCS_DTYPE_PHONE 4 /* Scan for phone number with malicious intent.
-                                                              phone-number string consists of the numeric
-                                                              characters '0' through '9', and the
-                                                              '#' and '*' characters. */
+/**
+ * @brief Scan for URL with malicious content. url-string format should conform to the \n
+ * Uniform Resource Locators (RFC 1738) specification.
+ * @since_tizen 2.3
+ */
+#define TCS_DTYPE_URL 2
 
-#define TCS_DTYPE_JAVA 5 /* Scan for malicious Java code. */
+/**
+ * @brief Scan for email-address with malicious intent. \n
+ * email-string format should conform with the Internet E-mail address format \n
+ * (RFC 822) specification.
+ * @since_tizen 2.3
+ */
+#define TCS_DTYPE_EMAIL 3
 
-#define TCS_DTYPE_JAVAS 6 /* Scan for malicious Java code. */
+/**
+ * @brief Scan for phone number with malicious intent.\n
+ * phone-number string consists of the numeric characters '0' through '9', \n
+ * and the '#' and '*' characters.
+ * @since_tizen 2.3
+ */
+#define TCS_DTYPE_PHONE 4
 
-#define TCS_DTYPE_TEXT 7 /* Scan text data for malicious content. */
+/**
+ * @brief Scan for malicious Java code.
+ * @since_tizen 2.3
+ */
+#define TCS_DTYPE_JAVA 5
 
-#define TCS_VTYPE_MALWARE 1 /* Malware type. */
+/**
+ * @brief Scan for malicious Java code.
+ * @since_tizen 2.3
+ */
+#define TCS_DTYPE_JAVAS 6
 
-#define TCS_SC_USER 1 /* Detected malware is harmful to the user. */
+/**
+ * @brief Scan text data for malicious content.
+ * @since_tizen 2.3
+ */
+#define TCS_DTYPE_TEXT 7
 
-#define TCS_SC_TERMINAL 2 /* Detected malware is harmful to the terminal. */
+/**
+ * @brief  Malware type.
+ * @since_tizen 2.3
+ */
+#define TCS_VTYPE_MALWARE 1
 
-#define TCS_BC_LEVEL0 0 /* Process with a warning. This severity level may
-                                                          be assigned to data previously considered malicious. */
+/**
+ * @brief Detected malware is harmful to the user.
+ * @since_tizen 2.3
+ */
+#define TCS_SC_USER 1
 
-#define TCS_BC_LEVEL1 1 /* Prompt the user before processing. Ask the user
-                                                            if they want the application to process the data. */
+/**
+ * @brief Detected malware is harmful to the terminal.
+ * @since_tizen 2.3
+ */
+#define TCS_SC_TERMINAL 2
 
-#define TCS_BC_LEVEL2 2 /* Do not process the data. */
+/**
+ * @brief Process with a warning. This severity level may be assigned to data previously considered malicious.
+ * @since_tizen 2.3
+ */
+#define TCS_BC_LEVEL0 0
 
-#define TCS_BC_LEVEL3 3 /* Do not process the data and prompt user for removal.
-                                                        If the content is stored on the terminal,
-                                                        prompt the user for permission before removal. */
+/**
+ * @brief Prompt the user before processing. Ask the user if they want the application to process the data.
+ * @since_tizen 2.3
+ */
+#define TCS_BC_LEVEL1 1
+/**
+ * @brief Do not process the data.
+ * @since_tizen 2.3
+ */
+#define TCS_BC_LEVEL2 2
 
-#define TCS_BC_LEVEL4 4 /* Do not process the data and automatically remove if stored. */
+/**
+ * @brief SDo not process the data and prompt user for removal.\n
+ * If the content is stored on the terminal, prompt the user for permission before removal.
+ * @since_tizen 2.3
+ */
+#define TCS_BC_LEVEL3 3
+/**
+ * @brief Do not process the data and automatically remove if stored.
+ * @since_tizen 2.3
+ */
+#define TCS_BC_LEVEL4 4
 
 
 /*==================================================================================================
@@ -106,12 +167,14 @@ extern "C" {
 ==================================================================================================*/
 
 /**
- * Helper macro to get error module.
+ * @brief Helper macro to get error module.
+ * @since_tizen 2.3
  */
 #define TCS_ERRMODULE(e) (((e) >> 24) & 0xff)
 
 /**
- * Helper macro to get error code.
+ * @brief Helper macro to get error code.
+ * @since_tizen 2.3
  */
 #define TCS_ERRCODE(e) ((e) & 0x00ffffff)
 
@@ -120,29 +183,37 @@ extern "C" {
 ==================================================================================================*/
 
 /**
- * Dummy data structure to avoid unexpected data type casting.
+ * @brief Dummy data structure to avoid unexpected data type casting.
+ * @since_tizen 2.3
  */
 struct TCSLibHandle_struct {int iDummy;};
 
 /**
- * TCS library handle type.
+ * @brief TCS library handle type.
+ * @since_tizen 2.3
  */
 typedef struct TCSLibHandle_struct *TCSLIB_HANDLE;
 
-#define INVALID_TCSLIB_HANDLE ((TCSLIB_HANDLE) 0) /* Invalid Content Screening library interface handle. */
+/**
+ * @brief Invalid Content Screening library interface handle.
+ * @since_tizen 2.3
+ */
+#define INVALID_TCSLIB_HANDLE ((TCSLIB_HANDLE) 0)
 
 /**
- * error code type.
+ * @brief error code type.
+ * @since_tizen 2.3
  */
 typedef unsigned long TCSErrorCode;
 
 /**
- * Support 64 bits data / file locating
+ * @brief Support 64 bits data / file locating
+ * @since_tizen 2.3
  */
 typedef long long TCSOffset;
 
 /**
- * The calling application specifies scan
+ * @brief The calling application specifies scan
  * parameters using the TCSScanParam structure. The information
  * contained in the structure provides the scan functions with:
  * - scan action type (iAction)
@@ -154,22 +225,23 @@ typedef long long TCSOffset;
  *     block of scan data (pfRead)
  * - callback function used to write to the scan data (pfWrite)
  * - callback function for status/progress reporting (pfCallBack)
+ * @since_tizen 2.3
  */
 typedef struct TCSScanParam_struct
 {
-    int iAction; /* The scan-action specifies the type of scanning to be performed on supplied scan data. */
+    int iAction; /**< The scan-action specifies the type of scanning to be performed on supplied scan data. */
 
-    int iDataType; /* The calling application specifies the data type/format of the data to be scanned using this variable. */
+    int iDataType; /**< The calling application specifies the data type/format of the data to be scanned using this variable. */
 
-    int iCompressFlag; /* 0 - decompression disabled, 1 - decompression enabled. */
+    int iCompressFlag; /**< 0 - decompression disabled, 1 - decompression enabled. */
 
-    void *pPrivate; /* Pointer (or handle) to an application object being scanned.
+    void *pPrivate; /**< Pointer (or handle) to an application object being scanned.
                        The scan functions do not perform direct memory I/O using this data
                        pointer/handle. The data pointer/handle is simply passed back to the caller when
                        performing data read/write using caller specified I/O functions. Also the private
                        data is passed back to the caller using the pfCallback function if it is set. */
 
-    TCSOffset (*pfGetSize)(void *pPrivate); /* Used by the scan functions
+    TCSOffset (*pfGetSize)(void *pPrivate); /**< Used by the scan functions
                                                to obtain the scan target data size (in bytes) from the caller.
                                                                                                             
                                                This is a synchronous API.
@@ -179,7 +251,7 @@ typedef struct TCSScanParam_struct
                                                The size (in bytes) of the data to be scanned.
                                                */
 
-    int (*pfSetSize)(void *pPrivate, TCSOffset uSize); /* Called by the scan
+    int (*pfSetSize)(void *pPrivate, TCSOffset uSize); /**< Called by the scan
                                                           functions to resize the scanned data to a given size (in bytes) during
                                                           repair/clean. The resize function pointer needs to be set if the scan-action
                                                           (iAction) is set to TCS_SA_SCANREPAIR.
@@ -195,7 +267,7 @@ typedef struct TCSScanParam_struct
                                                           */
 
     unsigned int (*pfRead)(void *pPrivate, TCSOffset uOffset, void *pBuffer,
-                           unsigned int uCount); /* Used for reading a specified
+                           unsigned int uCount); /**< Used for reading a specified
                                                     amount of application data during scanning/analysis.
                                                                                                                     
                                                     This is a synchronous API.
@@ -211,7 +283,7 @@ typedef struct TCSScanParam_struct
                                                     */
 
     unsigned int (*pfWrite)(void *pPrivate, TCSOffset uOffset, void const *pBuffer,
-                            unsigned int uCount); /* The scan functions use the
+                            unsigned int uCount); /**< The scan functions use the
                                                      given function to write a specified amount of data to the scanned object as a part
                                                      of the repair process. The function pointer needs to be set if the scan action
                                                      (iAction) is set to TCS_SA_SCANREPAIR.
@@ -228,7 +300,7 @@ typedef struct TCSScanParam_struct
                                                      Not equal to the value of uCount indicating this call fails.
                                                      */
 
-    int (*pfCallBack)(void *pPrivate, int iReason, void *pParam); /* This callback
+    int (*pfCallBack)(void *pPrivate, int iReason, void *pParam); /**< This callback
                                                                      function is set by the caller to be notified to each detected malware while
                                                                      scanning is in process. If specified (not NULL), the scan functions call the
                                                                      specified function with the information (e.g. TCS_CB_DETECTED) for each malware
@@ -248,14 +320,15 @@ typedef struct TCSScanParam_struct
 } TCSScanParam;
 
 /**
- * Detected malicious code/content information structure.
+ * @brief Detected malicious code/content information structure.
+ * @since_tizen 2.3
  */
 typedef struct TCSDetected_struct
 {
-    struct TCSDetected_struct *pNext; /* Pointer to next malware found, NULL if at the end of list. */
+    struct TCSDetected_struct *pNext; /**< Pointer to next malware found, NULL if at the end of list. */
 
-    char const *pszName; /* Detected malware name. */
-    char const *pszVariant; /* Detected malware's variant name. pszName and
+    char const *pszName; /**< Detected malware name. */
+    char const *pszVariant; /**< Detected malware's variant name. pszName and
                                pszVariant report detected malicious code/content and variant names. The maximum
                                string length for both strings is 64 characters and each is terminated by a null
                                character ('\\0') - the maximum buffer size for both strings is 65 bytes.
@@ -263,8 +336,8 @@ typedef struct TCSDetected_struct
                                pszVariant is set to an empty string ("\0") if the detected malware is not a
                                variant. */
 
-    unsigned int uType; /* Detected malware type. \see TCS_VTYPE_MALWARE */
-    unsigned int uAction; /* Bit-field specifying severity, class and behavior level.
+    unsigned int uType; /**< Detected malware type. \see TCS_VTYPE_MALWARE */
+    unsigned int uAction; /**< Bit-field specifying severity, class and behavior level.
 
                              Included in the TCSDetected structure is a bit-field variable containing malware
                              severity flags and client application behavior levels.
@@ -282,7 +355,7 @@ typedef struct TCSDetected_struct
                              For example, if both TCS_BC_LEVEL0 and TCS_BC_LEVEL3 were reported, the application
                              would need to take on TCS_BC_LEVEL3 action. */
 
-    char const *pszFileName; /* Path of the infected file. The pszFileName field
+    char const *pszFileName; /**< Path of the infected file. The pszFileName field
                                 report, if not NULL, the complete file path of the infected content. If the scan
                                 functions have the ability to scan/analyze inside archives, then the path
                                 reported in pszFileName would be composed of multiple paths separated by the '|'
@@ -294,7 +367,7 @@ typedef struct TCSDetected_struct
 } TCSDetected;
 
 /**
- * Detected malware information is returned to the caller in the TCSScanResult 
+ * @brief Detected malware information is returned to the caller in the TCSScanResult
  * structure provided by the caller. The TCSScanResult structure contains a pointer 
  * to a structure that contains scan result information and a pointer to a function 
  * used to remove the scan result resource. The memory used to hold the scan result 
@@ -303,7 +376,8 @@ typedef struct TCSDetected_struct
  * information which had been reported via the callback (pfCallback) function during
  * scanning.
  *
- * \code
+ * @since_tizen 2.3
+ * @code
  * int ScanAppData( ... )
  * {
  *     TCSScanResult scanResult;
@@ -318,20 +392,20 @@ typedef struct TCSDetected_struct
  *     .
  *     .
  * }
- * \endcode
+ * @endcode
  */
 typedef struct TCSScanResult_struct
 {
-    int iNumDetected; /* Number of malware found. */
-    TCSDetected *pDList; /* Detected malware list. */
-    void (*pfFreeResult)(struct TCSScanResult_struct *pResult); /* Function pointer
+    int iNumDetected; /**< Number of malware found. */
+    TCSDetected *pDList; /**< Detected malware list. */
+    void (*pfFreeResult)(struct TCSScanResult_struct *pResult); /**< Function pointer
                                                                    used to free reported scan result.
                                                                                                                                                 
                                                                    This is a synchronous API.
-                                                                   \param[in] pResult Pointer to data structure in which detected scan result
+                                                                   @param[in] pResult Pointer to data structure in which detected scan result
                                                                    information is stored.
 
-                                                                   \return None
+                                                                   @return None
                                                                    */
 } TCSScanResult;
 
@@ -340,107 +414,116 @@ typedef struct TCSScanResult_struct
 ==================================================================================================*/
 
 /**
- * \brief Initializes and returns a Tizen Content Screening library
- * interface handle.
- *
- * A Content Screening library interface handle (or TCS library handle) is
- * obtained using the TCSLibraryOpen() function. The library handle is required for
- * subsequent TCS API calls. The TCSLibraryClose() function releases/closes the library
- * handle. Multiple library handles can be obtained using TCSLibraryOpen().
- *
+ * @brief Initializes and returns a Tizen Content Screening library interface handle.
+ * @details A Content Screening library interface handle (or TCS library handle) is \n
+ * obtained using the TCSLibraryOpen() function. The library handle is required for \n
+ * subsequent TCS API calls. The TCSLibraryClose() function releases/closes the library \n
+ * handle. Multiple library handles can be obtained using TCSLibraryOpen(). \n
+ *  \n
  * This is a synchronous API.
  *
- * \return Return Type (TCSLIB_HANDLE) \n
- * TCS library interface handle - on success. \n
- * INVALID_TCSLIB_HANDLE - on failure. \n
+ * @since_tizen 2.3
+ *
+ * @return TCS library interface handle on success, otherwise #INVALID_TCSLIB_HANDLE.
+ * @see TCSLibraryClose()
  */
 TCSLIB_HANDLE TCSLibraryOpen(void);
 
 /**
- * \brief Releases system resources associated with an TCS API library
- * handle returned by the TCSLibraryOpen() function.
+ * @brief Releases system resources associated with an TCS API library
+ * @details handle returned by the TCSLibraryOpen() function. \n
+ * \n
+ * This is a synchronous API. \n
  *
- * This is a synchronous API.
+ * @since_tizen 2.3
  *
- * \param[in] hLib TCS library handle returned by TCSLibraryOpen().
+ * @param[in] hLib TCS library handle returned by TCSLibraryOpen().
  *
- * \return Return Type (int) \n
- * 0 - on success. \n
- * -1 - on failure. \n
+ * @return 0 on success, otherwise -1.
+ * @see TCSLibraryOpen()
  */
 int TCSLibraryClose(TCSLIB_HANDLE hLib);
 
 /**
- * \brief Returns the last error code associated with the given
- * TCS library handle.
- *
- * Once the TCS library handle has been successfully obtained from TCSLibraryOpen(),
- * TCSGetLastError() can be used to retrieve the last TCS error that occurred. All TCS
- * API functions return zero (= 0) or a valid object pointer if successful, and -1
- * or a null object handle (e.g. INVALID_TCSSCAN_HANDLE) in case of an error. The
- * TCSGetLastError() function is used to retrieve error information when a TCS
- * function fails.
- *
- * This is a synchronous API.
+ * @brief Returns the last error code associated with the given TCS library handle.
+ * @details Once the TCS library handle has been successfully obtained from TCSLibraryOpen(), \n
+ * TCSGetLastError() can be used to retrieve the last TCS error that occurred. All TCS \n
+ * API functions return zero (= 0) or a valid object pointer if successful, and -1 \n
+ * or a null object handle (e.g. INVALID_TCSSCAN_HANDLE) in case of an error. The \n
+ * TCSGetLastError() function is used to retrieve error information when a TCS \n
+ * function fails. \n
+ * \n
+ * This is a synchronous API. \n
  *
- * \param[in] hLib TCS library handle returned by TCSLibraryOpen().
+ * @since_tizen 2.3
  *
- * \return Return Type (TCSErrorCode) \n
- * Last error code set by the TCS library. The TCSErrorCode data type is defined as a
- * 32-bit unsigned integer which contains both component and an error code (see
- * Figure about TCS Error Code Format). Two macros are available to extract the error
- * module and the error code. Call TCS_ERRMODULE(error-code) to get the error module,
- * and TCS_ERRCODE(error-code) to get the error code (where error-code is the value
- * returned by TCSGetLastError()).
- *
- * TCS library call sequence with a call to the TCSGetLastError() function:
+ * @param[in] hLib TCS library handle returned by TCSLibraryOpen().
  *
+ * @return Last error code set by the TCS library. The TCSErrorCode data type is defined as a \n
+ * 32-bit unsigned integer which contains both component and an error code (see \n
+ * Figure about TCS Error Code Format). Two macros are available to extract the error \n
+ * module and the error code. Call TCS_ERRMODULE(error-code) to get the error module, \n
+ * and TCS_ERRCODE(error-code) to get the error code (where error-code is the value \n
+ * returned by TCSGetLastError()). \n
+ * \n
+ * TCS library call sequence with a call to the TCSGetLastError() function: \n
+ * @see TCSErrorCodes.h
  */
 TCSErrorCode TCSGetLastError(TCSLIB_HANDLE hLib);
 
 /**
- * \brief TCSScanData() is used to scan a data buffer for malware. The caller
- * specifies a scanner action, scan target data type, set I/O functions to access
- * the data, and an optional callback function for information retrieval. The result
- * of the data scanning is returned in a caller provided data structure.
- *
- * This is a synchronous API.
+ * @brief TCSScanData() is used to scan a data buffer for malware.
+ * @details The caller specifies a scanner action, scan target data type, set I/O functions to access \n
+ * the data, and an optional callback function for information retrieval. The result \n
+ * of the data scanning is returned in a caller provided data structure. \n
+ * \n
+ * This is a synchronous API. \n
  *
- * \param[in] hLib instance handle obtained from a call to the TCSLibraryOpen()
+ * @since_tizen 2.3
+ * @param[in] hLib instance handle obtained from a call to the TCSLibraryOpen() \n
  * function.
- * \param[in] pParam Pointer to a structure containing data scan parameters.
- * \param[out] pResult Pointer to a structure containing data scan
- * results.
- *
- * \return Return Type (int) \n
- * 0 - on success. \n
- * -1 - on failure and error code is set. \n
+ * @param[in] pParam Pointer to a structure containing data scan parameters.
+ * @param[out] pResult Pointer to a structure containing data scan results.
  *
+ * @return 0 on success, otherwise -1 and error code is set.
+ * @see #TCSScanParam
+ * @see #TCSScanResult
+ * @see #TCSDetected
+ * @see TCSScanFile()
+ * @see TCSLibraryClose()
  */
 int TCSScanData(TCSLIB_HANDLE hLib, TCSScanParam *pParam, TCSScanResult *pResult);
 
 /**
- * \brief TCSScanFile() is used to scan a file for malware. The caller specifies a
- * file name, a scanner action, and scan target data type. The scan result is
- * returned in a caller provided data structure.
- *
- * This is a synchronous API.
+ * @brief TCSScanFile() is used to scan a file for malware.
+ * @details The caller specifies a file name, a scanner action, and scan target data type. The scan result is \n
+ * returned in a caller provided data structure. \n
+ * \n
+ * This is a synchronous API. \n
  *
- * \param[in] hLib instance handle obtained from a call to the
+ * @since_tizen 2.3
+ * @param[in] hLib instance handle obtained from a call to the  \n
  * TCSLibraryOpen() function.
- * \param[in] pszFileName Name of file to scan. The file name must include the
+ * @param[in] pszFileName Name of file to scan. The file name must include the \n
  * absolute path.
- * \param[in] iDataType Type of data contained in the file. This is used to
+ * @param[in] iDataType Type of data contained in the file. This is used to \n
  * perform data type specific scans on files.
- * \param[in] iAction Type of scanning to perform on file.
- * \param[out] pResult Pointer to a structure containing data scan results.
+ * @param[in] iAction Type of scanning to perform on file.
+ * @param[in] iCompressFlag Flag of decompression
+ * @param[out] pResult Pointer to a structure containing data scan results.
  *
- * \return Return Type (int) \n
- * 0 - on success. \n
- * -1 - on failure and error code is set. \n
+ * @return 0 on success, otherwise -1 and error code is set.
+ * @see #TCSScanResult
+ * @see #TCSDetected
+ * @see TCSScanData()
+ * @see TCSLibraryClose()
  */
-int TCSScanFile(TCSLIB_HANDLE hLib, char const *pszFileName, int iDataType,
-                int iAction, int iCompressFlag, TCSScanResult *pResult);
+int TCSScanFile(TCSLIB_HANDLE hLib, char const *pszFileName, int iDataType, int iAction, int iCompressFlag, TCSScanResult *pResult);
+
+/**
+ * @}
+ */
+
 
 #ifdef __cplusplus
 }
index 4291e49..bd4ddb5 100644 (file)
@@ -34,7 +34,6 @@
 #include <dlfcn.h>
 #include <malloc.h>
 
-/* For multi-user support */
 #include <tzplatform_config.h>
 
 #include "TWPImpl.h"
index 4a62f13..d04dd42 100644 (file)
 #ifndef TWPIMPL_H
 #define TWPIMPL_H
 
+
 #ifdef __cplusplus 
 extern "C" {
 #endif
 
 /**
- * \file TWPImpl.h
- * \brief TWP Header File
- *
- * This file provides the Tizen Web Protection API functions.
+ * @addtogroup CAPI_CSRFW_TWP_MODULE
+ * @{
  */
 
-typedef long unsigned int TWPMallocSizeT; /* Size unit */
 
+/**
+ * @brief Size unit
+ * @since_tizen 2.3
+ */
+typedef long unsigned int TWPMallocSizeT;
+
+/**
+ * @brief Dummy data structure to avoid unexpected data type casting.
+ * @since_tizen 2.3
+ */
 struct TWPLibHandle_struct {int iDummy;};
 
+/**
+ * @brief TWP library handle type.
+ * @since_tizen 2.3
+ */
 typedef struct TWPLibHandle_struct *TWPLIB_HANDLE;
 
-#define TWPAPI_VERSION 1 /* SDK version */
-
-#define TWPCONFIG_VERSION 1 /* Configure version */
+/**
+ * @brief SDK version.
+ * @since_tizen 2.3
+ */
+#define TWPAPI_VERSION 1
 
-#define TWPREQUEST_VERSION 1 /* Request version */
+/**
+ * @brief Configure version.
+ * @since_tizen 2.3
+ */
+#define TWPCONFIG_VERSION 1
 
-#define INVALID_TWPLIB_HANDLE ((TWPLIB_HANDLE) 0) /* Invalid web protection library interface handle. */
+/**
+ * @brief Request version.
+ * @since_tizen 2.3
+ */
+#define TWPREQUEST_VERSION 1
 
 /**
- * Result code used by TWP_RESULT
+ * @brief Invalid web protection library interface handle.
+ * @since_tizen 2.3
+ */
+#define INVALID_TWPLIB_HANDLE ((TWPLIB_HANDLE) 0)
+       
+/**
+ * @brief Result code used by TWP_RESULT
+ * @since_tizen 2.3
  */
 typedef enum
 {
-       TWP_SUCCESS = 0,        
-       TWP_ERROR = 1,  
-       TWP_NOMEM = 2,  
-       TWP_INVALID_HANDLE = 3, 
-       TWP_INVALID_PARAMETER = 4,      
-       TWP_INVALID_VERSION = 5, 
-       TWP_INVALID_RESPONSE = 6, 
-       TWP_NO_DATA = 7,
-       TWP_NOT_IMPLEMENTED = 500       
+       TWP_SUCCESS = 0, /**< Success */
+       TWP_ERROR = 1, /**< Generic error */
+       TWP_NOMEM = 2,  /**< Function failed to allocate required memory */
+       TWP_INVALID_HANDLE = 3, /**< The given handle is invalid */
+       TWP_INVALID_PARAMETER = 4, /**< The given parameter other than handle is invalid */
+       TWP_INVALID_VERSION = 5, /**< The version of the structure is incorrect */
+       TWP_INVALID_RESPONSE = 6, /**< The server response is invalid */
+       TWP_NO_DATA = 7, /**< Requested data is not available.  This error code is
+                         usually returned when necessity data is not passed */
+       TWP_NOT_IMPLEMENTED = 500 /**< Tizen Web Protection APIs are not implemented on system
+                               Or the APIs are called while CSR framework fails to load */
 } TWP_RESULT;
 
 /**
- * Web site category definitions
+ * @brief Web site category definitions. \n
+ * See "Categories definitions" section in "Tizen Web Protection API Specification" \n
+ * docoument for more detail.
+ * @since_tizen 2.3
  */
 typedef enum 
 {
-       TWP_Artcultureheritage, 
-       TWP_Alcohol,            
-       TWP_Anonymizers, 
-       TWP_Anonymizingutilities, 
-       TWP_Business, 
-       TWP_Chat, 
-       TWP_Publicinformation, 
-       TWP_Potentialcriminalactivities,  
-       TWP_Drugs, 
-       TWP_Educationreference, 
-       TWP_Entertainment, 
-       TWP_Extreme, 
-       TWP_Financebanking, 
-       TWP_Gambling, 
-       TWP_Games, 
-       TWP_Governmentmilitary, 
-       TWP_Potentialhackingcomputercrime, 
-       TWP_Health, 
-       TWP_Humorcomics, 
-       TWP_Discrimination, 
-       TWP_Instantmessaging, 
-       TWP_Stocktrading, 
-       TWP_Internetradiotv, 
-       TWP_Jobsearch, 
-       TWP_Informationsecurity, 
-       TWP_E_RESERVED_1, 
-       TWP_Mobilephone, 
-       TWP_Mediadownloads, 
-       TWP_Malicioussites, 
-       TWP_E_RESERVED_2, 
-       TWP_Nudity, 
-       TWP_Nonprofitadvocacyngo, 
-       TWP_Generalnews, 
-       TWP_Onlineshopping, 
-       TWP_Provocativeattire, 
-       TWP_P2pfilesharing, 
-       TWP_Politicsopinion, 
-       TWP_Personalpages, 
-       TWP_Portalsites, 
-       TWP_Remoteaccess, 
-       TWP_Religionideology, 
-       TWP_Resourcesharing, 
-       TWP_Searchengines, 
-       TWP_Sports, 
-       TWP_Streamingmedia, 
-       TWP_Sharewarefreeware, 
-       TWP_Pornography, 
-       TWP_Spywareadwarekeyloggers, 
-       TWP_Tobacco, 
-       TWP_Travel, 
-       TWP_Violence, 
-       TWP_Webads, 
-       TWP_Weapons, 
-       TWP_Webmail, 
-       TWP_Webphone, 
-       TWP_Auctionsclassifieds, 
-       TWP_Forumbulletinboards, 
-       TWP_Profanity, 
-       TWP_Schoolcheatinginformation, 
-       TWP_Sexualmaterials, 
-       TWP_Gruesomecontent, 
-       TWP_Visualsearchengine, 
-       TWP_Technicalbusinessforums, 
-       TWP_Gamblingrelated, 
-       TWP_Messaging, 
-       TWP_Gamecartoonviolence, 
-       TWP_Phishing, 
-       TWP_Personalnetworkstorage, 
-       TWP_Spamurls, 
-       TWP_Interactivewebapplications, 
-       TWP_Fashionbeauty, 
-       TWP_Softwarehardware, 
-       TWP_Potentialillegalsoftware, 
-       TWP_Contentserver, 
-       TWP_Internetservices, 
-       TWP_Mediasharing, 
-       TWP_Incidentalnudity, 
-       TWP_Marketingmerchandising, 
-       TWP_Parkeddomain, 
-       TWP_Pharmacy, 
-       TWP_Restaurants, 
-       TWP_Realestate, 
-       TWP_Recreationhobbies, 
-       TWP_Blogswiki, 
-       TWP_Digitalpostcards, 
-       TWP_Historicalrevisionism, 
-       TWP_Technicalinformation, 
-       TWP_Datingpersonals, 
-       TWP_Motorvehicles, 
-       TWP_Professionalnetworking, 
-       TWP_Socialnetworking, 
-       TWP_Texttranslators, 
-       TWP_Webmeetings, 
-       TWP_Forkids, 
-       TWP_E_RESERVED_3, 
-       TWP_Moderated, 
-       TWP_Textspokenonly, 
-       TWP_Controversialopinions, 
-       TWP_Residentialipaddresses, 
-       TWP_Browserexploits, 
-       TWP_Consumerprotection, 
-       TWP_Illegaluk, 
-       TWP_Majorglobalreligions, 
-       TWP_Maliciousdownloads, 
-       TWP_Potentiallyunwantedprograms, 
-       
-       TWP_LastCategoryPlaceholder = 128,       
-       TWP_OverallPhishing = 129,                      
-       TWP_OverallRiskHigh = 130,                      
-       TWP_OverallRiskMedium = 131,            
-       TWP_OverallRiskMinimal = 132,           
-       TWP_OverallRiskUnverified = 137,
-       TWP_LastAttributePlaceholder = 160,     
+    TWP_Artcultureheritage, /**< Artculture and heritage */
+    TWP_Alcohol, /**< Alcohol */
+    TWP_Anonymizers, /**< Anonymizers */
+    TWP_Anonymizingutilities, /**< Anonymizingutilities */
+    TWP_Business, /**< Business */
+    TWP_Chat, /**< Chat */
+    TWP_Publicinformation, /**< Publicinformation */
+    TWP_Potentialcriminalactivities, /**< Potentialcriminalactivities */
+    TWP_Drugs, /**< Drugs */
+    TWP_Educationreference, /**< Educationreference */
+    TWP_Entertainment, /**< Entertainment */
+    TWP_Extreme, /**< Extreme */
+    TWP_Financebanking, /**< Finance banking */
+    TWP_Gambling, /**< Gambling */
+    TWP_Games, /**< Games */
+    TWP_Governmentmilitary, /**< Governmentmilitary */
+    TWP_Potentialhackingcomputercrime, /**< Potential hacking and computer crime */
+    TWP_Health, /**< Health */
+    TWP_Humorcomics, /**< Humorcomics */
+    TWP_Discrimination, /**< Discrimination */
+    TWP_Instantmessaging, /**< Instantmessaging */
+    TWP_Stocktrading, /**< Stocktrading */
+    TWP_Internetradiotv, /**< Internet radio and tv */
+    TWP_Jobsearch, /**< Jobsearch */
+    TWP_Informationsecurity, /**< Information security */
+    TWP_E_RESERVED_1, /**< Reserved */
+    TWP_Mobilephone, /**< Mobilephone */
+    TWP_Mediadownloads, /**< Media downloads */
+    TWP_Malicioussites, /**< Maliciouss ites */
+    TWP_E_RESERVED_2, /**< REserved */
+    TWP_Nudity, /**< Nudity */
+    TWP_Nonprofitadvocacyngo, /**< Non profit advocacy ngo */
+    TWP_Generalnews, /**< General news */
+    TWP_Onlineshopping, /**< Online shopping */
+    TWP_Provocativeattire, /**< Provocative attire */
+    TWP_P2pfilesharing, /**< P2p file sharing */
+    TWP_Politicsopinion, /**< Politics opinion */
+    TWP_Personalpages, /**< Personal pages */
+    TWP_Portalsites, /**< Portal sites */
+    TWP_Remoteaccess, /**< Remote access */
+    TWP_Religionideology, /**< Religionideology */
+    TWP_Resourcesharing, /**< Resource sharing */
+    TWP_Searchengines, /**< Search engines */
+    TWP_Sports, /**< Sports */
+    TWP_Streamingmedia, /**< Streaming media */
+    TWP_Sharewarefreeware, /**< Shareware and freeware */
+    TWP_Pornography, /**< Pornography */
+    TWP_Spywareadwarekeyloggers, /**< Spyware and adware and keyloggers */
+    TWP_Tobacco, /**< Tobacco */
+    TWP_Travel, /**< Travel */
+    TWP_Violence, /**< Violence */
+    TWP_Webads, /**< Webads */
+    TWP_Weapons, /**< Weapons */
+    TWP_Webmail, /**< Webmail */
+    TWP_Webphone, /**< Webphone */
+    TWP_Auctionsclassifieds, /**< Auctions and classifieds */
+    TWP_Forumbulletinboards, /**< Forum and bulletinboards */
+    TWP_Profanity, /**< Profanity */
+    TWP_Schoolcheatinginformation, /**< Schoolcheating information */
+    TWP_Sexualmaterials, /**< Sexual materials */
+    TWP_Gruesomecontent, /**< Gruesomecontent */
+    TWP_Visualsearchengine, /**< Visual search engine */
+    TWP_Technicalbusinessforums, /**< Technical business forums */
+    TWP_Gamblingrelated, /**< Gambling related */
+    TWP_Messaging, /**< Messaging */
+    TWP_Gamecartoonviolence, /**< Game and cartoon violence */
+    TWP_Phishing, /**< Phishing */
+    TWP_Personalnetworkstorage, /**< Personal network storage */
+    TWP_Spamurls, /**< Spamurls */
+    TWP_Interactivewebapplications, /**< Interactive webapplications */
+    TWP_Fashionbeauty, /**< Fashionbeauty */
+    TWP_Softwarehardware, /**< Softwarehardware */
+    TWP_Potentialillegalsoftware, /**< Potentialillegalsoftware */
+    TWP_Contentserver, /**< Contentserver */
+    TWP_Internetservices, /**< Internetservices */
+    TWP_Mediasharing, /**< Mediasharing */
+    TWP_Incidentalnudity, /**< Incidentalnudity */
+    TWP_Marketingmerchandising, /**< Marketing merchandising */
+    TWP_Parkeddomain, /**< Parkeddomain */
+    TWP_Pharmacy, /**< Pharmacy */
+    TWP_Restaurants, /**< Restaurants */
+    TWP_Realestate, /**< Realestate */
+    TWP_Recreationhobbies, /**< Recreation hobbies */
+    TWP_Blogswiki, /**< Blogs wiki */
+    TWP_Digitalpostcards, /**< Digital postcards */
+    TWP_Historicalrevisionism, /**< Historical revisionism */
+    TWP_Technicalinformation, /**< Technical information */
+    TWP_Datingpersonals, /**< Dating personals */
+    TWP_Motorvehicles, /**< Motor vehicles */
+    TWP_Professionalnetworking, /**< Professional networking */
+    TWP_Socialnetworking, /**< Socialnetworking */
+    TWP_Texttranslators, /**< Text translators */
+    TWP_Webmeetings, /**< Web meetings */
+    TWP_Forkids, /**< For kids */
+    TWP_E_RESERVED_3, /**< Reserved */
+    TWP_Moderated, /**< Moderated */
+    TWP_Textspokenonly, /**< Text spoken only */
+    TWP_Controversialopinions, /**< Controversial opinions */
+    TWP_Residentialipaddresses, /**< Residential ip addresses */
+    TWP_Browserexploits, /**< Browser exploits */
+    TWP_Consumerprotection, /**< Consumer protection */
+    TWP_Illegaluk, /**< Illegal site in uk */
+    TWP_Majorglobalreligions, /**< Major global religions */
+    TWP_Maliciousdownloads, /**< Malicious downloads */
+    TWP_Potentiallyunwantedprograms, /**< Potentially unwanted programs */
+
+    TWP_LastCategoryPlaceholder = 128, /**< LastCategory Placeholder */
+    TWP_OverallPhishing = 129, /**< Overall Phishing site*/
+    TWP_OverallRiskHigh = 130, /**< Overall RiskHigh */
+    TWP_OverallRiskMedium = 131, /**< Overall RiskMedium */
+    TWP_OverallRiskMinimal = 132, /**< Overall RiskMinimal */
+    TWP_OverallRiskUnverified = 137, /**< Overall risk unverified */
+    TWP_LastAttributePlaceholder = 160, /**< LastAttribute Placeholder */
 } TWPCategories;
 
 /**
- * Risk level
+ * @brief Risk level
+ * @since_tizen 2.3
  */
 typedef enum
 {
-       TWP_Minimal,            
-       TWP_Unverified,         
-       TWP_Medium,                     
-       TWP_High,                       
+       TWP_Minimal, /**< Risk minimal */
+       TWP_Unverified, /**< Risk unverified  */
+       TWP_Medium, /**< Risk medium */
+       TWP_High, /**< Risk High */
 } TWPRiskLevel;
 
 /**
- * Score range
+ * @brief Score range
+ * @since_tizen 2.3
  */
 typedef enum 
 {
-       TWP_MinimalLow = 0,     
-       TWP_MinimalHigh = 14, 
-       TWP_UnverifiedLow = 15, 
-       TWP_UnverifiedHigh = 29, 
-       TWP_MediumLow = 30, 
-       TWP_MediumHigh = 49, 
-       TWP_HighLow= 50, 
-       TWP_HighHigh = 127 
+       TWP_MinimalLow = 0, /**< Lowest score coresponding to the minimal level */
+       TWP_MinimalHigh = 14, /**< Highest score coresponding to the minimal level */
+       TWP_UnverifiedLow = 15, /**< Lowest score coresponding to the unverified level */
+       TWP_UnverifiedHigh = 29, /**< Highest score coresponding to the unverified level */
+       TWP_MediumLow = 30, /**< Lowest score coresponding to the medium level */
+       TWP_MediumHigh = 49, /**< Highest score coresponding to the medium level */
+       TWP_HighLow= 50, /**< Lowest score coresponding to the high level */
+       TWP_HighHigh = 127 /**< Highest score coresponding to the high level */
 } TWPScoreRange;
 
 /**
- * HTTP submit method
+ * @brief HTTP submit method
+ * @since_tizen 2.3
  */
 typedef enum
 {
-       TWPPOST, 
+       TWPPOST, /**< HTTP Post method */
 } TWPSubmitMethod;
        
 /* forward declaration */
-struct TWPRequest;      
+struct TWPRequest;     
+
+/**
+ * @brief typedef declaration of the pointer to TWPConfiguration structure
+ * @since_tizen 2.3
+ */
 typedef struct TWPConfiguration *TWPConfigurationHandle;
+
+/**
+ * @brief typedef declaration of the pointer to TWPResponse structure
+ * @since_tizen 2.3
+ */
 typedef struct TWPResponse*    TWPResponseHandle;
+
+/**
+ * @brief typedef declaration of the pointer to TWPUrlRating structure
+ * @since_tizen 2.3
+ */
 typedef struct TWPUrlRating *TWPUrlRatingHandle;
+
+/**
+ * @brief typedef declaration of the pointer to TWPPolicy structure
+ * @since_tizen 2.3
+ */
 typedef struct TWPPolicy *TWPPolicyHandle;
+
+/**
+ * @brief typedef declaration of the pointer to memory allocation function
+ *
+ * @since_tizen 2.3
+ * @param[in] size allocation size
+ * @return pointer to the allocated memory. NULL if failed to allocate
+ * @see #TWPAPIInit
+ */
 typedef void *(*TWPFnMemAlloc)(TWPMallocSizeT size);
+
+/**
+ * @brief typedef declaration of the pointer to memory release function
+ *
+ * @since_tizen 2.3
+ * @param[in] address an address of memroy region which is returned by void *(*TWPFnMemAlloc)(TWPMallocSizeT size);
+ * @see #TWPAPIInit
+ */
 typedef void (*TWPFnMemFree)(void *address);
+
+/**
+ * @brief typedef declaration of the pointer to random number generation function
+ *
+ * @since_tizen 2.3
+ * @return random number in the range of 'long' type size
+ * @see #TWPConfiguration
+ */
 typedef long (*TWPFnRandom)(void);
+
+/**
+ * @brief typedef declaration of the pointer to the function which sets request URL
+ *
+ * @since_tizen 2.3
+ * @param[in] request Pointer to struct TWPRequest which was passed to TWPLookupUrl()
+ * @param[in] url Url to be set
+ * @param[in] length The string length of the Url
+ * @return #TWP_RESULT
+ * @retval #TWP_SUCCESS Url is set successfuly
+ * @see #TWPRequest
+ * @see TWPLookupUrl()
+ */
 typedef TWP_RESULT (*TWPFnRequestSetUrl)(struct TWPRequest *request, const char *url,
                                          unsigned int length);
+
+/**
+ * @brief typedef declaration of the function of request method
+ *
+ * @since_tizen 2.3
+ * @param[in] request Pointer to struct TWPRequest which was passed to TWPLookupUrl()
+ * @param[in] only WP_POST is passed
+ * @return #TWP_RESULT
+ * @retval #TWP_SUCCESS Method was successfuly set
+ * @see #TWPRequest 
+ * @see TWPLookupUrl()
+ */
 typedef TWP_RESULT (*TWPFnRequestSetMethod)(struct TWPRequest *request, TWPSubmitMethod method);
+
+/**
+ * @brief typedef declaration of the function to send request
+ *
+ * @since_tizen 2.3
+ * @param[in] request Pointer to struct TWPRequest which was passed to TWPLookupUrl()
+ * @param[in] response TWPResponseHandle. Set NULL for synchronous request.\n
+ *            uninitialized response object for asynchronous request            
+ * @param[in] data request body to send to the server
+ * @param[in] length the lengh of the reqest body
+ * @return #TWP_RESULT 
+ * @retval #TWP_SUCCESS if request is successfully sent
+ * @see #TWPRequest
+ * @see TWPLookupUrl()
+ */
 typedef TWP_RESULT (*TWPFnRequestSend)(struct TWPRequest *request, TWPResponseHandle response,
                                        const void *data, unsigned int length);
+
+/**
+ * @brief typedef declaration of the function to receive request
+ *
+ * @since_tizen 2.3
+ * @param[in] request Pointer to struct TWPRequest which was passed to TWPLookupUrl()
+ * @param[in] buffer Buffer to store response 
+ * @param[in] buffer_length The length of the buffer in byte 
+ * @param[in] length number of bytes that is acutualy stored in the buffer
+ * @return #TWP_RESULT
+ * @retval #TWP_SUCCESS if response is successfully stored in the buffer
+ * @see #TWPRequest
+ * @see TWPLookupUrl()
+ */
 typedef TWP_RESULT (*TWPFnRequestReceive)(struct TWPRequest *request, void *buffer,
                                           unsigned int buffer_length, unsigned int *length);   
 
 /**
- * Initialize data requested by SDK initialization
+ * @brief Initialize data requested by SDK initialization
+ * @since_tizen 2.3
  */
 typedef struct TWPAPIInit
 {
-    int api_version;           
-    TWPFnMemAlloc memallocfunc;                
-    TWPFnMemFree memfreefunc;
+    int api_version; /**< Version of this structure */
+    TWPFnMemAlloc memallocfunc; /**< Pointer to malloc function */
+    TWPFnMemFree memfreefunc; /**< Pointer to free function */
 } TWPAPIInit;
 
 /**
- * Configuration which enable caller to customize the SDK
+ * @brief Configuration which enable caller to customize the SDK
+ * @since_tizen 2.3
  */
 typedef struct TWPConfiguration
 {
-       int config_version; /* Configuration version */
-       const char *client_id; /* Client id for cloud to qualify */
-       const char *client_key; /* Corresponding key for specific client for validation from cloud */
-       const char *host; /* Host name for cloud where SDK send request to, set to NULL for SDK to use default settings in plug-in */
-       int     secure_connection; /* 1 - use secured connection (HTTPS), 0 - not secured connection. */
-       int     skip_dla; /* 1 - disable DLA lookup, 0 - enable DLA lookup */
-       int     obfuscate_request; /* 1 - obfuscate request data, 0 - do not obfuscate request data */
-       TWPFnRandom randomfunc; /* Caller customized random function */
+       int config_version; /**< Configuration version */
+       const char *client_id; /**< Client id for cloud to qualify */
+       const char *client_key; /**< Corresponding key for specific client for validation from cloud */
+       const char *host; /**< Host name for cloud where SDK send request to, set to NULL for SDK to use default settings in plug-in */
+       int     secure_connection; /**< 1 - use secured connection (HTTPS), 0 - not secured connection. */
+       int     skip_dla; /**< 1 - disable DLA lookup, 0 - enable DLA lookup */
+       int     obfuscate_request; /**< 1 - obfuscate request data, 0 - do not obfuscate request data */
+       TWPFnRandom randomfunc; /**< Caller customized random function */
 } TWPConfiguration;
 
 /**
- * Request for SDK to check URL against cloud database
+ * @brief Request for SDK to check URL against cloud database
+ * @since_tizen 2.3
  */
 typedef struct TWPRequest
 {
-       int request_version; /* Request version */
-       TWPFnRequestSetUrl seturlfunc; /* Callback for SDK to set URL from SDK */       
-       TWPFnRequestSetMethod setmethodfunc; /* Callback for SDK to set HTTP request method */
-       TWPFnRequestSend sendfunc; /* Callback for SDK to send HTTP request */
-       TWPFnRequestReceive receivefunc; /* Callback for SDK to receive HTTP response, if caller set it to be NULL,
+       int request_version; /**< Request version */
+       TWPFnRequestSetUrl seturlfunc; /**< Callback for SDK to set URL from SDK */
+       TWPFnRequestSetMethod setmethodfunc; /**< Callback for SDK to set HTTP request method */
+       TWPFnRequestSend sendfunc; /**< Callback for SDK to send HTTP request */
+       TWPFnRequestReceive receivefunc; /**< Callback for SDK to receive HTTP response, if caller set it to be NULL,
                                         SDK will assume the HTTP request will be handled in a-synchronized manner */
 } TWPRequest;
        
 /**
- * \brief
- * Initialize SDK
+ * @brief Initialize SDK.
+ * @details This is a synchronized API
  *
- * This is a synchronized API
+ * @since_tizen 2.3
+ * @param[in] pApiInit API initialization data structure.
  *
- * \param[in] pApiInit API initialization data structure.
- *
- * \return TWP_RESULT
+ * @return TWP library interface handle on success, otherwise #INVALID_TWPLIB_HANDLE.
+ * @see TWPLibraryClose()
  */
 TWPLIB_HANDLE TWPInitLibrary(TWPAPIInit *pApiInit);
 
 /**
- * \brief
- * Uninitialize SDK
- *
- * This is a synchronized API
+ * @brief Uninitialize SDK.
+ * @details This is a synchronized API
  *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen().
+ * @see TWPLibraryOpen()
  */
 void TWPUninitLibrary(TWPLIB_HANDLE hLib);
 
 /**
- * \brief
- * Create TWP configuration to customize SDK
- * 
- * This is a synchronized API
- *
- * \param[in] pConfigure caller configurations
- * \param[out] phConfigure created configuration for SDK
- *
- * \return TWP_RESULT
+ * @brief Create TWP configuration to customize SDK.
+ * @details This is a synchronized API.
+ *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen(). 
+ * @param[in] pConfigure caller configurations
+ * @param[out] phConfigure created configuration for SDK
+ *
+ * @return #TWP_RESULT
+ * @retval #TWP_SUCCESS - on success.
+ * @retval #TWP_INVALID_PARAMETER - if any of the following errors occur:
+ *           - pConfigure is NULL \n
+ *           - phConfigure is NULL \n
+ *           - TWPConfigration.randomfunc is NULL and TWPConfiguration.obfuscate_request is not NULL
+ * @retval #TWP_INVALID_VERSION - TWPConfiguration.config_version is not TWP_CONFIG_VERSION
+ * @retval #TWP_NOMEM - The function failed to allocate memory required to complete initialization of the configuration object
+ * @see #TWPConfiguration
+ * @see TWPConfigurationDestroy()
  */
 TWP_RESULT TWPConfigurationCreate(TWPLIB_HANDLE hLib, TWPConfiguration *pConfigure, TWPConfigurationHandle *phConfigure);
 
 /**
- * \brief
- * Release the configuration resources allocated by TWPConfigurationCreate
- *
- * This is a synchronized API
- *
- * \param[in] hConfigure configuration to be destroyed
- *
- * \return TWP_RESULT
+ * @brief Release the configuration resources allocated by TWPConfigurationCreate().
+ * @details This is a synchronized API.
+ *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen(). 
+ * @param[in] phConfigure configuration to be destroyed
+ * @return #TWP_RESULT
+ * @retval #TWP_SUCCESS - on success. 
+ * @retval #TWP_INVALID_HANDLE - the value that is pointed to by phConfigure is invalid
+ * @see TWPConfigurationCreate()
  */
-TWP_RESULT TWPConfigurationDestroy(TWPLIB_HANDLE hLib, TWPConfigurationHandle *hConfigure);
+TWP_RESULT TWPConfigurationDestroy(TWPLIB_HANDLE hLib, TWPConfigurationHandle *phConfigure);
 
 /**
- * \brief
- * Main function for caller to check URL reputation against the cloud database
- *
- * This can be a synchronized API or a-synchronized API depends on the configuration from caller
- *
- * Synchronous mode
- *      In this synchronous operation mode, the function invokes TWPRequest::sendfunc and
- *      TWPRequest::receivefunc, one right after the other, expecting the entire HTTP
- *      transaction to be completed between the calls. Upon successful completion, the
- *      phResponse will point to a valid response handle that can be used to analyze results.
- *
- * Asynchronous mode
- *      In the asynchronous mode, the function invokes TWPRequest::sendfunc and returns
- *      immediately with TWP_SUCCESS. Upon completion, phResponse is NULL. The application
- *      is supposed to complete the HTTP transaction while calling TWPResponseWrite as
- *      response data becomes available. When all data was read, TWPResponseWrite must
- *      be called again with zero data length to signal the end transaction.
- *
- * \param[in] hConfigure Configuration of caller
- * \param[in] pRequest Request data structure for SDK to check with cloud
- * \param[in] iRedirUrl 1 indicating instruct the cloud server to provide a landing page
- *            URL to which blocked URLs can be redirected.
- * \param[in] ppUrls An array of 7 bit ASCII character strings representing URLs to obtain
- *            the rating for.
- *
- *            Note: All URLs have to be normalized before submission (see RFC 3986) and
- *            pynicoded if required.
- * \param[in] uCount Length of the ppUrls array.
- * \param[out] phResponse For synchronous requests, a pointer to the location where the
- *             response object handle will be stored upon completion. It can be NULL for
+ * @brief Main function for caller to check URL reputation against the cloud database.
+ * @details This can be a synchronized API or a-synchronized API depends on the configuration from caller. \n
+ * \n
+ * Synchronous mode \n
+ *      In this synchronous operation mode, the function invokes TWPRequest::sendfunc and \n
+ *      TWPRequest::receivefunc, one right after the other, expecting the entire HTTP \n
+ *      transaction to be completed between the calls. Upon successful completion, the \n
+ *      phResponse will point to a valid response handle that can be used to analyze results. \n
+ * \n
+ * Asynchronous mode \n
+ *      In the asynchronous mode, the function invokes TWPRequest::sendfunc and returns \n
+ *      immediately with TWP_SUCCESS. Upon completion, phResponse is NULL. The application \n
+ *      is supposed to complete the HTTP transaction while calling TWPResponseWrite as \n
+ *      response data becomes available. When all data was read, TWPResponseWrite must \n
+ *      be called again with zero data length to signal the end transaction. \n
+ * \n
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen(). 
+ * @param[in] hConfigure Configuration of caller
+ * @param[in] pRequest Request data structure for SDK to check with cloud
+ * @param[in] iRedirUrl 1 indicating instruct the cloud server to provide a landing page \n
+ *            URL to which blocked URLs can be redirected. 
+ * @param[in] ppUrls An array of 7 bit ASCII character strings representing URLs to obtain \n
+ *            the rating for. \n
+ * \n
+ *            Note: All URLs have to be normalized before submission (see RFC 3986) and \n
+ *            pynicoded if required. 
+ * @param[in] uCount Length of the ppUrls array.
+ * @param[out] phResponse For synchronous requests, a pointer to the location where the \n
+ *             response object handle will be stored upon completion. It can be NULL for \n
  *             asynchronous requests.
  *
- * \return TWP_RESULT
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE - hConfigure is not a valid configuraiton handle
+ * @retval #TWP_INVALID_PARAMETER - if any of the following errors occur:
+ *           - ppUrls is NULL \n
+ *           - any string in the ppUrls array is NULL or has zero length \n
+ *           - uCount is 0 \n
+ *           - pRequest is NULL \n
+ *           - TWPRequest.receivefunc is not NULL and TWPRequest.phResponse is NULL (if TWPRequest.receivefunc is NULL, hResponse can be NULL)
+ * @retval #TWP_INVALID_VERSION - TWPConfiguration.config_version is not TWP_CONFIG_VERSION
+ * @retval #TWP_NOMEM - The function failed to allocate memory required to complete initialization of the configuration object
+ * @retval #TWP_SUCCESS - on success. 
+ * @retval other - Any integer value other than TWP_SUCCESS is returned by TWPRequest::setmethodfunc, TWPRequest::seturlfunc and TWPRequest::sendfunc functions
+ * @see #TWPRequest
+ * @see TWPLookupUrls()
+ * @see TWPResponseDestory()
  */
 TWP_RESULT TWPLookupUrls(TWPLIB_HANDLE hLib, TWPConfigurationHandle hConfigure, TWPRequest *pRequest,
                          int iRedirUrl, const char **ppUrls, unsigned int uCount, TWPResponseHandle *phResponse);
 
 /**
- * \brief
- * In asynchronous mode, caller will call this API to write received HTTP response data
- * to SDK. Writing with zero data length will be taken as end of HTTP transaction for
- * SDK.
- *
- * This is a synchronized API
- *
- * \param[in] hResponse Response handle for SDK to keep track on HTTP transaction.
- * \param[in] pData Received HTTP response data chunk.
- * \param[in] uLength Length of the HTTP response data.
- *
- * \return TWP_RESULT
+ * @brief In asynchronous mode, caller will call this API to write received HTTP response data to SDK.
+ * @details Writing with zero data length will be taken as end of HTTP transaction for SDK. \n
+ * This is a synchronized API.
+ *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen(). 
+ * @param[in] hResponse Response handle for SDK to keep track on HTTP transaction.
+ * @param[in] pData Received HTTP response data chunk.
+ * @param[in] uLength Length of the HTTP response data.
+ *
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE - hResponse is not a valid handle
+ * @retval #TWP_ERROR - Internal error occured
+ * @retval #TWP_INVALID_RESPONSE - Server response is invalid. This can usually happen when the entire response \n
+ *                                was not passed to the SDK
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPLookupUrls()
+ * @see TWPResponseDestory()
  */
 TWP_RESULT TWPResponseWrite(TWPLIB_HANDLE hLib, TWPResponseHandle hResponse, const void *pData, unsigned uLength);
 
 /**
- * \brief
- * Get web site rating by its index in URL list in the response which comply to
- * the URL list order passed by caller in TWPLookupUrls().
- *
- * This is a synchronized API
- *
- * \param[in] hResponse Response handle created based on cloud response.
- * \param[in] iIndex Index of the web site in request list.
- * \param[out] phRating Rating of the specified web site.
- *
- * \return TWP_RESULT
+ * @brief Get web site rating by its index in URL list in the response which comply to the URL list order passed by caller in TWPLookupUrls().
+ * @details This is a synchronized API.
+ *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen(). 
+ * @param[in] hResponse Response handle created based on cloud response.
+ * @param[in] uIndex Index of the web site in request list.
+ * @param[out] phRating Rating of the specified web site.
+ *
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE - hResponse is not a valid handle
+ * @retval #TWP_INVALID_PARAMETER - phRating is NULL 
+ * @retval #TWP_NO_DATA - Index is out of bound
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPLookupUrls()
+ * @see TWPResponseDestory()
  */
 TWP_RESULT TWPResponseGetUrlRatingByIndex(TWPLIB_HANDLE hLib, TWPResponseHandle hResponse, unsigned int uIndex,
                                           TWPUrlRatingHandle *phRating);
 
 /**
- * \brief
- * Get web site rating by its URL string.
- *
- * This is a synchronized API
- *
- * \param[in] hResponse Response handle created based on cloud response.
- * \param[in] pUrl URL string
- * \param[in] iUrlLength URL string length
- * \param[out] hRating Rating of the specified web site
- *
- * \return TWP_RESULT
+ * @brief Get web site rating by its URL string.
+ * @details This is a synchronized API.
+ *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen(). 
+ * @param[in] hResponse Response handle created based on cloud response.
+ * @param[in] pUrl URL string
+ * @param[in] uUrlLength URL string length
+ * @param[out] phRating Rating of the specified web site
+ *
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE - hResponse is not a valid handle
+ * @retval #TWP_INVALID_PARAMETER - phRating is NULL 
+ * @retval #TWP_NO_DATA - pUrl does not corespond to an existing URL rating object
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPLookupUrls()
+ * @see TWPResponseDestory()
  */
 TWP_RESULT TWPResponseGetUrlRatingByUrl(TWPLIB_HANDLE hLib, TWPResponseHandle hResponse, const char *pUrl,
-                                        unsigned int uUrlLength, TWPUrlRatingHandle *hRating);
+                                        unsigned int uUrlLength, TWPUrlRatingHandle *phRating);
 
 /**
- * \brief
- * Get the redirection URL for blocked URL to display to user.
- *
- * Blocking pages can be used by application that want to block users
- * from navigating to a URL that violates one of the defined policies.
- * The returned string must be deallocated by the application using
- * TWPAPIInit::TWPFnMemFree function.
- *
- * \param[in] hResponse Response handle created based on cloud response.
- * \param[in] hRating Rating handle resolved from cloud response.
- * \param[in] hPolicy Policy handle created by caller.
- * \param[out] ppUrl Redirection URL.
- * \param[ou] puLength Length of redirection URL
- *
- * \return TWP_RESULT
+ * @brief Get the redirection URL for blocked URL to display to user.
+ * @details Blocking pages can be used by application that want to block users \n
+ * from navigating to a URL that violates one of the defined policies. \n
+ * The returned string must be deallocated by the application using \n
+ * TWPAPIInit::TWPFnMemFree function. \n
+ *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen().
+ * @param[in] hResponse Response handle created based on cloud response.
+ * @param[in] hRating Rating handle resolved from cloud response.
+ * @param[in] hPolicy Policy handle created by caller.
+ * @param[out] ppUrl Redirection URL.
+ * @param[out] puLength Length of redirection URL
+ *
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE - One of hResponse, hRating and hPolicy is not a valid handle
+ * @retval #TWP_INVALID_PARAMETER - ppUrl is NULL 
+ * @retval #TWP_NO_DATA - The URL rating does not violate the policy (if TWPPolicyValidate() called with HPolicy and hRating would indicate no violations)
+ * @retval #TWP_ERROR - An internal error occurs
+ * @retval #TWP_NOMEM - Memory for the URL can not be allocated
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPLookupUrls()
+ * @see TWPResponseDestory()
  */
 TWP_RESULT TWPResponseGetRedirUrlFor(TWPLIB_HANDLE hLib, TWPResponseHandle hResponse, TWPUrlRatingHandle hRating,
                                      TWPPolicyHandle hPolicy, char **ppUrl, unsigned int *puLength);
 
 /**
- * \brief
- * Get the rating count of specified response.
- *
- * \param[in] hResponse Response handle created based on cloud response.
- * \param[out] puCount Rating count.
- *
- * \return TWP_RESULT
+ * @brief Get the rating count of specified response.
+ *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen().
+ * @param[in] hResponse Response handle created based on cloud response.
+ * @param[out] puCount Rating count.
+ *
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE - hResponse is not valid
+ * @retval #TWP_INVALID_PARAMETER - puCount is NULL 
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPLookupUrls()
+ * @see TWPResponseDestory()
  */
 TWP_RESULT TWPResponseGetUrlRatingsCount(TWPLIB_HANDLE hLib, TWPResponseHandle hResponse, unsigned int *puCount);      
 
 /**
- * \brief
- * Release resource for response handle.
+ * @brief Release resource for response handle.
  *
- * \param[in] hResponse Response handle created based on cloud response.
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen().
+ * @param[in] phResponse Response handle created based on cloud response.
  *
- * \return TWP_RESULT
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE - phResponse is not valid
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPLookupUrls()
  */
-TWP_RESULT TWPResponseDestroy(TWPLIB_HANDLE hLib, TWPResponseHandle *hResponse);
+TWP_RESULT TWPResponseDestroy(TWPLIB_HANDLE hLib, TWPResponseHandle *phResponse);
 
 /**
- * \brief
- * Create the policy (set of web site categories) caller want to check.
- *
- * \param[in] hCfg configuration handle
- * \param[in] pCategories Web site category list
- * \param[in] uCount Category list length.
- * \param[out] phPolicy Policy handle.
- *
- * \return TWP_RESULT
+ * @brief Create the policy (set of web site categories) caller want to check.
+ *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen().
+ * @param[in] hCfg configuration handle
+ * @param[in] pCategories Web site category list
+ * @param[in] uCount Category list length.
+ * @param[out] phPolicy Policy handle.
+ *
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_PARAMETER - if one of the following errors occur:
+ *                                  - uCount is 0
+ *                                  - phPolicy is NULL 
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPPolicyDestroy()
  */
-TWP_RESULT TWPPolicyCreate(TWPLIB_HANDLE hLib, TWPConfigurationHandle hCfg, TWPCategories *pCategories, unsigned int uCount, TWPPolicyHandle *hPolicy);
+TWP_RESULT TWPPolicyCreate(TWPLIB_HANDLE hLib, TWPConfigurationHandle hCfg, TWPCategories *pCategories, unsigned int uCount, TWPPolicyHandle *phPolicy);
 
 /**
- * \brief
- * Compare the categories assigned by security vendor to the URL represented
+ * @brief Compare the categories assigned by security vendor to the URL represented 
  * by hRating with the categories assigned to the policy handle.
  *
- * \param[in] hPolicy Polcy handle
- * \param[in] hRating Rating for specific URL
- * \param[out] piVialated non-zero if intersection found between the policy and URL rating categories.
- *
- * \return TWP_RESULT
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen().
+ * @param[in] hPolicy Polcy handle
+ * @param[in] hRating Rating for specific URL
+ * @param[out] piViolated non-zero if intersection found between the policy and URL rating categories.
+ *
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE if hPolicy or hRating does not correspond to a valid handle
+ * @retval #TWP_INVALID_PARAMETER - piViolated is NULL
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPResponseGetUrlRatingByUrl()
+ * @see TWPResponseGetUrlRatingByIndex()
  */
 TWP_RESULT TWPPolicyValidate(TWPLIB_HANDLE hLib, TWPPolicyHandle hPolicy, TWPUrlRatingHandle hRating, int *piViolated);
 
 /**
- * \brief
- * Retrieves all categories common between the policy and URL rating.
+ * @brief Retrieves all categories common between the policy and URL rating.
  *
- * \param[in] hPolicy Policy handle.
- * \param[in] hRating URL rating handle.
- * \param[out] ppViolated An array of all common categories. This array is allocated by using
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen().
+ * @param[in] hPolicy Policy handle.
+ * @param[in] hRating URL rating handle.
+ * @param[out] ppViolated An array of all common categories. This array is allocated by using \n
  *             TWPAPIInit::memallocfunc and has to be deallocated by the caller.
- * \param[out] puLength Length of violation array.
- *
- * \return TWP_RESULT
+ * @param[out] puLength Length of violation array.
+ *
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE if hPolicy or hRating does not correspond to a valid handle
+ * @retval #TWP_INVALID_PARAMETER - piViolated or piLength is NULL
+ * @retval #TWP_NOMEM - ppViolated can not be allocated
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPResponseGetUrlRatingByUrl()
+ * @see TWPResponseGetUrlRatingByIndex()
  */
 TWP_RESULT TWPPolicyGetViolations(TWPLIB_HANDLE hLib, TWPPolicyHandle hPolicy, TWPUrlRatingHandle hRating,
                                   TWPCategories **ppViolated, unsigned *puLength);
 
 /**
- * \brief
- * Release resource for policy handle.
+ * @brief Release resource for policy handle.
  *
- * \param[in] phPolicy Pointer to policy handle.
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen().
+ * @param[in] phPolicy Pointer to policy handle.
  *
- * \return TWP_RESULT
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE if phPolicy does not correspond to a valid handle
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPPolicyCreate()
  */
-TWP_RESULT TWPPolicyDestroy(TWPLIB_HANDLE hLib, TWPPolicyHandle *hPolicy);
+TWP_RESULT TWPPolicyDestroy(TWPLIB_HANDLE hLib, TWPPolicyHandle *phPolicy);
 
 /**
- * \brief
- * Get score from URL rating data structure which is assigned by security vendor.
- *
- * \param[in] hRating Rating handle.
- * \param[out] piScore URL score.
- *
- * \return TWP_RESULT
+ * @brief Get score from URL rating data structure which is assigned by security vendor.
+ *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen().
+ * @param[in] hRating Rating handle.
+ * @param[out] piScore URL score.
+ *
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE if hRating does not correspond to a valid handle
+ * @retval #TWP_INVALID_PARAMETER - piScore is NULL
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPResponseGetUrlRatingByUrl()
+ * @see TWPResponseGetUrlRatingByIndex()
  */
 TWP_RESULT TWPUrlRatingGetScore(TWPLIB_HANDLE hLib, TWPUrlRatingHandle hRating, int *piScore);
 
 /**
- * \brief
- * Get corresponding URL from rating handle.
- *
- * \param[in] hRating Rating handle.
- * \param[out] ppUrl A pointer to a NULL terminated string representing
- *             the URL. The string is valid as long as the URL rating
- *             handle is valid.
- * \param[out] puLength An optional pointer to the length of URL string.
- *
- * \return TWP_RESULT
+ * @brief Get corresponding URL from rating handle.
+ *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen().
+ * @param[in] hRating Rating handle and the handle should have been obtained using TWPResponseGetUrlRatingByUrl() \n 
+ * TWPResponseGetUrlRatingByIndex()
+ * @param[out] ppUrl A pointer to a NULL terminated string representing \n
+ *             the URL. The string is valid as long as the URL rating \n
+ *             handle is valid. \n
+ * @param[out] puLength An optional pointer to the length of URL string.
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE if hRating does not correspond to a valid handle
+ * @retval #TWP_INVALID_PARAMETER - ppUrl is NULL
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPResponseGetUrlRatingByUrl()
+ * @see TWPResponseGetUrlRatingByIndex()
  */
 TWP_RESULT TWPUrlRatingGetUrl(TWPLIB_HANDLE hLib, TWPUrlRatingHandle hRating, char **ppUrl,
                               unsigned int *puLength);
 
 /**
- * \brief
- * Get DLA (Deep Link Analysis) URL
- *
- * \param[in] hRating Rating handle.
- * \param[out] ppDlaUrl A ponit to a NULL terminated string representing
- *             the DLA URL. This string is valid as long as the URL rating
- *             handle is valid.
- * \param[out] puLength Length of DLA URL string.
- *
- * \return TWP_RESULT
+ * @brief Get DLA (Deep Link Analysis) URL
+ *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen().
+ * @param[in] hRating Rating handle and the handle should have been obtained using TWPResponseGetUrlRatingByUrl() \n 
+ * TWPResponseGetUrlRatingByIndex()
+ * @param[out] ppDlaUrl A ponit to a NULL terminated string representing \n
+ *             the DLA URL. This string is valid as long as the URL rating \n
+ *             handle is valid. \n
+ * @param[out] puLength Length of DLA URL string.
+ *
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE if hRating does not correspond to a valid handle
+ * @retval #TWP_INVALID_PARAMETER - ppDlaUrl is NULL
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPResponseGetUrlRatingByUrl()
+ * @see TWPResponseGetUrlRatingByIndex()
  */
 TWP_RESULT TWPUrlRatingGetDLAUrl(TWPLIB_HANDLE hLib, TWPUrlRatingHandle hRating, char **ppDlaUrl,
                                  unsigned int *puLength);
 
 /**
- * \brief
- * Determine whether the URL rating object has the specified category.
- *
- * \param[in] hRating Rating handle.
- * \param[in] Category Category enum value.
- * \param[out] piPresent Non-zero value indicating exists.
- *
- * \return TWP_RESULT
+ * @brief Determine whether the URL rating object has the specified category.
+ *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen().
+ * @param[in] hRating Rating handle and the handle should have been obtained using TWPResponseGetUrlRatingByUrl() \n 
+ * TWPResponseGetUrlRatingByIndex()
+ * @param[in] Category Category enum value.
+ * @param[out] piPresent Non-zero value indicating exists.
+ *
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE if hRating does not correspond to a valid handle
+ * @retval #TWP_INVALID_PARAMETER - piPresent is NULL
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPResponseGetUrlRatingByUrl()
+ * @see TWPResponseGetUrlRatingByIndex()
  */
 TWP_RESULT TWPUrlRatingHasCategory(TWPLIB_HANDLE hLib, TWPUrlRatingHandle hRating, TWPCategories Category,
                                    int *piPresent);
 
 /**
- * \brief
- * Retrives categories assigned by security vendor for the rated URL.
- *
- * \param[in] hRating Rating handle.
- * \param[out] ppCategories The pointer to a variable that contains the address
- *             of the category list.
- * \param[out] puLength Length of category list.
- *
- * \return TWP_RESULT
+ * @brief Retrives categories assigned by security vendor for the rated URL.
+ *
+ * @since_tizen 2.3
+ * @param[in] hLib TWP library handle returned by TWPLibraryOpen().
+ * @param[in] hRating Rating handle and the handle should have been obtained using TWPResponseGetUrlRatingByUrl() \n 
+ * TWPResponseGetUrlRatingByIndex()
+ * @param[out] ppCategories The pointer to a variable that contains the address \n
+ *             of the category list. \n
+ * @param[out] puLength Length of category list.
+ *
+ * @return #TWP_RESULT
+ * @retval #TWP_INVALID_HANDLE if hPolicy or hRating does not correspond to a valid handle
+ * @retval #TWP_INVALID_PARAMETER - piViolated or piLength is NULL
+ * @retval #TWP_NOMEM - ppViolated can not be allocated
+ * @retval #TWP_SUCCESS - on success. 
+ * @see TWPResponseGetUrlRatingByUrl()
+ * @see TWPResponseGetUrlRatingByIndex()
  */
 TWP_RESULT TWPUrlRatingGetCategories(TWPLIB_HANDLE hLib, TWPUrlRatingHandle hRating, TWPCategories **ppCategories,
                                      unsigned int *puLength);
@@ -579,3 +836,6 @@ TWP_RESULT TWPUrlRatingGetCategories(TWPLIB_HANDLE hLib, TWPUrlRatingHandle hRat
 #endif
 #endif
 
+/**
+ @}
+ */
index b4d2e74..c236875 100644 (file)
@@ -1,35 +1,80 @@
+%define csr_test_build 0
 
-Summary:       Content Security Framework
-Name:          csr-framework
-Version:       1.0.0
-Release:       0
-License:       BSD-3-Clause
-Group:         Security/Libraries
-URL:           http://tizen.org
-Source:        %{name}-%{version}.tar.gz
-Source1001:    csr-framework.manifest
+Name: csr-framework
+Summary: A general purpose content screening and reputation solution
+Version: 1.1.0
+Release: 2
+Group: System/Libraries
+License: BSD-2.0
+URL: http://tizen.org
+Source0: %{name}-%{version}.tar.gz
+Source1001: %{name}.manifest
+BuildRequires: cmake
+BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(libtzplatform-config)
 
 %description
-A general purpose content screening and reputation solution. 
+csr-framework
+
+%package devel
+Summary:    Development files for csr-framework
+Group:      Development/Libraries
+Requires:   %{name} = %{version}-%{release}
+
+%description devel
+csr-framework (development files)
+
+%if 0%{?csr_test_build}
+%package test
+Summary:    test program for csr-framework
+Group:      Security/Testing
+Requires:   %{name} = %{version}-%{release}
+
+%description test
+Comaptilibty test program
+%endif
+
 
 %prep
 %setup -q
-cp %{SOURCE1001} .
+cp -a %SOURCE1001 .
 
-%build 
-make all
+
+%build
+%{!?build_type:%define build_type "Release"}
+%cmake . \
+    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+    -DINCLUDEDIR=%{_includedir}/csf \
+    -DCMAKE_BUILD_TYPE=%build_type \
+%if 0%{?csr_test_build}
+    -DCSR_TEST_BUILD=1 \
+%endif
+    -DVERSION=%{version}
+
+make %{?_smp_mflags}
 
 %install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}%{_libdir}/
-install -D lib/libsecfw.so %{buildroot}%{_libdir}/
+%make_install
 
 %post -p /sbin/ldconfig
-
 %postun -p /sbin/ldconfig
 
-%files 
-%manifest %{name}.manifest
+
+%files
+%manifest %name.manifest
+%license LICENSE
+%{_libdir}/libsecfw.so.*
+
+%files devel
+%doc README
+%doc doc/
+%{_includedir}/csf/TCSErrorCodes.h
+%{_includedir}/csf/TCSImpl.h
+%{_includedir}/csf/TWPImpl.h
+%{_libdir}/pkgconfig/*.pc
 %{_libdir}/libsecfw.so
 
+%if 0%{?csr_test_build}
+%files test
+%{_bindir}/*
+%endif
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644 (file)
index 0000000..711b0f3
--- /dev/null
@@ -0,0 +1,35 @@
+PKG_CHECK_MODULES(TEST_DEP
+    REQUIRED
+    dlog
+    )
+
+SET(${TARGET_TCS_TEST}_SRCS
+    SampleInfo.c
+    TCSTest.c
+    TCSTestUtils.c
+)
+
+SET(${TARGET_TWP_TEST}_SRCS
+    TWPTest.c
+    TWPTestUtils.c
+    XMHttp.c
+    XMPHttp.c
+    )
+
+INCLUDE_DIRECTORIES(
+    SYSTEM
+    ${PROJECT_SOURCE_DIR}/framework
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${TEST_DEP_INCLUDE_DIRS}
+    )
+
+ADD_EXECUTABLE(${TARGET_TCS_TEST} ${${TARGET_TCS_TEST}_SRCS})
+ADD_EXECUTABLE(${TARGET_TWP_TEST} ${${TARGET_TWP_TEST}_SRCS})
+TARGET_LINK_LIBRARIES(${TARGET_TCS_TEST} ${TARGET_LIB})
+TARGET_LINK_LIBRARIES(${TARGET_TWP_TEST} ${TARGET_LIB})
+
+INSTALL(TARGETS
+        ${TARGET_TCS_TEST}
+        ${TARGET_TWP_TEST}
+    DESTINATION bin
+    )
diff --git a/test/Makefile b/test/Makefile
deleted file mode 100644 (file)
index 7af8b11..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-#  Copyright (c) 2013, McAfee, Inc.
-#  
-#  All rights reserved.
-#  
-#  Redistribution and use in source and binary forms, with or without modification,
-#  are permitted provided that the following conditions are met:
-#  
-#  Redistributions of source code must retain the above copyright notice, this list
-#  of conditions and the following disclaimer.
-#  
-#  Redistributions in binary form must reproduce the above copyright notice, this
-#  list of conditions and the following disclaimer in the documentation and/or other
-#  materials provided with the distribution.
-#  
-#  Neither the name of McAfee, Inc. nor the names of its contributors may be used
-#  to endorse or promote products derived from this software without specific prior
-#  written permission.
-#  
-#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-#  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-#  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-#  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-#  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-#  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-#  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-#  OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-OUTDIR=bin
-SRCDIR=.
-
-ifeq ($(TCS_CC), )
-       CC = gcc
-else
-       CC = $(TCS_CC)
-endif
-ifeq ($(TCS_LD), )
-       LD = gcc
-else
-       LD = $(TCS_LD)
-endif
-
-TCS_HEADER_FILE_PATH=../../framework
-
-CFLAGS := $(CFLAGS) -fPIC -g -Wall -O3 -I$(SRCDIR)/port -I$(SRCDIR)/tests -I$(TCS_HEADER_FILE_PATH)
-ifeq ($(LD_FLAGS), )
-LDFLAGS= $(LD_FLAGS) -lc -pthread -L../../framework/lib -lsecfw -ldl
-else
-LDFLAGS= $(LD_FLAGS) -lc -L../../framework/lib -lsecfw -ldl
-endif
-
-TARGET=$(OUTDIR)/tcstest
-
-SOURCES=$(SRCDIR)/TCSTest.c \
-               $(SRCDIR)/TCSTestUtils.c \
-               $(SRCDIR)/SampleInfo.c
-OBJECTS=$(OUTDIR)/TCSTest.o \
-               $(OUTDIR)/TCSTestUtils.o \
-               $(OUTDIR)/SampleInfo.o
-
-$(OUTDIR)/%.o: $(SRCDIR)/%.c
-       $(CC) $(CFLAGS) -o $(OUTDIR)/$*.o -c $(SRCDIR)/$*.c
-
-$(TARGET): $(OUTDIR) $(OBJECTS) $(SOURCES)
-       $(LD) -o $(TARGET) $(OBJECTS) $(LDFLAGS)
-
-all: $(TARGET)
-
-$(OUTDIR):
-       @mkdir $(OUTDIR)
-
-clean:
-       @rm -rf $(OUTDIR)
-
-distclean: clean
-
index d4fd730..dbd6ade 100644 (file)
@@ -264,7 +264,7 @@ static void TCSRemovePlugin(void)
     char *pszCommand;
 
     asprintf(&pszCommand, "rm -f %s", PLUGIN_PATH);
-    CallSys(pszCommand);
+//    CallSys(pszCommand);
     free(pszCommand);
 }
 
index 983e1e8..7d90d60 100644 (file)
@@ -165,6 +165,7 @@ extern int IsStubTest();
 extern int IsTestRepair();
 extern void RestoreEngine();
 extern void BackupEngine();
+extern void CallSys(const char *pszCmd);
 
 extern jmp_buf JmpBuf;
 
index 71f61e8..615a29d 100644 (file)
@@ -143,7 +143,6 @@ static int InfectedFile(TestCase *pCtx, const char *pszPath);
 static void TestCaseCtorEx(TestCase *pCtx, const char *pszAPI, int iTestType,
                            int iPolarity, int iAction, int iCompressFlag,
                            PFScan pfCallback);
-static void CallSys(const char *pszCmd);
 
 /* Concurrency test functions. */
 static char *ConGetSampleDir(int iCid);
@@ -2096,7 +2095,7 @@ void RestoreEngine()
 }
 
 
-static void CallSys(const char *pszCmd)
+void CallSys(const char *pszCmd)
 {
     int iRet = system(pszCmd);
     if (iRet != 0)
index 15edf7b..88131ac 100644 (file)
@@ -125,6 +125,7 @@ extern TWP_RESULT CbSetMethod(struct TWPRequest *pRequest, TWPSubmitMethod Metho
 extern long GenerateRandomNumber();
 extern void DestoryTestDirs(void);
 extern int CreateTestDirs(void);
+extern void CallSys(const char *pszCmd);
 
 extern jmp_buf WPJmpBuf;
 
index 343de00..0fedbfa 100644 (file)
@@ -59,7 +59,6 @@
 #define PLUGIN_DIR tzplatform_mkpath(TZ_USER_SHARE, "sec_plugin/")
 
 static void ReportTestCase(TestCase *pCtx);
-static void CallSys(const char *pszCmd);
 static void PutTestRoot(char *pszRoot);
 static char *GetTestRoot(void);
 static char *GetBackupDir(void);
@@ -299,7 +298,7 @@ TWP_RESULT CbRecv(struct TWPRequest *pRequest, void *pBuffer, unsigned int uBuff
 }
 
 
-static void CallSys(const char *pszCmd)
+void CallSys(const char *pszCmd)
 {
     int iRet = 0;
     iRet = system(pszCmd);
diff --git a/test/WPMakefile b/test/WPMakefile
deleted file mode 100644 (file)
index ae179ad..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#
-#  Copyright (c) 2013, McAfee, Inc.
-#  
-#  All rights reserved.
-#  
-#  Redistribution and use in source and binary forms, with or without modification,
-#  are permitted provided that the following conditions are met:
-#  
-#  Redistributions of source code must retain the above copyright notice, this list
-#  of conditions and the following disclaimer.
-#  
-#  Redistributions in binary form must reproduce the above copyright notice, this
-#  list of conditions and the following disclaimer in the documentation and/or other
-#  materials provided with the distribution.
-#  
-#  Neither the name of McAfee, Inc. nor the names of its contributors may be used
-#  to endorse or promote products derived from this software without specific prior
-#  written permission.
-#  
-#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-#  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-#  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-#  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-#  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-#  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-#  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-#  OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-OUTDIR=bin
-SRCDIR=.
-
-ifeq ($(TCS_CC), )
-       CC = gcc
-else
-       CC = $(TCS_CC)
-endif
-ifeq ($(TCS_LD), )
-       LD = gcc
-else
-       LD = $(TCS_LD)
-endif
-
-TWP_HEADER_FILE_PATH=../../framework
-
-CFLAGS=-fstack-protector-all -fPIC -g -Wall -O3 -I$(SRCDIR) -I$(TWP_HEADER_FILE_PATH)
-LDFLAGS= -lc -pthread -L../../framework/lib -lsecfw -ldl
-
-TARGET=$(OUTDIR)/twptest
-
-SOURCES=$(SRCDIR)/TWPTest.c \
-               $(SRCDIR)/TWPTestUtils.c \
-               $(SRCDIR)/XMHttp.c \
-               $(SRCDIR)/XMPHttp.c
-OBJECTS=$(OUTDIR)/TWPTest.o \
-               $(OUTDIR)/TWPTestUtils.o \
-               $(OUTDIR)/XMHttp.o \
-               $(OUTDIR)/XMPHttp.o
-
-$(OUTDIR)/%.o: $(SRCDIR)/%.c
-       $(CC) $(CFLAGS) -o $(OUTDIR)/$*.o -c $(SRCDIR)/$*.c
-
-$(TARGET): $(OUTDIR) $(OBJECTS) $(SOURCES)
-       $(LD) -o $(TARGET) $(OBJECTS) $(LDFLAGS)
-
-all: $(TARGET)
-
-$(OUTDIR):
-       @mkdir $(OUTDIR)
-
-clean:
-       @rm -rf $(OUTDIR)
-
-distclean: clean
-