Initialize softap package 23/58723/4
authorSeonah Moon <seonah1.moon@samsung.com>
Wed, 3 Feb 2016 05:46:23 +0000 (14:46 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 4 Feb 2016 06:48:48 +0000 (15:48 +0900)
Change-Id: I36a3e3c74c4af0ce1ed36861e3a5ec6f5111ad11
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
13 files changed:
CMakeLists.txt [new file with mode: 0755]
LICENSE.APLv2.0 [new file with mode: 0644]
NOTICE [new file with mode: 0644]
capi-network-softap.manifest [new file with mode: 0644]
capi-network-softap.pc.in [new file with mode: 0644]
include/marshal.list [new file with mode: 0644]
include/softap.h [new file with mode: 0644]
include/softap.xml [new file with mode: 0644]
include/softap_private.h [new file with mode: 0644]
packaging/capi-network-softap.spec [new file with mode: 0644]
src/softap.c [new file with mode: 0755]
src/softap_client.c [new file with mode: 0755]
sysinfo-softap.xml [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..5b0016e
--- /dev/null
@@ -0,0 +1,100 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+SET(fw_name "capi-network-softap")
+
+PROJECT(${fw_name})
+
+SET(CMAKE_INSTALL_PREFIX /usr)
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+
+SET(INC_DIR include)
+INCLUDE_DIRECTORIES(${INC_DIR})
+
+SET(dependents "dlog gio-2.0 gio-unix-2.0 glib-2.0 capi-base-common dbus-1 vconf libssl capi-system-info")
+
+SET(CMAKE_BUILD_TYPE "Release")
+
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${fw_name} REQUIRED ${dependents})
+FOREACH(flag ${${fw_name}_CFLAGS})
+    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -fvisibility=hidden")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+
+IF("${ARCH}" STREQUAL "arm")
+    ADD_DEFINITIONS("-DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DTIZEN_DEBUG")
+
+SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed -Wl,--rpath=%{_libdir}")
+
+aux_source_directory(src SOURCES)
+ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
+
+TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
+
+SET_TARGET_PROPERTIES(${fw_name} PROPERTIES SOVERSION 0.1.0)
+
+INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
+INSTALL(
+        DIRECTORY ${INC_DIR}/ DESTINATION include/network
+        FILES_MATCHING
+        PATTERN "*_private.h" EXCLUDE
+        PATTERN "marshal.h" EXCLUDE
+        PATTERN "softap-client-stub.h" EXCLUDE
+        PATTERN "${INC_DIR}/*.h"
+        )
+
+SET(PC_NAME ${fw_name})
+SET(PC_REQUIRED ${dependents})
+SET(PC_LDFLAGS -l${fw_name})
+SET(PC_CFLAGS -I\${includedir}/network)
+
+CONFIGURE_FILE(
+    capi-network-softap.pc.in
+    ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
+    @ONLY
+)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+MESSAGE("Arch ${ARCH}")
+IF(NOT "${ARCH}" STREQUAL "emul")
+       INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/sysinfo-softap.xml" DESTINATION "/etc/config/connectivity")
+ENDIF(NOT "${ARCH}" STREQUAL "emul")
+
+#ADD_SUBDIRECTORY(test)
+
+IF(UNIX)
+
+ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
+ADD_CUSTOM_COMMAND(
+        DEPENDS clean
+        COMMENT "distribution clean"
+        COMMAND find
+        ARGS    .
+        -not -name config.cmake -and \(
+        -name tester.c -or
+        -name Testing -or
+        -name CMakeFiles -or
+        -name cmake.depends -or
+        -name cmake.check_depends -or
+        -name CMakeCache.txt -or
+        -name cmake.check_cache -or
+        -name *.cmake -or
+        -name Makefile -or
+        -name core -or
+        -name core.* -or
+        -name gmon.out -or
+        -name install_manifest.txt -or
+        -name *.pc -or
+        -name *~ \)
+        | grep -v TC | xargs rm -rf
+        TARGET  distclean
+        VERBATIM
+)
+
+ENDIF(UNIX)
+
diff --git a/LICENSE.APLv2.0 b/LICENSE.APLv2.0
new file mode 100644 (file)
index 0000000..d645695
--- /dev/null
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
diff --git a/NOTICE b/NOTICE
new file mode 100644 (file)
index 0000000..ccdad52
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,3 @@
+Copyright (c) Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Apache License, Version 2.
+Please, see the LICENSE file for Apache License terms and conditions.
diff --git a/capi-network-softap.manifest b/capi-network-softap.manifest
new file mode 100644 (file)
index 0000000..75b0fa5
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+    <request>
+        <domain name="_"/>
+    </request>
+</manifest>
diff --git a/capi-network-softap.pc.in b/capi-network-softap.pc.in
new file mode 100644 (file)
index 0000000..fc8c18b
--- /dev/null
@@ -0,0 +1,14 @@
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=/usr/lib
+includedir=/usr/include/network
+
+Name: @PC_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @VERSION@
+Requires: @PC_REQUIRED@
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: -I${includedir} @PC_CFLAGS@
+
diff --git a/include/marshal.list b/include/marshal.list
new file mode 100644 (file)
index 0000000..4cfa58e
--- /dev/null
@@ -0,0 +1,3 @@
+# DBUS Signal argument converting list
+VOID:STRING,UINT,STRING,STRING,STRING,UINT
+
diff --git a/include/softap.h b/include/softap.h
new file mode 100644 (file)
index 0000000..19d42b1
--- /dev/null
@@ -0,0 +1,780 @@
+/*
+* Copyright (c) 2011 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_NETWORK_SOFTAP_H__
+#define __TIZEN_NETWORK_SOFTAP_H__
+
+#include <tizen.h>
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file softap.h
+ */
+
+/**
+ * @addtogroup CAPI_NETWORK_SOFTAP_MANAGER_MODULE
+ * @{
+ */
+
+/**
+ * @brief The softap handle.
+ * @since_tizen 3.0
+ */
+typedef void * softap_h;
+
+/**
+ * @brief Enumeration for the softap.
+ * @since_tizen 3.0
+ */
+typedef enum {
+    SOFTAP_ERROR_NONE = TIZEN_ERROR_NONE,  /**< Successful */
+    SOFTAP_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED,  /**< Operation not permitted */
+    SOFTAP_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,  /**< Invalid parameter */
+    SOFTAP_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,  /**< Out of memory */
+    SOFTAP_ERROR_RESOURCE_BUSY = TIZEN_ERROR_RESOURCE_BUSY,  /**< Resource busy */
+    SOFTAP_ERROR_NOT_ENABLED = TIZEN_ERROR_TETHERING | 0x0501,  /**< Not enabled */
+    SOFTAP_ERROR_OPERATION_FAILED = TIZEN_ERROR_TETHERING | 0x0502,  /**< Operation failed */
+    SOFTAP_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
+    SOFTAP_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< API is not supported */
+    SOFTAP_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,  /**< Permission denied */
+} softap_error_e;
+
+/**
+ * @brief Enumeration for the cause of disabling the SOFTAP.
+ * @since_tizen 3.0
+ */
+typedef enum
+{
+    SOFTAP_DISABLED_BY_FLIGHT_MODE = 0,  /**< Disabled due to flight mode */
+    SOFTAP_DISABLED_BY_LOW_BATTERY,  /**< Disabled due to low battery */
+    SOFTAP_DISABLED_BY_NETWORK_CLOSE,  /**< Disabled due to pdp network close */
+    SOFTAP_DISABLED_BY_TIMEOUT,  /**< Disabled due to timeout */
+    SOFTAP_DISABLED_BY_OTHERS,  /**< Disabled by other apps */
+    SOFTAP_DISABLED_BY_REQUEST,  /**< Disabled by your request */
+    SOFTAP_DISABLED_BY_WIFI_ON,  /**< Disabled due to Wi-Fi on */
+} softap_disabled_cause_e;
+
+/**
+ * @}
+ */
+
+
+/**
+ * @addtogroup CAPI_NETWORK_SOFTAP_WIFI_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumeration for the Wi-Fi security.
+ * @since_tizen 3.0
+ */
+typedef enum {
+    SOFTAP_SECURITY_TYPE_NONE = 0,  /**< No Security type */
+    SOFTAP_SECURITY_TYPE_WPA2_PSK,  /**< WPA2_PSK */
+} softap_security_type_e;
+
+/**
+ * @}
+ */
+
+
+/**
+ * @addtogroup CAPI_NETWORK_SOFTAP_CLIENT_MODULE
+ * @{
+ */
+
+/**
+ * @brief The softap client handle.
+ * @since_tizen 3.0
+ */
+typedef void * softap_client_h;
+
+/**
+ * @brief Enumeration for address family.
+ * @since_tizen 3.0
+ */
+typedef enum {
+    SOFTAP_ADDRESS_FAMILY_IPV4 = 0,  /**< IPV4 Address type */
+} softap_address_family_e;
+
+/**
+ * @}
+ */
+
+
+/**
+ * @addtogroup CAPI_NETWORK_SOFTAP_MANAGER_MODULE
+ * @{
+ */
+
+/**
+ * @brief Called when the softap is enabled.
+ * @since_tizen 3.0
+ * @param[in]  result  The result of enabling the softap
+ * @param[in]  is_requested  Indicates whether this change is requested
+ * @param[in]  user_data  The user data passed from softap_set_enabled_cb()
+ * @pre  If you register callback function using softap_set_enabled_cb(), this will be invoked when the softap is enabled.
+ * @see        SOFTAP_enable()
+ * @see        SOFTAP_unset_enabled_cb()
+ */
+typedef void (*softap_enabled_cb)(softap_error_e result, bool is_requested, void *user_data);
+
+/**
+ * @brief Called when the softap is disabled.
+ * @since_tizen 3.0
+ * @param[in]  result  The result of disabling the softap
+ * @param[in]  cause  The cause of disabling
+ * @param[in]  user_data  The user data passed from softap_set_disabled_cb()
+ * @pre  If you register callback function using softap_set_disabled_cb(), this will be invoked when the softap is disabled.
+ * @see        softap_set_disabled_cb()
+ * @see        softap_unset_disabled_cb()
+ */
+typedef void (*softap_disabled_cb)(softap_error_e result, softap_disabled_cause_e cause, void *user_data);
+
+/**
+ * @brief Called when the connection state is changed.
+ * @since_tizen 3.0
+ * @remarks @a client is valid only in this function. In order to use it outside this function, a user must copy the client with softap_client_clone().
+ * @param[in]  client  The client of which connection state is changed
+ * @param[in]  opened  @c true when connection is opened, otherwise false
+ * @param[in]  user_data  The user data passed from softap_set_connection_state_changed_cb()
+ * @pre  If you register callback function using softap_set_connection_state_changed_cb(), this will be invoked when the connection state is changed.
+ * @see        softap_set_connection_state_changed_cb()
+ * @see        softap_unset_connection_state_changed_cb()
+ */
+typedef void (*softap_connection_state_changed_cb)(softap_client_h client, bool opened, void *user_data);
+
+/**
+ * @brief Called when you get the connected client repeatedly.
+ * @since_tizen 3.0
+ * @remarks @a client is valid only in this function. In order to use the client outside this function, a user must copy the client with softap_client_clone().
+ * @param[in]  client  The connected client
+ * @param[in]  user_data  The user data passed from the request function
+ * @return  @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
+ * @pre  softap_foreach_connected_clients() will invoke this callback.
+ * @see  softap_foreach_connected_clients()
+ */
+typedef bool(*softap_connected_client_cb)(softap_client_h client, void *user_data);
+
+/**
+ * @brief Called when you get the data usage.
+ * @since_tizen 3.0
+ * @param[in]  result  The result of getting the data usage
+ * @param[in]  received_data  The usage of received data
+ * @param[in]  sent_data  The usage of sent data
+ * @param[in]  user_data  The user data passed from the request function
+ * @pre  softap_get_data_usage() will invoked this callback.
+ */
+typedef void (*softap_data_usage_cb)(softap_error_e result, unsigned long long received_data, unsigned long long sent_data, void *user_data);
+
+/**
+ * @brief Called when the security type of Soft AP is changed.
+ * @since_tizen 3.0
+ * @param[in]  changed_type  The changed security type
+ * @param[in]  user_data  The user data passed from the register function
+ * @see        softap_set_security_type_changed_cb()
+ * @see        softap_unset_security_type_changed_cb()
+ */
+typedef void (*softap_security_type_changed_cb)(softap_security_type_e changed_type, void *user_data);
+
+/**
+ * @brief Called when the visibility of SSID is changed.
+ * @since_tizen 3.0
+ * @param[in]  changed_visible  The changed visibility of SSID
+ * @param[in]  user_data  The user data passed from the register function
+ * @see        softap_set_ssid_visibility_changed_cb()
+ * @see        softap_unset_ssid_visibility_changed_cb()
+ */
+typedef void (*softap_ssid_visibility_changed_cb)(bool changed_visible, void *user_data);
+
+/**
+ * @brief Called when the passphrase
+ * @since_tizen 3.0
+ * @param[in]  user_data  The user data passed from the register function
+ * @see        softap_set_passphrase_changed_cb()
+ * @see        softap_unset_passphrase_changed_cb()
+ */
+typedef void (*softap_passphrase_changed_cb)(void *user_data);
+
+/**
+ * @brief Called when Soft AP settings are reloaded.
+ * @since_tizen 3.0
+ * @param[in]  result  The result of reloading the settings
+ * @param[in]  user_data  The user data passed from the request function
+ * @pre  softap_reload_settings() will invoke this callback.
+ */
+typedef void (*softap_settings_reloaded_cb)(softap_error_e result, void *user_data);
+
+/**
+ * @brief Creates the handle for softap.
+ * @since_tizen 3.0
+ * @remarks The @a softap must be released using softap_destroy().
+ * @param[out]  softap A handle of a new mobile ap handle on success
+ * @return  0 on success, otherwise a negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OUT_OF_MEMORY  Out of memory
+ * @retval  #SOFTAP_ERROR_NOT_SUPPORT_API  API is not supported
+ * @see  softap_destroy()
+ */
+int softap_create(softap_h *softap);
+
+/**
+ * @brief Destroys the handle for softap.
+ * @since_tizen 3.0
+ * @param[in]  SOFTAP  The softap handle
+ * @return  0 on success, otherwise a negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  SOFTAP_create()
+ */
+int softap_destroy(softap_h softap);
+
+/**
+ * @brief Enables the softap, asynchronously.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @post SOFTAP_enabled_cb() will be invoked.
+ * @see  SOFTAP_is_enabled()
+ * @see  SOFTAP_disable()
+ */
+int softap_enable(softap_h softap);
+/**
+ * @brief Disables the softap, asynchronously.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @post SOFTAP_disabled_cb() will be invoked.
+ * @see  SOFTAP_is_enabled()
+ * @see  SOFTAP_enable()
+ */
+int softap_disable(softap_h softap);
+
+/**
+ * @brief Checks whether the softap is enabled or not.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @return  @c true if softap is enabled, \n @c false if softap is disabled
+ */
+bool softap_is_enabled(softap_h softap);
+
+/**
+ * @brief Gets the MAC address of local device as "FC:A1:3E:D6:B1:B1".
+ * @since_tizen 3.0
+ * @remarks @a mac_address must be released using free().
+ * @param[in]  SOFTAP  The softap handle
+ * @param[out]  mac_address  The MAC address
+ * @return  0 on success, otherwise a negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OUT_OF_MEMORY  Out of memory
+ * @retval  #SOFTAP_ERROR_OPERATION_FAILED  Operation failed
+ * @retval  #SOFTAP_ERROR_NOT_ENABLED  Not enabled
+ * @pre  The SOFTAP must be enabled.
+ * @see  SOFTAP_is_enabled()
+ * @see  SOFTAP_enable()
+ */
+int softap_get_mac_address(softap_h softap, char **mac_address);
+
+/**
+ * @brief Gets the name of network interface (e.g. usb0).
+ * @since_tizen 3.0
+ * @remarks @a interface_name must be released using free().
+ * @param[in]  SOFTAP  The softap handle
+ * @param[out]  interface_name  The name of the network interface
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OUT_OF_MEMORY  Out of memory
+ * @retval  #SOFTAP_ERROR_OPERATION_FAILED  Operation failed
+ * @retval  #SOFTAP_ERROR_NOT_ENABLED  Not enabled
+ * @pre  The SOFTAP must be enabled.
+ * @see  softap_is_enabled()
+ * @see  softap_enable()
+ */
+int softap_get_network_interface_name(softap_h softap, char **interface_name);
+
+/**
+ * @brief Gets the local IP address.
+ * @since_tizen 3.0
+ * @remarks @a ip_address must be released using free().
+ * @param[in]  softap  The softap handle
+ * @param[in]  type  The softap type
+ * @param[in]  address_family  The address family of IP address (currently, #SOFTAP_ADDRESS_FAMILY_IPV4 is only supported)
+ * @param[out]  ip_address  The local IP address
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OUT_OF_MEMORY  Out of memory
+ * @retval  #SOFTAP_ERROR_OPERATION_FAILED  Operation failed
+ * @retval  #SOFTAP_ERROR_NOT_ENABLED  Not enabled
+ * @pre  The SOFTAP must be enabled.
+ * @see  softap_is_enabled()
+ * @see  softap_enable()
+ */
+int softap_get_ip_address(softap_h softap, softap_address_family_e address_family, char **ip_address);
+
+/**
+ * @brief Gets the Gateway address.
+ * @since_tizen 3.0
+ * @remarks @a gateway_address must be released using free().
+ * @param[in]  softap  The softap handle
+ * @param[in]  address_family  The address family of IP address (currently, #SOFTAP_ADDRESS_FAMILY_IPV4 is only supported)
+ * @param[out]  gateway_address  The local IP address
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OUT_OF_MEMORY  Out of memory
+ * @retval  #SOFTAP_ERROR_OPERATION_FAILED  Operation failed
+ * @retval  #SOFTAP_ERROR_NOT_ENABLED  Not enabled
+ * @pre  The softap must be enabled.
+ * @see  softap_is_enabled()
+ * @see  softap_enable()
+ */
+int softap_get_gateway_address(softap_h softap, softap_address_family_e address_family, char **gateway_address);
+
+/**
+ * @brief Gets the Subnet Mask.
+ * @since_tizen 3.0
+ * @remarks @a subnet_mask must be released using free().
+ * @param[in]  softap  The softap handle
+ * @param[in]  address_family  The address family of IP address (currently, #SOFTAP_ADDRESS_FAMILY_IPV4 is only supported)
+ * @param[out]  subnet_mask  The local IP address
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OUT_OF_MEMORY  Out of memory
+ * @retval  #SOFTAP_ERROR_OPERATION_FAILED  Operation failed
+ * @retval  #SOFTAP_ERROR_NOT_ENABLED  Not enabled
+ * @pre  The SOFTAP must be enabled.
+ * @see  SOFTAP_is_enabled()
+ * @see  SOFTAP_enable()
+ */
+int softap_get_subnet_mask(softap_h softap, softap_address_family_e address_family, char **subnet_mask);
+
+/**
+ * @brief Gets the data usage.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @param[out]  usage  The data usage
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OPERATION_FAILED  Operation failed
+ * @retval  #SOFTAP_ERROR_NOT_ENABLED  Not enabled
+ * @pre  The softap must be enabled.
+ * @see  softap_is_enabled()
+ * @see  softap_enable()
+ */
+int softap_get_data_usage(softap_h softap, softap_data_usage_cb callback, void *user_data);
+
+/**
+ * @brief Gets the clients which are connected.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_NOT_ENABLED  Not enabled
+ * @retval  #SOFTAP_ERROR_OPERATION_FAILED  Operation failed
+ * @pre  The softap must be enabled.
+ * @see  softap_is_enabled()
+ * @see  softap_enable()
+ */
+int softap_foreach_connected_clients(softap_h softap, softap_connected_client_cb callback, void *user_data);
+
+/**
+ * @brief Registers the callback function, which is called when softap is enabled.
+ * @since_tizen 3.0
+ * @param[in]  softap The softap handle
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  SOFTAP_unset_enabled_cb()
+ */
+int softap_set_enabled_cb(softap_h softap, softap_enabled_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters the callback function, which is called when softap is enabled.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  softap_set_enabled_cb()
+ */
+int softap_unset_enabled_cb(softap_h softap);
+
+/**
+ * @brief Registers the callback function called when softap is disabled.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  softap_unset_disabled_cb()
+ */
+int softap_set_disabled_cb(softap_h softap,  softap_disabled_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters the callback function, which is called when softap is disabled.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  SOFTAP_set_disabled_cb()
+ */
+int softap_unset_disabled_cb(softap_h softap);
+
+/**
+ * @brief Registers the callback function, which is called when the state of connection is changed.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  softap_unset_connection_state_changed_cb_cb()
+ */
+int softap_set_connection_state_changed_cb(softap_h softap, softap_connection_state_changed_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters the callback function, which is called when the state of connection is changed.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  softap_set_connection_state_changed_cb()
+ */
+int softap_unset_connection_state_changed_cb(softap_h softap);
+
+/**
+ * @brief Registers the callback function, which is called when the security type of softap is changed.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  softap_unset_security_type_changed_cb()
+ */
+int softap_set_security_type_changed_cb(softap_h softap, softap_security_type_changed_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters the callback function, which is called when the security type of softap is changed.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @param[in]  type  The SOFTAP type
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  softap_set_security_type_changed_cb()
+ */
+int softap_unset_security_type_changed_cb(softap_h softap);
+
+/**
+ * @brief Registers the callback function , which iscalled when the visibility of SSID is changed.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  softap_unset_ssid_visibility_changed_cb_cb()
+ */
+int softap_set_ssid_visibility_changed_cb(softap_h softap, softap_ssid_visibility_changed_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters the callback function, which is called when the visibility of SSID is changed.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  SOFTAP_wifi_set_ssid_visibility_changed_cb()
+ */
+int softap_unset_ssid_visibility_changed_cb(softap_h softap);
+
+/**
+ * @brief Registers the callback function, which is called when the passphrase of softap is changed.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  softap_unset_passphrase_changed_cb()
+ */
+int softap_set_passphrase_changed_cb(softap_h softap, softap_passphrase_changed_cb callback, void *user_data);
+
+/**
+ * @brief Unregisters the callback function, which is called when the passphrase of softap is changed.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  softap_set_passphrase_changed_cb()
+ */
+int softap_unset_passphrase_changed_cb(softap_h softap);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_NETWORK_SOFTAP_CLIENT_MODULE
+ * @{
+ */
+
+/**
+ * @brief Sets the security type of softap.
+ * @details If security type is not set, WPA2_PSK is used.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @param[in]  type  The security type
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OPERATION_FAILED  Operation failed
+ * @see  softap_wifi_ap_get_security_type()
+ */
+int softap_set_security_type(softap_h softap, softap_security_type_e type);
+
+/**
+ * @brief Gets the security type of Wi-Fi AP.
+ * @details If security type is not set, WPA2_PSK is used.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @param[out]  type  The security type
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  softap_wifi_ap_set_security_type()
+ */
+int softap_get_security_type(softap_h softap, softap_security_type_e *type);
+
+/**
+ * @brief Sets the SSID (service set identifier) for Wi-Fi AP.
+ * @details The SSID cannot exceed 32 bytes. If SSID is not set, device name is used as SSID.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @param[in]  ssid  The SSID
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OUT_OF_MEMORY  Out of memory
+ */
+int softap_set_ssid(softap_h softap, const char *ssid);
+
+/**
+ * @brief Gets the SSID (service set identifier) for Wi-Fi AP.
+ * @details If SSID is not set, Device name is used as SSID.
+ * @since_tizen 3.0
+ * @remarks @a ssid must be released using free().
+ * @param[in]  softap  The softap handle
+ * @param[out]  ssid  The SSID
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OUT_OF_MEMORY  Out of memory
+ */
+int softap_get_ssid(softap_h softap, char **ssid);
+
+/**
+ * @brief Sets the visibility of SSID (service set identifier) for Wi-Fi AP.
+ * @details If you set the visibility to invisible, then the SSID of this device is hidden and Wi-Fi scan won't find your device.
+ * @details By default visibility is set to @c true.
+ * @since_tizen 3.0
+ * @remarks This change is applied next time Wi-Fi SOFTAP is enabled.
+ * @param[in]  softap  The softap handle
+ * @param[in]  visible  The visibility of SSID: (@c true = visible, @c false = invisible)
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OPERATION_FAILED  Operation failed
+ * @see  softap_get_ssid_visibility()
+ */
+int softap_set_ssid_visibility(softap_h softap, bool visible);
+
+/**
+ * @brief Gets the visibility of SSID (service set identifier) for Wi-Fi AP.
+ * @details If the visibility is set to invisible, then the SSID of this device is hidden and Wi-Fi scan won't find your device.
+ * @details By default visibility is set to @c true.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @param[out]  visible  The visibility of SSID: (@c true = visible, @c false = invisible)
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  softap_set_ssid_visibility()
+ */
+int softap_ap_get_ssid_visibility(softap_h softap, bool *visible);
+
+/**
+ * @brief Sets the passphrase for Wi-Fi AP.
+ * @details If the passphrase is not set, random string of 8 characters will be used.
+ * @since_tizen 3.0
+ * @param[in]  softap  The softap handle
+ * @param[in]  passphrase  The passphrase
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  softap_get_passphrase()
+ */
+int softap_set_passphrase(softap_h softap, const char *passphrase);
+
+/**
+ * @brief Gets the passphrase for Wi-Fi AP.
+ * @details If the passphrase is not set, random string of 8 characters will be used.
+ * @since_tizen 3.0
+ * @remarks @a passphrase must be released using free().
+ * @param[in]  softap  The softap handle
+ * @param[out]  passphrase  The passphrase
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OUT_OF_MEMORY  Out of memory
+ * @see  softap_set_passphrase()
+ */
+int softap_get_passphrase(softap_h softap, char **passphrase);
+
+/**
+ * @brief Reloads the settings (SSID / Passphrase / Security type / SSID visibility) for Wi-Fi AP.
+ * @since_tizen 3.0
+ * @remarks Devices connected via MobileAP will be disconnected when the settings are reloaded.
+ * @param[in]  softap  The softap handle
+ * @param[in]  callback  The callback function to invoke
+ * @param[in]  user_data  The user data to be passed to the callback function
+ * @return 0 on success, otherwise negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OPERATION_FAILED  Operation failed
+ */
+int softap_reload_settings(softap_h softap, softap_settings_reloaded_cb callback, void *user_data);
+/**
+ * @}
+ */
+
+
+/**
+ * @addtogroup CAPI_NETWORK_SOFTAP_CLIENT_MODULE
+ * @{
+ */
+
+/**
+ * @brief Clones the handle of a client.
+ * @since_tizen 3.0
+ * @remarks @a dest must be release using SOFTAP_client_destroy().
+ * @param[out]  dest  The cloned client handle
+ * @param[in]  origin  The origin client handle
+ * @return  0 on success, otherwise a negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OUT_OF_MEMORY  Out of memory
+ * @see  softap_client_destroy()
+ */
+int softap_client_clone(softap_client_h *dest, softap_client_h origin);
+
+/**
+ * @brief Destroys the handle of a client.
+ * @since_tizen 3.0
+ * @param[in]  client  The client handle
+ * @return  0 on success, otherwise a negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  SOFTAP_client_clone()
+ */
+int softap_client_destroy(softap_client_h client);
+
+/**
+ * @brief Gets the name of a client.
+ * @since_tizen 3.0
+ * @remarks @a name must be released using free().
+ * @param[in]  client  The client handle
+ * @param[out]  name  The name of the client
+ * @return  0 on success, otherwise a negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OUT_OF_MEMORY  Out of memory
+ * @see  SOFTAP_usb_get_connected_client()
+ * @see  SOFTAP_connection_state_changed_cb()
+ */
+int softap_client_get_name(softap_client_h client, char **name);
+
+/**
+ * @brief Gets the IP address of a client.
+ * @since_tizen 3.0
+ * @remarks @a ip_address must be released using free().
+ * @param[in]  client  The client handle
+ * @param[in]  address_family  The address family of IP address. Currently, #SOFTAP_ADDRESS_FAMILY_IPV4 is only supported
+ * @param[out]  ip_address  The IP address
+ * @return  0 on success, otherwise a negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OUT_OF_MEMORY  Out of memory
+ * @see  SOFTAP_usb_get_connected_client()
+ * @see  SOFTAP_connection_state_changed_cb()
+ */
+int softap_client_get_ip_address(softap_client_h client, softap_address_family_e address_family, char **ip_address);
+
+/**
+ * @brief Gets the MAC address of a client such as "FC:A1:3E:D6:B1:B1".
+ * @since_tizen 3.0
+ * @remarks @a mac_address must be released using free().
+ * @param[in]  client  The client handle
+ * @param[out]  mac_address  The MAC address
+ * @return  0 on success, otherwise a negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #SOFTAP_ERROR_OUT_OF_MEMORY  Out of memory
+ * @see  SOFTAP_usb_get_connected_client()
+ * @see  SOFTAP_connection_state_changed_cb()
+ */
+int softap_client_get_mac_address(softap_client_h client, char **mac_address);
+
+/**
+ * @brief Gets the connection time of a client.
+ * @since_tizen 3.0
+ * @param[in] client The client handle
+ * @param[out]  time  The connected time of the client
+ * @return  0 on success, otherwise a negative error value
+ * @retval  #SOFTAP_ERROR_NONE  Successful
+ * @retval  #SOFTAP_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @see  SOFTAP_usb_get_connected_client()
+ * @see  SOFTAP_connection_state_changed_cb()
+ */
+int softap_client_get_time(softap_client_h client, time_t *timestamp);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* __TIZEN_NETWORK_SOFTAP_H__ */
+
+
diff --git a/include/softap.xml b/include/softap.xml
new file mode 100644 (file)
index 0000000..6a1e326
--- /dev/null
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!DOCTYPE node PUBLIC
+       "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+       "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
+
+<node>
+       <interface name="org.tizen.tethering">
+
+               <!-- Method definitions -->
+
+               <method name="disable">
+                       <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+                       <arg type="u" name="type" direction="out"/>
+                       <arg type="u" name="result" direction="out"/>
+               </method>
+
+               <method name="enable_wifi_ap">
+                       <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+                       <arg type="s" name="ssid" direction="in"/>
+                       <arg type="s" name="key" direction="in"/>
+                       <arg type="i" name="visibility" direction="in"/>
+                       <arg type="i" name="security" direction="in"/>
+                       <arg type="u" name="type" direction="out"/>
+                       <arg type="u" name="result" direction="out"/>
+               </method>
+
+               <method name="disable_wifi_ap">
+                       <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+                       <arg type="u" name="type" direction="out"/>
+                       <arg type="u" name="result" direction="out"/>
+               </method>
+
+               <method name="reload_wifi_ap_settings">
+                       <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+                       <arg type="s" name="ssid" direction="in"/>
+                       <arg type="s" name="key" direction="in"/>
+                       <arg type="i" name="visibility" direction="in"/>
+                       <arg type="i" name="security" direction="in"/>
+                       <arg type="u" name="result" direction="out"/>
+               </method>
+
+               <method name="get_station_info">
+                       <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+                       <arg type="u" name="type" direction="out"/>
+                       <arg type="a(usssu)" name="station" direction="out"/>
+               </method>
+
+               <!-- Signal (D-Bus) definitions -->
+               <signal name="net_closed">
+                       <arg type="s" name="arg1" direction="out"/>
+               </signal>
+
+               <signal name="sta_connected">
+                       <arg type="s" name="arg1" direction="out"/>
+               </signal>
+
+               <signal name="sta_disconnected">
+                       <arg type="s" name="arg1" direction="out"/>
+               </signal>
+
+               <signal name="wifi_ap_on">
+                       <arg type="s" name="arg1" direction="out"/>
+               </signal>
+
+               <signal name="wifi_ap_off">
+                       <arg type="s" name="arg1" direction="out"/>
+               </signal>
+
+               <signal name="no_data_timeout">
+                       <arg type="s" name="arg1" direction="out"/>
+               </signal>
+
+               <signal name="low_batt_mode">
+                       <arg type="s" name="arg1" direction="out"/>
+               </signal>
+
+               <signal name="flight_mode">
+                       <arg type="s" name="arg1" direction="out"/>
+               </signal>
+
+       </interface>
+</node>
diff --git a/include/softap_private.h b/include/softap_private.h
new file mode 100644 (file)
index 0000000..8304004
--- /dev/null
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2011 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 __SOFTAP_PRIVATE_H__
+#define __SOFTAP_PRIVATE_H__
+
+#define LOG_TAG        "CAPI_NETWORK_SOFTAP"
+
+#include <glib.h>
+#include <dlog.h>
+#include <gio/gio.h>
+#include "softap.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef API
+#define API __attribute__ ((visibility("default")))
+#endif
+
+#ifndef DEPRECATED_API
+#define DEPRECATED_API __attribute__ ((deprecated))
+#endif
+
+#define DBG(fmt, args...)      LOGD(fmt, ##args)
+#define WARN(fmt, args...)     LOGW(fmt, ##args)
+#define ERR(fmt, args...)      LOGE(fmt, ##args)
+#define SDBG(fmt, args...)     SECURE_LOGD(fmt, ##args)
+#define SERR(fmt, args...)     SECURE_LOGE(fmt, ##args)
+
+#define _warn_if(expr, fmt, arg...) do { \
+               if (expr) { \
+                       WARN(fmt, ##arg); \
+               } \
+       } while (0)
+
+#define _ret_if(expr) do { \
+               if (expr) { \
+                       return; \
+               } \
+       } while (0)
+
+#define _retv_if(expr, val) do { \
+               if (expr) { \
+                       return (val); \
+               } \
+       } while (0)
+
+#define _retm_if(expr, fmt, arg...) do { \
+               if (expr) { \
+                       ERR(fmt, ##arg); \
+                       return; \
+               } \
+       } while (0)
+
+#define _retvm_if(expr, val, fmt, arg...) do { \
+               if (expr) { \
+                       ERR(fmt, ##arg); \
+                       return (val); \
+               } \
+       } while (0)
+
+#define CHECK_FEATURE_SUPPORTED(...) \
+       do { \
+               int rv = _softap_check_feature_supported(__VA_ARGS__, NULL); \
+               if(rv != SOFTAP_ERROR_NONE) { \
+                       return rv; \
+               } \
+       } while (0)
+
+int _softap_check_feature_supported(const char* feature, ...);
+
+/**
+* Start of mobileap-agent common values
+* When these values are changed, mobileap-agent should be also changed.
+* But some of those will be removed.
+*/
+
+/*
+* from mobileap_lib.h
+*/
+
+/**
+* Common configuration
+*/
+#define SOFTAP_STR_INFO_LEN            20      /**< length of the ip or mac address */
+
+/**
+* Mobile AP error code
+*/
+typedef enum {
+       MOBILE_AP_ERROR_NONE,                   /**< No error */
+       MOBILE_AP_ERROR_RESOURCE,               /**< Socket creation error, file open error */
+       MOBILE_AP_ERROR_INTERNAL,               /**< Driver related error */
+       MOBILE_AP_ERROR_INVALID_PARAM,          /**< Invalid parameter */
+       MOBILE_AP_ERROR_ALREADY_ENABLED,        /**< Mobile AP is already ON */
+       MOBILE_AP_ERROR_NOT_ENABLED,            /**< Mobile AP is not ON, so cannot be disabled */
+       MOBILE_AP_ERROR_NET_OPEN,               /**< PDP network open error */
+       MOBILE_AP_ERROR_NET_CLOSE,              /**< PDP network close error */
+       MOBILE_AP_ERROR_DHCP,                   /**< DHCP error */
+       MOBILE_AP_ERROR_IN_PROGRESS,            /**< Request is in progress */
+       MOBILE_AP_ERROR_NOT_PERMITTED,          /**< Operation is not permitted */
+       MOBILE_AP_ERROR_PERMISSION_DENIED,  /**< Permission Denied */
+
+       MOBILE_AP_ERROR_MAX
+} mobile_ap_error_code_e;
+
+/**
+* Event type on callback
+*/
+typedef enum {
+       MOBILE_AP_ENABLE_CFM = 0,
+       MOBILE_AP_DISABLE_CFM = 1,
+
+       MOBILE_AP_ENABLE_WIFI_AP_CFM = 9,
+       MOBILE_AP_DISABLE_WIFI_AP_CFM,
+
+       MOBILE_AP_GET_STATION_INFO_CFM,
+       MOBILE_AP_GET_DATA_PACKET_USAGE_CFM
+} mobile_ap_event_e;
+
+typedef enum {
+       MOBILE_AP_TYPE_WIFI,
+       MOBILE_AP_TYPE_USB,
+       MOBILE_AP_TYPE_BT,
+       MOBILE_AP_TYPE_WIFI_AP,
+       MOBILE_AP_TYPE_MAX,
+} mobile_ap_type_e;
+
+typedef enum {
+       E_SIGNAL_NET_CLOSED = 0,
+       E_SIGNAL_WIFI_TETHER_ON,
+       E_SIGNAL_WIFI_TETHER_OFF,
+       E_SIGNAL_WIFI_AP_ON = 9,
+       E_SIGNAL_WIFI_AP_OFF,
+       E_SIGNAL_NO_DATA_TIMEOUT,
+       E_SIGNAL_LOW_BATTERY_MODE,
+       E_SIGNAL_FLIGHT_MODE,
+       E_SIGNAL_SECURITY_TYPE_CHANGED,
+       E_SIGNAL_SSID_VISIBILITY_CHANGED,
+       E_SIGNAL_PASSPHRASE_CHANGED,
+       E_SIGNAL_DHCP_STATUS,
+       E_SIGNAL_MAX
+} mobile_ap_sig_e;
+
+#define SOFTAP_SERVICE_OBJECT_PATH     "/Tethering"
+#define SOFTAP_SERVICE_NAME            "org.tizen.tethering"
+#define SOFTAP_SERVICE_INTERFACE       "org.tizen.tethering"
+
+#define SOFTAP_SIGNAL_MATCH_RULE       "type='signal',interface='org.tizen.tethering'"
+#define SOFTAP_SIGNAL_NAME_LEN 64
+
+#define SIGNAL_NAME_NET_CLOSED         "net_closed"
+#define SIGNAL_NAME_STA_CONNECT                "sta_connected"
+#define SIGNAL_NAME_STA_DISCONNECT     "sta_disconnected"
+#define SIGNAL_NAME_WIFI_AP_ON         "wifi_ap_on"
+#define SIGNAL_NAME_WIFI_AP_OFF                "wifi_ap_off"
+#define SIGNAL_NAME_NO_DATA_TIMEOUT    "no_data_timeout"
+#define SIGNAL_NAME_LOW_BATTERY_MODE   "low_batt_mode"
+#define SIGNAL_NAME_FLIGHT_MODE                "flight_mode"
+#define SIGNAL_NAME_SECURITY_TYPE_CHANGED      "security_type_changed"
+#define SIGNAL_NAME_SSID_VISIBILITY_CHANGED    "ssid_visibility_changed"
+#define SIGNAL_NAME_PASSPHRASE_CHANGED         "passphrase_changed"
+#define SIGNAL_NAME_DHCP_STATUS                "dhcp_status"
+
+#define SIGNAL_MSG_NOT_AVAIL_INTERFACE "Interface is not available"
+#define SIGNAL_MSG_TIMEOUT             "There is no connection for a while"
+#define SIGNAL_MSG_SSID_VISIBLE                "ssid_visible"
+#define SIGNAL_MSG_SSID_HIDE           "ssid_hide"
+
+/* Network Interface */
+#define SOFTAP_SUBNET_MASK             "255.255.255.0"
+
+#define SOFTAP_IF              "wlan0"
+#define SOFTAP_GATEWAY         "192.168.43.1"
+
+#define SOFTAP_SSID_MAX_LEN    32      /**< Maximum length of ssid */
+#define SOFTAP_KEY_MIN_LEN     8       /**< Minimum length of wifi key */
+#define SOFTAP_KEY_MAX_LEN     64      /**< Maximum length of wifi key */
+#define SOFTAP_HASH_KEY_MAX_LEN        64
+
+#define SOFTAP_MODE_MAX_LEN 10  /**< Maximum length of mode */
+
+#define VCONFKEY_MOBILE_HOTSPOT_SSID   "memory/private/mobileap-agent/ssid"
+#define MAX_ALIAS_LEN  256
+
+/**
+* End of mobileap-agent common values
+*/
+
+#define SOFTAP_DEFAULT_SSID    "Tizen"
+#define SOFTAP_SECURITY_TYPE_OPEN_STR          "open"
+#define SOFTAP_SECURITY_TYPE_WPA2_PSK_STR      "wpa2-psk"
+#define SOFTAP_ERROR_RECOVERY_MAX                      3
+#define SECURITY_TYPE_LEN      32
+#define PSK_ITERATION_COUNT    4096
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __SOFTAP_PRIVATE_H__ */
diff --git a/packaging/capi-network-softap.spec b/packaging/capi-network-softap.spec
new file mode 100644 (file)
index 0000000..a509439
--- /dev/null
@@ -0,0 +1,93 @@
+Name:          capi-network-softap
+Summary:       Softap Framework
+Version:       0.0.1
+Release:       1
+Group:         System/Network
+License:       Apache-2.0
+Source0:       %{name}-%{version}.tar.gz
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(dbus-1)
+BuildRequires: pkgconfig(capi-base-common)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(gio-2.0)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(libssl)
+BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: cmake
+Requires(post):                /sbin/ldconfig
+Requires(postun):      /sbin/ldconfig
+
+%description
+Soft AP framework library for CAPI
+
+%package devel
+Summary:       Development package for Soft AP framework library
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+%description devel
+Development package for Tethering framework library
+
+%prep
+%setup -q
+
+
+%build
+export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
+export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
+
+%cmake -DCMAKE_BUILD_TYPE="Private" \
+%if "%{?profile}" == "wearable"
+       -DTIZEN_WEARABLE=1 \
+%else
+%if "%{?profile}" == "mobile"
+       -DTIZEN_MOBILE=1 \
+%endif
+%endif
+%ifarch %{arm}
+       -DCMAKE_BUILD_TYPE="Private" -DARCH=arm \
+%else
+%if 0%{?simulator}
+       -DCMAKE_BUILD_TYPE="Private" -DARCH=emul \
+%else
+       -DCMAKE_BUILD_TYPE="Private" -DARCH=i586 \
+%endif
+%endif
+       .
+
+make %{?_smp_mflags}
+
+
+%install
+%make_install
+
+mkdir -p %{buildroot}/usr/share/license
+cp LICENSE.APLv2.0 %{buildroot}/usr/share/license/capi-network-softap
+cp LICENSE.APLv2.0 %{buildroot}/usr/share/license/capi-network-softap-devel
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%manifest capi-network-softap.manifest
+%defattr(-,root,root,-)
+%{_libdir}/*.so.*
+/usr/share/license/capi-network-softap
+#%{_bindir}/softap_test
+%ifarch %{arm}
+/etc/config/connectivity/sysinfo-softap.xml
+%else
+%if 0%{?simulator}
+# Noop
+%else
+/etc/config/connectivity/sysinfo-softap.xml
+%endif
+%endif
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/network/*.h
+%{_libdir}/pkgconfig/*.pc
+%{_libdir}/*.so
+/usr/share/license/capi-network-softap-devel
diff --git a/src/softap.c b/src/softap.c
new file mode 100755 (executable)
index 0000000..7a86db2
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2011 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.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <net/if.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#include <dbus/dbus.h>
+#include <gio/gio.h>
+#include <vconf.h>
+#include <openssl/evp.h>
+#include <openssl/sha.h>
+
+#include "softap_private.h"
+#if 0
+
+API int softap_create(softap_h *softap)
+{
+       DBG("+\n");
+
+       return SOFTAP_ERROR_NONE;
+}
+#endif
diff --git a/src/softap_client.c b/src/softap_client.c
new file mode 100755 (executable)
index 0000000..9e79f66
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+* Copyright (c) 2011 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.
+*/
diff --git a/sysinfo-softap.xml b/sysinfo-softap.xml
new file mode 100644 (file)
index 0000000..9a0bce2
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<sys-info>
+       <default>
+         <key id="tethering-support" string="TRUE"/>
+       </default>
+</sys-info>