Initial version of tizen_devel branch 13/30913/5
authorChengyi Zhao <chengyi1.zhao@archermind.com>
Thu, 27 Nov 2014 04:06:07 +0000 (12:06 +0800)
committerChengyi Zhao <chengyi1.zhao@archermind.com>
Mon, 1 Dec 2014 04:45:30 +0000 (12:45 +0800)
This is a refactor version based on the tizen branch,
and it will be integrated into the new winet framework.

In the first phrase:
1.Refactor the connection profile.
2.The cellular profile has not been included.
3.Delete the old dependency package 'network'.
4.Add new dependency packages:
  'connman-lib' and 'winet-lib'.

Change-Id: Iaa7c603de43c58d564f506b5f45df27ae7875515
Signed-off-by: Chengyi Zhao <chengyi1.zhao@archermind.com>
CMakeLists.txt
include/net_connection_private.h
packaging/capi-network-connection.spec
src/connection.c
src/connection_profile.c
src/include/net_cm_intf.h [new file with mode: 0644]
src/include/net_pm_config.h [new file with mode: 0644]
src/include/net_pm_wlan.h [new file with mode: 0644]
src/libnetwork.c
test/CMakeLists.txt

index 3f615b8f2567e236efbbc0c540012a770632856c..caeb8fa777687c14db4947d9964c36ea4059b82f 100644 (file)
@@ -8,8 +8,9 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
 SET(INC_DIR include)
 INCLUDE_DIRECTORIES(${INC_DIR})
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/include/)
 
-SET(dependents "dlog vconf capi-base-common glib-2.0 network")
+SET(dependents "dlog vconf capi-base-common glib-2.0 winet-lib connman-lib")
 SET(pc_dependents "capi-base-common")
 
 INCLUDE(FindPkgConfig)
index ddfdcd3fc558bfd23207c2d8db1ecacd5fdad17f..5f00e9d9b8b67e49df03a8bb0f0cdf9b1eb23e67 100644 (file)
  * 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. 
+ * limitations under the License.
  */
 
 #ifndef __NET_CONNECTION_PRIVATE_H__
 #define __NET_CONNECTION_PRIVATE_H__
 
 #include <dlog.h>
-#include <network-cm-intf.h>
-#include <network-wifi-intf.h>
+#include <connman-lib-common.h>
+#include "net_cm_intf.h"
 #include "net_connection.h"
 
 #undef LOG_TAG
@@ -41,7 +41,7 @@
                default: \
                        LOGI(format, ## args); \
                } \
-       } while(0)
+       } while (0)
 
 #define CONNECTION_MUTEX_LOCK _connection_inter_mutex_lock()
 #define CONNECTION_MUTEX_UNLOCK _connection_inter_mutex_unlock()
@@ -50,8 +50,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-typedef struct _connection_handle_s
-{
+typedef struct _connection_handle_s {
        connection_type_changed_cb type_changed_callback;
        connection_address_changed_cb ip_changed_callback;
        connection_address_changed_cb proxy_changed_callback;
@@ -65,7 +64,7 @@ bool _connection_libnet_init(void);
 bool _connection_libnet_deinit(void);
 bool _connection_libnet_get_wifi_state(connection_wifi_state_e *state);
 bool _connection_libnet_get_ethernet_state(connection_ethernet_state_e *state);
-bool _connection_libnet_get_bluetooth_state(connection_bt_state_estate);
+bool _connection_libnet_get_bluetooth_state(connection_bt_state_e *state);
 bool _connection_libnet_check_profile_validity(connection_profile_h profile);
 bool _connection_libnet_check_profile_cb_validity(connection_profile_h profile);
 int _connection_libnet_get_profile_iterator(connection_iterator_type_e type,
@@ -78,7 +77,7 @@ int _connection_libnet_open_profile(connection_profile_h profile, connection_ope
 int _connection_libnet_get_cellular_service_profile(connection_cellular_service_type_e type, connection_profile_h *profile);
 int _connection_libnet_set_cellular_service_profile_sync(connection_cellular_service_type_e type, connection_profile_h profile);
 int _connection_libnet_set_cellular_service_profile_async(connection_cellular_service_type_e type,
-                       connection_profile_h profile, connection_set_default_cb callback, voiduser_data);
+                       connection_profile_h profile, connection_set_default_cb callback, void *user_data);
 int _connection_libnet_close_profile(connection_profile_h profile, connection_closed_cb callback, void *user_data);
 int _connection_libnet_add_route(const char *interface_name, const char *host_address);
 void _connection_libnet_add_to_profile_list(connection_profile_h profile);
index 991b82847944ef9f9526f4e5af5a45fa4690858e..e2e4604a0f8ede28462ea8d5db4d84d8d320c7f5 100644 (file)
@@ -11,7 +11,8 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(vconf)
 BuildRequires:  pkgconfig(capi-base-common)
-BuildRequires:  pkgconfig(network)
+BuildRequires:  pkgconfig(winet-lib)
+BuildRequires:  pkgconfig(connman-lib)
 
 %description
 Network Connection library in Tizen C API
@@ -24,6 +25,14 @@ Requires: %{name} = %{version}-%{release}
 %description devel
 Network Connection library in Tizen C API (Development)
 
+%package test
+Summary:    Test case for connection (DEV)
+Requires:   %{name} = %{version}
+
+%description test
+Test case for connection (DEV). Some test programs to test the APIs
+and interfaces about connection or other inner code.
+
 %prep
 %setup -q
 cp %{SOURCE1001} .
@@ -59,3 +68,7 @@ cp LICENSE.APLv2 %{buildroot}%{_datadir}/license/capi-network-connection
 %{_includedir}/network/*.h
 %{_libdir}/pkgconfig/*.pc
 %{_libdir}/libcapi-network-connection.so
+
+%files test
+%manifest %{name}.manifest
+%{_libdir}/winet-capi-test/capi-network-connection-test
index 899d87f40333f535a4af4aaea5785c8c3032d49d..49279f438be869c3ce4dd6e3eb8aa326150bc8aa 100644 (file)
@@ -529,6 +529,7 @@ EXPORT_API int connection_add_profile(connection_h connection, connection_profil
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        int rv = 0;
 
        net_profile_info_t *profile_info = profile;
@@ -537,13 +538,14 @@ EXPORT_API int connection_add_profile(connection_h connection, connection_profil
                CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
-
+       TODO:
        rv = net_add_profile(profile_info->ProfileInfo.Pdp.ServiceType, (net_profile_info_t*)profile);
+
        if (rv != NET_ERR_NONE) {
                CONNECTION_LOG(CONNECTION_ERROR, "net_add_profile Failed = %d\n", rv);
                return CONNECTION_ERROR_OPERATION_FAILED;
        }
-
+       */
        return CONNECTION_ERROR_NONE;
 }
 
@@ -555,6 +557,7 @@ EXPORT_API int connection_remove_profile(connection_h connection, connection_pro
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        int rv = 0;
        net_profile_info_t *profile_info = profile;
 
@@ -563,12 +566,13 @@ EXPORT_API int connection_remove_profile(connection_h connection, connection_pro
                CONNECTION_LOG(CONNECTION_ERROR, "Wrong Parameter Passed\n");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
-
+       TODO:
        rv = net_delete_profile(profile_info->ProfileName);
        if (rv != NET_ERR_NONE) {
                CONNECTION_LOG(CONNECTION_ERROR, "net_delete_profile Failed = %d\n", rv);
                return CONNECTION_ERROR_OPERATION_FAILED;
        }
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -581,14 +585,17 @@ EXPORT_API int connection_update_profile(connection_h connection, connection_pro
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+/*
        int rv = 0;
        net_profile_info_t *profile_info = profile;
 
+       TODO:
        rv = net_modify_profile(profile_info->ProfileName, (net_profile_info_t*)profile);
        if (rv != NET_ERR_NONE) {
                CONNECTION_LOG(CONNECTION_ERROR, "net_modify_profile Failed = %d\n", rv);
                return CONNECTION_ERROR_OPERATION_FAILED;
        }
+*/
 
        return CONNECTION_ERROR_NONE;
 }
index 6d0bfe3d00475088b23f131f3aee0dfc755c85e5..a38a43895961a0ff2df1042024954f78481b84b4 100644 (file)
@@ -24,6 +24,7 @@
 
 #define HTTP_PROXY "http_proxy"
 
+/*
 static net_dev_info_t* __profile_get_net_info(net_profile_info_t *profile_info)
 {
        switch (profile_info->profile_type) {
@@ -42,6 +43,8 @@ static net_dev_info_t* __profile_get_net_info(net_profile_info_t *profile_info)
        default:
                return NULL;
        }
+
+       return NULL;
 }
 
 static char* __profile_convert_ip_to_string(net_addr_t *ip_addr)
@@ -90,6 +93,7 @@ static const char* __profile_get_ethernet_proxy(void)
 
        return proxy;
 }
+*/
 
 connection_cellular_service_type_e _profile_convert_to_connection_cellular_service_type(net_service_type_t svc_type)
 {
@@ -190,6 +194,7 @@ EXPORT_API int connection_profile_create(connection_profile_type_e type, const c
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = g_try_malloc0(sizeof(net_profile_info_t));
        if (profile_info == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
@@ -212,6 +217,7 @@ EXPORT_API int connection_profile_create(connection_profile_type_e type, const c
 
        *profile = (connection_profile_h)profile_info;
        _connection_libnet_add_to_profile_list(*profile);
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -235,12 +241,14 @@ EXPORT_API int connection_profile_clone(connection_profile_h* cloned_profile, co
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        *cloned_profile = g_try_malloc0(sizeof(net_profile_info_t));
        if (*cloned_profile == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
 
        memcpy(*cloned_profile, origin_profile, sizeof(net_profile_info_t));
        _connection_libnet_add_to_profile_list(*cloned_profile);
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -252,6 +260,7 @@ EXPORT_API int connection_profile_get_id(connection_profile_h profile, char** pr
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        char *prof_id = strrchr(profile_info->ProfileName, '/');
@@ -263,6 +272,7 @@ EXPORT_API int connection_profile_get_id(connection_profile_h profile, char** pr
 
        if (*profile_id == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -274,6 +284,7 @@ EXPORT_API int connection_profile_get_name(connection_profile_h profile, char**
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        switch (profile_info->profile_type) {
@@ -297,6 +308,7 @@ EXPORT_API int connection_profile_get_name(connection_profile_h profile, char**
        default:
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
+        */
 
        if (*profile_name == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
@@ -311,6 +323,7 @@ EXPORT_API int connection_profile_get_type(connection_profile_h profile, connect
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        switch (profile_info->profile_type) {
@@ -330,6 +343,7 @@ EXPORT_API int connection_profile_get_type(connection_profile_h profile, connect
                CONNECTION_LOG(CONNECTION_ERROR, "Invalid profile type\n");
                return CONNECTION_ERROR_OPERATION_FAILED;
        }
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -341,6 +355,7 @@ EXPORT_API int connection_profile_get_network_interface_name(connection_profile_
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -349,6 +364,7 @@ EXPORT_API int connection_profile_get_network_interface_name(connection_profile_
        *interface_name = g_strdup(net_info->DevName);
        if (*interface_name == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -361,12 +377,15 @@ EXPORT_API int connection_profile_refresh(connection_profile_h profile)
        }
 
        net_profile_info_t profile_info_local;
+       /*
        net_profile_info_t *profile_info = profile;
 
+       TODO:
        if (net_get_profile_info(profile_info->ProfileName, &profile_info_local) != NET_ERR_NONE) {
                CONNECTION_LOG(CONNECTION_ERROR, "Error!!! net_get_profile_info() failed\n");
                return CONNECTION_ERROR_OPERATION_FAILED;
        }
+        */
 
        memcpy(profile, &profile_info_local, sizeof(net_profile_info_t));
 
@@ -380,10 +399,12 @@ EXPORT_API int connection_profile_get_state(connection_profile_h profile, connec
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        *state = _profile_convert_to_cp_state(profile_info->ProfileState);
        if (*state < 0)
                return CONNECTION_ERROR_OPERATION_FAILED;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -402,6 +423,7 @@ EXPORT_API int connection_profile_get_ip_config_type(connection_profile_h profil
        if (address_family == CONNECTION_ADDRESS_FAMILY_IPV6)
                return CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED;
 
+       /*
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -426,6 +448,7 @@ EXPORT_API int connection_profile_get_ip_config_type(connection_profile_h profil
        default:
                return CONNECTION_ERROR_OPERATION_FAILED;
        }
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -441,6 +464,7 @@ EXPORT_API int connection_profile_get_ip_address(connection_profile_h profile,
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -452,6 +476,7 @@ EXPORT_API int connection_profile_get_ip_address(connection_profile_h profile,
        *ip_address = __profile_convert_ip_to_string(&net_info->IpAddr);
        if (*ip_address == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -467,6 +492,7 @@ EXPORT_API int connection_profile_get_subnet_mask(connection_profile_h profile,
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -478,6 +504,7 @@ EXPORT_API int connection_profile_get_subnet_mask(connection_profile_h profile,
        *subnet_mask = __profile_convert_ip_to_string(&net_info->SubnetMask);
        if (*subnet_mask == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -493,6 +520,7 @@ EXPORT_API int connection_profile_get_gateway_address(connection_profile_h profi
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -504,6 +532,7 @@ EXPORT_API int connection_profile_get_gateway_address(connection_profile_h profi
        *gateway_address = __profile_convert_ip_to_string(&net_info->GatewayAddr);
        if (*gateway_address == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -521,6 +550,7 @@ EXPORT_API int connection_profile_get_dns_address(connection_profile_h profile,
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -532,6 +562,7 @@ EXPORT_API int connection_profile_get_dns_address(connection_profile_h profile,
        *dns_address = __profile_convert_ip_to_string(&net_info->DnsAddr[order-1]);
        if (*dns_address == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -543,6 +574,7 @@ EXPORT_API int connection_profile_get_proxy_type(connection_profile_h profile, c
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        const char *proxy;
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
@@ -573,6 +605,7 @@ EXPORT_API int connection_profile_get_proxy_type(connection_profile_h profile, c
        default:
                return CONNECTION_ERROR_OPERATION_FAILED;
        }
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -588,6 +621,7 @@ EXPORT_API int connection_profile_get_proxy_address(connection_profile_h profile
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        const char *proxy;
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
@@ -608,6 +642,7 @@ EXPORT_API int connection_profile_get_proxy_address(connection_profile_h profile
 
        if (*proxy_address == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -622,6 +657,7 @@ EXPORT_API int connection_profile_set_ip_config_type(connection_profile_h profil
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -652,6 +688,7 @@ EXPORT_API int connection_profile_set_ip_config_type(connection_profile_h profil
        default:
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -666,6 +703,7 @@ EXPORT_API int connection_profile_set_ip_address(connection_profile_h profile,
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -678,6 +716,7 @@ EXPORT_API int connection_profile_set_ip_address(connection_profile_h profile,
                net_info->IpAddr.Data.Ipv4.s_addr = 0;
        else if (inet_aton(ip_address, &(net_info->IpAddr.Data.Ipv4)) == 0)
                return CONNECTION_ERROR_INVALID_PARAMETER;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -692,6 +731,7 @@ EXPORT_API int connection_profile_set_subnet_mask(connection_profile_h profile,
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -704,6 +744,7 @@ EXPORT_API int connection_profile_set_subnet_mask(connection_profile_h profile,
                net_info->SubnetMask.Data.Ipv4.s_addr = 0;
        else if (inet_aton(subnet_mask, &(net_info->SubnetMask.Data.Ipv4)) == 0)
                return CONNECTION_ERROR_INVALID_PARAMETER;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -718,6 +759,7 @@ EXPORT_API int connection_profile_set_gateway_address(connection_profile_h profi
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -730,6 +772,7 @@ EXPORT_API int connection_profile_set_gateway_address(connection_profile_h profi
                net_info->GatewayAddr.Data.Ipv4.s_addr = 0;
        else if (inet_aton(gateway_address, &(net_info->GatewayAddr.Data.Ipv4)) == 0)
                return CONNECTION_ERROR_INVALID_PARAMETER;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -746,6 +789,7 @@ EXPORT_API int connection_profile_set_dns_address(connection_profile_h profile,
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -761,6 +805,7 @@ EXPORT_API int connection_profile_set_dns_address(connection_profile_h profile,
 
        if (net_info->DnsCount < order)
                net_info->DnsCount = order;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -772,6 +817,7 @@ EXPORT_API int connection_profile_set_proxy_type(connection_profile_h profile, c
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -790,6 +836,7 @@ EXPORT_API int connection_profile_set_proxy_type(connection_profile_h profile, c
        default:
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -804,6 +851,7 @@ EXPORT_API int connection_profile_set_proxy_address(connection_profile_h profile
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -816,6 +864,7 @@ EXPORT_API int connection_profile_set_proxy_address(connection_profile_h profile
                net_info->ProxyAddr[0] = '\0';
        else
                g_strlcpy(net_info->ProxyAddr, proxy_address, NET_PROXY_LEN_MAX);
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -855,6 +904,7 @@ EXPORT_API int connection_profile_get_wifi_essid(connection_profile_h profile, c
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_WIFI)
@@ -863,6 +913,7 @@ EXPORT_API int connection_profile_get_wifi_essid(connection_profile_h profile, c
        *essid = g_strdup(profile_info->ProfileInfo.Wlan.essid);
        if (*essid == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -874,6 +925,7 @@ EXPORT_API int connection_profile_get_wifi_bssid(connection_profile_h profile, c
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_WIFI)
@@ -882,6 +934,7 @@ EXPORT_API int connection_profile_get_wifi_bssid(connection_profile_h profile, c
        *bssid = g_strdup(profile_info->ProfileInfo.Wlan.bssid);
        if (*bssid == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -893,12 +946,14 @@ EXPORT_API int connection_profile_get_wifi_rssi(connection_profile_h profile, in
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_WIFI)
                return CONNECTION_ERROR_INVALID_PARAMETER;
 
        *rssi = (int)profile_info->ProfileInfo.Wlan.Strength;
+       */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -910,12 +965,14 @@ EXPORT_API int connection_profile_get_wifi_frequency(connection_profile_h profil
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_WIFI)
                return CONNECTION_ERROR_INVALID_PARAMETER;
 
        *frequency = (int)profile_info->ProfileInfo.Wlan.frequency;
+       */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -927,12 +984,14 @@ EXPORT_API int connection_profile_get_wifi_max_speed(connection_profile_h profil
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_WIFI)
                return CONNECTION_ERROR_INVALID_PARAMETER;
 
        *max_speed = (int)profile_info->ProfileInfo.Wlan.max_rate;
+       */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -944,6 +1003,7 @@ EXPORT_API int connection_profile_get_wifi_security_type(connection_profile_h pr
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_WIFI)
@@ -968,6 +1028,7 @@ EXPORT_API int connection_profile_get_wifi_security_type(connection_profile_h pr
        default:
                return CONNECTION_ERROR_OPERATION_FAILED;
        }
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -979,6 +1040,7 @@ EXPORT_API int connection_profile_get_wifi_encryption_type(connection_profile_h
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_WIFI)
@@ -1003,6 +1065,7 @@ EXPORT_API int connection_profile_get_wifi_encryption_type(connection_profile_h
        default:
                return CONNECTION_ERROR_OPERATION_FAILED;
        }
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -1014,6 +1077,7 @@ EXPORT_API int connection_profile_is_wifi_passphrase_required(connection_profile
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_WIFI)
@@ -1037,6 +1101,7 @@ EXPORT_API int connection_profile_is_wifi_passphrase_required(connection_profile
        default:
                return CONNECTION_ERROR_OPERATION_FAILED;
        }
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -1048,6 +1113,7 @@ EXPORT_API int connection_profile_set_wifi_passphrase(connection_profile_h profi
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_WIFI)
@@ -1055,6 +1121,7 @@ EXPORT_API int connection_profile_set_wifi_passphrase(connection_profile_h profi
 
        g_strlcpy(profile_info->ProfileInfo.Wlan.security_info.authentication.psk.pskKey,
                                                passphrase, NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN);
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -1066,6 +1133,7 @@ EXPORT_API int connection_profile_is_wifi_wps_supported(connection_profile_h pro
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_WIFI)
@@ -1075,6 +1143,7 @@ EXPORT_API int connection_profile_is_wifi_wps_supported(connection_profile_h pro
                *supported = true;
        else
                *supported = false;
+       */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -1088,6 +1157,7 @@ EXPORT_API int connection_profile_get_cellular_network_type(connection_profile_h
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        int network_type;
        net_profile_info_t *profile_info = profile;
 
@@ -1117,6 +1187,7 @@ EXPORT_API int connection_profile_get_cellular_network_type(connection_profile_h
        default:
                return CONNECTION_ERROR_OPERATION_FAILED;
        }
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -1129,6 +1200,7 @@ EXPORT_API int connection_profile_get_cellular_service_type(connection_profile_h
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
@@ -1142,6 +1214,7 @@ EXPORT_API int connection_profile_get_cellular_service_type(connection_profile_h
                CONNECTION_LOG(CONNECTION_ERROR, "Invalid service type Passed\n");
                return CONNECTION_ERROR_OPERATION_FAILED;
        }
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -1153,6 +1226,7 @@ EXPORT_API int connection_profile_get_cellular_apn(connection_profile_h profile,
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_CELLULAR)
@@ -1161,6 +1235,7 @@ EXPORT_API int connection_profile_get_cellular_apn(connection_profile_h profile,
        *apn = g_strdup(profile_info->ProfileInfo.Pdp.Apn);
        if (*apn == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -1174,6 +1249,7 @@ EXPORT_API int connection_profile_get_cellular_auth_info(connection_profile_h pr
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_CELLULAR)
@@ -1202,6 +1278,7 @@ EXPORT_API int connection_profile_get_cellular_auth_info(connection_profile_h pr
                g_free(*user_name);
                return CONNECTION_ERROR_OUT_OF_MEMORY;
        }
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -1213,6 +1290,7 @@ EXPORT_API int connection_profile_get_cellular_home_url(connection_profile_h pro
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_CELLULAR)
@@ -1221,6 +1299,7 @@ EXPORT_API int connection_profile_get_cellular_home_url(connection_profile_h pro
        *home_url = g_strdup(profile_info->ProfileInfo.Pdp.HomeURL);
        if (*home_url == NULL)
                return CONNECTION_ERROR_OUT_OF_MEMORY;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -1232,6 +1311,7 @@ EXPORT_API int connection_profile_is_cellular_roaming(connection_profile_h profi
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_CELLULAR)
@@ -1241,6 +1321,7 @@ EXPORT_API int connection_profile_is_cellular_roaming(connection_profile_h profi
                *is_roaming = true;
        else
                *is_roaming = false;
+       */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -1253,6 +1334,7 @@ EXPORT_API int connection_profile_set_cellular_service_type(connection_profile_h
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_CELLULAR)
@@ -1281,6 +1363,7 @@ EXPORT_API int connection_profile_set_cellular_service_type(connection_profile_h
        default:
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -1292,12 +1375,14 @@ EXPORT_API int connection_profile_set_cellular_apn(connection_profile_h profile,
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_CELLULAR)
                return CONNECTION_ERROR_INVALID_PARAMETER;
 
        g_strlcpy(profile_info->ProfileInfo.Pdp.Apn, apn, NET_PDP_APN_LEN_MAX+1);
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -1311,6 +1396,7 @@ EXPORT_API int connection_profile_set_cellular_auth_info(connection_profile_h pr
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_CELLULAR)
@@ -1332,6 +1418,7 @@ EXPORT_API int connection_profile_set_cellular_auth_info(connection_profile_h pr
 
        g_strlcpy(profile_info->ProfileInfo.Pdp.AuthInfo.UserName, user_name, NET_PDP_AUTH_USERNAME_LEN_MAX+1);
        g_strlcpy(profile_info->ProfileInfo.Pdp.AuthInfo.Password, password, NET_PDP_AUTH_PASSWORD_LEN_MAX+1);
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -1343,12 +1430,14 @@ EXPORT_API int connection_profile_set_cellular_home_url(connection_profile_h pro
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
 
        if (profile_info->profile_type != NET_DEVICE_CELLULAR)
                return CONNECTION_ERROR_INVALID_PARAMETER;
 
        g_strlcpy(profile_info->ProfileInfo.Pdp.HomeURL, home_url, NET_HOME_URL_LEN_MAX);
+        */
 
        return CONNECTION_ERROR_NONE;
 }
diff --git a/src/include/net_cm_intf.h b/src/include/net_cm_intf.h
new file mode 100644 (file)
index 0000000..049d4eb
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+* Network Wi-Fi library
+*
+* Copyright (c) 2014-2015 Intel Corporation. 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 __NET_CM_INTF_H__
+#define __NET_CM_INTF_H__
+
+#include "net_pm_wlan.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/**
+ * \addtogroup  common_info
+ * \{
+*/
+
+/**
+* @enum net_cm_network_status_t
+* This enum indicates network status
+*/
+typedef enum {
+       /** Service unknown */
+       NET_STATUS_UNKNOWN,
+       /** Not connected / Suspended / Idle / Connecting/ Disconnecting/ Killing*/
+       NET_STATUS_UNAVAILABLE,
+       /** Active */
+       NET_STATUS_AVAILABLE,
+} net_cm_network_status_t;
+
+/**
+ * @brief Enumerations of statistics type.
+ */
+typedef enum {
+       NET_STATISTICS_TYPE_LAST_RECEIVED_DATA = 0,  /**< Last received data */
+       NET_STATISTICS_TYPE_LAST_SENT_DATA = 1,  /**< Last sent data */
+       NET_STATISTICS_TYPE_TOTAL_RECEIVED_DATA = 2,  /**< Total received data */
+       NET_STATISTICS_TYPE_TOTAL_SENT_DATA = 3,  /**< Total sent data */
+} net_statistics_type_e;
+
+/**
+ * \}
+ */
+
+/**
+ * @enum net_state_type_t
+ * This enumeration defines the service state type.
+ */
+typedef enum {
+       /** Not defined */
+       NET_STATE_TYPE_UNKNOWN  = 0x00,
+       /** Idle state */
+       NET_STATE_TYPE_IDLE,
+       /** Failure state */
+       NET_STATE_TYPE_FAILURE,
+       /** Association state */
+       NET_STATE_TYPE_ASSOCIATION,
+       /** Configuration state */
+       NET_STATE_TYPE_CONFIGURATION,
+       /** Ready state */
+       NET_STATE_TYPE_READY,
+       /** Online state */
+       NET_STATE_TYPE_ONLINE,
+       /** Login state */
+       NET_STATE_TYPE_DISCONNECT,
+} net_state_type_t;
+
+/**
+ * This is the profile structure.
+ */
+typedef struct {
+       /** Device Type of the profile */
+       net_device_t profile_type;
+       /** Profile name */
+       char ProfileName[NET_PROFILE_NAME_LEN_MAX+1];
+       /** Service state */
+       net_state_type_t ProfileState;
+       /** Favourite flag */
+       char Favourite;
+} net_profile_info_t;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __NET_CM_INTF_H__ */
diff --git a/src/include/net_pm_config.h b/src/include/net_pm_config.h
new file mode 100644 (file)
index 0000000..2aed9af
--- /dev/null
@@ -0,0 +1,280 @@
+/*
+ * Network Client Library
+ *
+ * Copyright 2011-2013 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 __NET_PM_CONFIG_H__
+#define __NET_PM_CONFIG_H__
+
+#include <netinet/in.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/**
+ * @file net_pm_config.h
+ * @brief This file defines the constants and enumerations used by Profile Manager with the application/Connection Manager.
+*/
+
+/**
+ * \addtogroup  profile_managing
+ * \{
+*/
+
+/*===========================================================================
+                                       CONSTANTS
+=============================================================================*/
+
+/** Profile name max length */
+#define NET_PROFILE_NAME_LEN_MAX 512
+
+/** Home URL max length in profile account */
+#define NET_HOME_URL_LEN_MAX 512
+
+/** Maximum length of IPv4 string type e.g., "165.213.173.105". This length does not include NULL in the last byte. */
+#define NETPM_IPV4_STR_LEN_MAX 15
+
+/** Minimum length of IPv4 string type e.g., "0.0.0.0". This length does not include NULL in the last byte. */
+#define NETPM_IPV4_STR_LEN_MIN 7
+
+/** This is for MCC + MNC string */
+#define NET_SIM_INFO_LEN 10
+
+/** Maximum length of username in PDP profile. (used in authentication parameters) [3GPP Defined variable] */
+#define NET_PDP_AUTH_USERNAME_LEN_MAX 32
+
+/** Maximum length of password in PDP profile (used in authentication parameters) [3GPP Defined variable] */
+#define NET_PDP_AUTH_PASSWORD_LEN_MAX 32
+
+/** Maximum length of APN in PDP profile [3GPP Defined variable] */
+#define NET_PDP_APN_LEN_MAX 100
+
+/** Maximum length of proxy string */
+#define NET_PROXY_LEN_MAX 64
+
+/** MAX number of DNS Address */
+#define        NET_DNS_ADDR_MAX 2
+
+/** Maximum length of device name  */
+#define        NET_MAX_DEVICE_NAME_LEN 32
+
+/** Maximum length of MAC address
+ * As per IEEE802.11 spec,  BSSID format: xx:xx:xx:xx:xx:xx*/
+#define NET_MAX_MAC_ADDR_LEN 17
+
+/*===========================================================================
+                                       ENUMS
+=============================================================================*/
+
+/**
+ * @enum net_device_t
+ * Profile Type
+ */
+typedef enum {
+       /** Unknown device */
+       NET_DEVICE_UNKNOWN = 0x0,
+
+       /** Default device */
+       NET_DEVICE_DEFAULT = 0x1,
+
+       /** GPRS & WCDMA device */
+       NET_DEVICE_CELLULAR = 0x2,
+
+       /** WLAN device */
+       NET_DEVICE_WIFI = 0x3,
+
+       /** Serial USB device */
+       NET_DEVICE_USB = 0x4,
+
+       /** Ethernet device */
+       NET_DEVICE_ETHERNET = 0x5,
+
+       /** Bluetooth device */
+       NET_DEVICE_BLUETOOTH = 0x6,
+
+       /** Count of device type */
+       NET_DEVICE_MAX = 0x7,
+} net_device_t;
+
+/**
+ * @enum net_addr_type_t
+ * Address Type
+ */
+typedef enum {
+
+       /** IPV4 Address type */
+       NET_ADDR_IPV4 = 0x0,
+
+       /** IPV6 Address type */
+       NET_ADDR_IPV6 = 0x1,
+} net_addr_type_t;
+
+/**
+ * @enum net_auth_type_t
+ * PDP Authentication Type
+ */
+typedef enum {
+
+       /** No authentication */
+       NET_PDP_AUTH_NONE       = 0x0,
+
+       /** PAP authentication */
+       NET_PDP_AUTH_PAP        = 0x1,
+
+       /** CHAP authentication */
+       NET_PDP_AUTH_CHAP       = 0x2,
+} net_auth_type_t;
+
+/**
+ * @enum net_proxy_type_t
+ * This enumeration defines the proxy method type.
+ */
+typedef enum {
+       /** Not defined */
+       NET_PROXY_TYPE_UNKNOWN  = 0x00,
+       /** Direct connection */
+       NET_PROXY_TYPE_DIRECT = 0x01,
+       /** Auto configuration(Use PAC file)
+        *  If URL property is not set, DHCP/WPAD auto-discover will be tried */
+       NET_PROXY_TYPE_AUTO = 0x02,
+       /** Manual configuration */
+       NET_PROXY_TYPE_MANUAL = 0x03,
+} net_proxy_type_t;
+
+/**
+* @enum net_service_type_t
+* This enum indicates network connection type
+*/
+typedef enum {
+       /** Unknown type \n
+       */
+       NET_SERVICE_UNKNOWN = 0x00,
+
+       /** Mobile Internet Type \n
+               Network connection is established in Cellular network for Internet \n
+       */
+       NET_SERVICE_INTERNET = 0x01,
+
+       /** Mobile MMS Type \n
+               Network connection is established in Cellular network for MMS \n
+       */
+       NET_SERVICE_MMS = 0x02,
+
+       /** Prepaid Mobile Internet Type \n
+               Network connection is established in Cellular network for prepaid internet service.\n
+               This service supports to establish network connection in prepaid sim case\n
+       */
+       NET_SERVICE_PREPAID_INTERNET = 0x03,
+
+       /** Prepaid Mobile MMS Type \n
+               Network Connection is established in Cellular network for prepaid MMS service. \n
+               This profile supports to establish network connection in prepaid sim case\n
+       */
+       NET_SERVICE_PREPAID_MMS = 0x04,
+
+       /** Mobile Tethering Type \n
+               Network connection is established in Cellular network for Tethering \n
+       */
+       NET_SERVICE_TETHERING = 0x05,
+
+       /** Specific application Type \n
+               Network connection is established in Cellular network for Specific applications \n
+       */
+       NET_SERVICE_APPLICATION = 0x06,
+
+       /** Deprecated type
+        */
+       NET_SERVICE_WAP = 0x06,
+} net_service_type_t;
+
+
+/**
+ * @enum net_ip_config_type_t
+ * Net IP configuration Type
+ */
+typedef enum {
+       /** Manual IP configuration */
+       NET_IP_CONFIG_TYPE_STATIC = 0x01,
+
+       /** Config ip using DHCP client*/
+       NET_IP_CONFIG_TYPE_DYNAMIC,
+
+       /** Config IP from Auto IP pool (169.254/16)
+        * Later with DHCP client, if available */
+       NET_IP_CONFIG_TYPE_AUTO_IP,
+
+       /** Indicates an IP address that can not be modified */
+       NET_IP_CONFIG_TYPE_FIXED,
+
+       /** Don't use any method */
+       NET_IP_CONFIG_TYPE_OFF,
+} net_ip_config_type_t;
+
+/*===========================================================================
+                               STRUCTURES AND OTHER TYPEDEFS
+=============================================================================*/
+
+/**
+ * IP Address
+ */
+typedef union {
+       /** IP Version 4 address */
+       struct in_addr           Ipv4;
+
+       /** IP Version 6 address */
+       struct in6_addr          Ipv6;
+} ip_addr_t;
+
+/**
+ * Network Address information
+ */
+typedef struct {
+       /** Address Type: IPv4 or IPv6 */
+       net_addr_type_t Type;
+
+       /** IP Address */
+       ip_addr_t Data;
+} net_addr_t;
+
+/**
+ * Below structure is used to export proxy info
+ */
+typedef struct {
+       /** Proxy info */
+       char                    proxy_addr[NET_PROXY_LEN_MAX+1];
+} net_proxy_t;
+
+/**
+ * Below structure is used to export profile name
+ */
+typedef struct {
+       /** Profile name */
+       char                    ProfileName[NET_PROFILE_NAME_LEN_MAX+1];
+} net_profile_name_t;
+
+
+/**
+ * \}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __NET_PM_CONFIG_H__ */
diff --git a/src/include/net_pm_wlan.h b/src/include/net_pm_wlan.h
new file mode 100644 (file)
index 0000000..cad52d2
--- /dev/null
@@ -0,0 +1,376 @@
+/*
+* Network Wi-Fi library
+*
+* Copyright (c) 2014-2015 Intel Corporation. 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 __NET_PM_WLAN_H__
+#define __NET_PM_WLAN_H__
+
+#include "net_pm_config.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/**  \file net_pm_wlan.h
+     \brief This file contains constants, enums, tructs, and function
+     prototypes that are used by Wlan related sources internally.
+     This File defines the WLAN exported Data Structures.
+
+*/
+
+/**
+ * \addtogroup  profile_managing
+ * \{
+*/
+
+/*
+=============================================================================
+                                       CONSTANTS
+=============================================================================
+*/
+/**
+ * Length of essid
+ * As per  IEEE802.11 standard , SSID Length should be 32 Char
+ */
+#define NET_WLAN_ESSID_LEN  32
+
+/**
+ * Length of WPS PIN code
+ * WPS PIN code should be 4 or 8 digits
+ */
+#define NET_WLAN_MAX_WPSPIN_LEN                8
+
+/**
+ * Passphrase length should be between 8..63,
+ * If we plan to use encrypted key(hex value generated by wpa_passphrase),
+ * then we have to set this value to some higher number
+ *
+ */
+#define NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN 65
+
+/**
+ * Length of WEP Key
+ * Max of 10 Hex digits allowed in case of 64 bit encryption
+ * Max of 26 Hex digits allowed in case of 128 bit encryption
+ */
+#define NETPM_WLAN_MAX_WEP_KEY_LEN        26
+
+/**
+ * These lengths depends on authentication server being used,
+ * In case of freeradius server Max allowed length for username/password is 255
+ * Let us restrict this value to some optimal value say 50.
+ * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
+ */
+#define NETPM_WLAN_USERNAME_LEN               50
+
+/**
+ * These lengths depends on authentication server being used,
+ * In case of freeradius server Max allowed length for username/password is 255
+ * Let us restrict this value to some optimal value say 50.
+ * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
+ */
+#define NETPM_WLAN_PASSWORD_LEN               50
+
+/**
+ * length of CA Cert file name
+ * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
+ */
+#define NETPM_WLAN_CA_CERT_FILENAME_LEN       50
+
+/**
+ * length of Client Cert file name
+ * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
+ */
+#define NETPM_WLAN_CLIENT_CERT_FILENAME_LEN   50
+
+/**
+ * length of private key file name
+ * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
+ */
+#define NETPM_WLAN_PRIVATE_KEY_FILENAME_LEN   50
+
+/**
+ * length of Private key password
+ * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
+ */
+#define NETPM_WLAN_PRIVATE_KEY_PASSWD_LEN     50
+
+/*===========================================================================
+                                       ENUMS
+=============================================================================*/
+
+/**
+* @enum net_wifi_state_t
+* This enum indicates wifi state
+*/
+typedef enum {
+       /** Unknown state */
+       WIFI_UNKNOWN = 0x00,
+       /** Wi-Fi is Off */
+       WIFI_OFF,
+       /** Wi-Fi is On(idle/failure) */
+       WIFI_ON,
+       /** Trying to connect(association/configuration) */
+       WIFI_CONNECTING,
+       /** Wi-Fi is connected to an AP(ready/online) */
+       WIFI_CONNECTED,
+       /** Trying to disconnect(connected,
+        * but disconnecting process is on going)
+        */
+       WIFI_DISCONNECTING,
+} net_wifi_state_t;
+
+/**
+*@enum net_wifi_background_scan_mode_t
+* This enum indicates background scanning mode.
+*/
+typedef enum {
+       /** scan cycle : 4, 8, 16, ...128s */
+       WIFI_BGSCAN_MODE_EXPONENTIAL = 0x00,
+       /** scan cycle : 10s */
+       WIFI_BGSCAN_MODE_PERIODIC,
+} net_wifi_background_scan_mode_t;
+
+/**
+*@enum net_wifi_wps_type_t
+* This enum indicates WPS type.
+*/
+typedef enum {
+       /** WPS type is PBC */
+       WIFI_WPS_PBC = 0x00,
+       /** WPS type is PIN */
+       WIFI_WPS_PIN
+} net_wifi_wps_type_t;
+
+/**src/include/net_pm_wlan.h
+ * @enum wlan_security_mode_type_t
+ * Below security modes are used in infrastructure and ad-hoc mode
+ * For now all EAP security mechanisms are provided only in infrastructure mode
+ */
+typedef enum {
+       /** Security disabled */
+       WLAN_SEC_MODE_NONE = 0x01,
+       /** WEP */
+       WLAN_SEC_MODE_WEP,
+       /** EAP */
+       WLAN_SEC_MODE_IEEE8021X,
+       /** WPA-PSK */
+       WLAN_SEC_MODE_WPA_PSK,
+       /** WPA2-PSK */
+       WLAN_SEC_MODE_WPA2_PSK,
+} wlan_security_mode_type_t;
+
+/**
+ * @enum wlan_encryption_mode_type_t
+ * Below encryption modes are used in infrastructure and ad-hoc mode
+ */
+typedef enum {
+       /** Not defined */
+       WLAN_ENC_MODE_UNKNOWN = 0x00,
+       /** Encryption disabled */
+       WLAN_ENC_MODE_NONE,
+       /** WEP */
+       WLAN_ENC_MODE_WEP,
+       /** TKIP */
+       WLAN_ENC_MODE_TKIP,
+       /** AES */
+       WLAN_ENC_MODE_AES,
+       /** TKIP and AES are both supported */
+       WLAN_ENC_MODE_TKIP_AES_MIXED,
+} wlan_encryption_mode_type_t;
+
+/**
+ * @enum wlan_connection_mode_type_t
+ * WLAN Operation Mode
+ * @see net_pm_wlan_profile_info_t
+ */
+typedef enum {
+       /** auto connection mode */
+       NETPM_WLAN_CONNMODE_AUTO = 0x01,
+       /** Connection mode Adhoc  */
+       NETPM_WLAN_CONNMODE_ADHOC,
+       /** Infra connection mode */
+       NETPM_WLAN_CONNMODE_INFRA,
+} wlan_connection_mode_type_t;
+
+/**
+ * @enum wlan_eap_type_t
+ * EAP type
+ * @see wlan_eap_info_t
+ */
+typedef enum {
+       /** EAP PEAP type */
+       WLAN_SEC_EAP_TYPE_PEAP = 0x01,
+       /** EAP TLS type */
+       WLAN_SEC_EAP_TYPE_TLS,
+       /** EAP TTLS type */
+       WLAN_SEC_EAP_TYPE_TTLS,
+       /** EAP SIM type */
+       WLAN_SEC_EAP_TYPE_SIM,
+       /** EAP AKA type */
+       WLAN_SEC_EAP_TYPE_AKA,
+} wlan_eap_type_t;
+
+/**
+ * @enum wlan_eap_auth_type_t
+ * EAP phase2 authentication type
+ * @see wlan_eap_info_t
+ */
+typedef enum {
+       /** EAP phase2 authentication none */
+       WLAN_SEC_EAP_AUTH_NONE = 0x01,
+       /** EAP phase2 authentication PAP */
+       WLAN_SEC_EAP_AUTH_PAP,
+       /** EAP phase2 authentication MSCHAP */
+       WLAN_SEC_EAP_AUTH_MSCHAP,
+       /** EAP phase2 authentication MSCHAPv2 */
+       WLAN_SEC_EAP_AUTH_MSCHAPV2,
+       /** EAP phase2 authentication GTC */
+       WLAN_SEC_EAP_AUTH_GTC,
+       /** EAP phase2 authentication MD5 */
+       WLAN_SEC_EAP_AUTH_MD5,
+} wlan_eap_auth_type_t;
+
+/*======================================================================
+                       STRUCTURES AND OTHER TYPEDEFS
+=====================================================++================*/
+
+/**
+ * Below structure is used to export essid
+ */
+typedef struct {
+       /** ESSID */
+       char essid[NET_WLAN_ESSID_LEN+1];
+} net_essid_t;
+
+/**
+ * Below structure is used by WPA-PSK or WPA2-PSK
+ * @remark To see the maximum length of PSK passphrase key.
+ * @see wlan_auth_info_t
+ */
+typedef struct {
+       /** key value for WPA-PSK or WPA2-PSK */
+       char pskKey[NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN + 1];
+} wlan_psk_info_t;
+
+/**
+ * Below structure is used by WEP
+ * @remark To see the maximum length of WEP key.
+ * @see wlan_auth_info_t
+ */
+typedef struct {
+       /** key value for WEP */
+       char wepKey[NETPM_WLAN_MAX_WEP_KEY_LEN + 1];
+} wlan_wep_info_t;
+
+/**
+ * Below structure is used by EAP
+ * @see wlan_auth_info_t
+ */
+typedef struct {
+       /** User name */
+       char username[NETPM_WLAN_USERNAME_LEN+1];
+       /** Password */
+       char password[NETPM_WLAN_PASSWORD_LEN+1];
+
+       /**
+        * Following fields are mandatory for EAP-TLS,
+        * Optional for EAP-TTLS and EAP-PEAP
+        */
+       /**
+        * For EAP-TTLS and EAP-PEAP only ca_cert_filename[]
+        * can also be provided
+        */
+       /* Used to authenticate server */
+       char ca_cert_filename[NETPM_WLAN_CA_CERT_FILENAME_LEN+1];
+       /** client certificate file name */
+       char client_cert_filename[NETPM_WLAN_CLIENT_CERT_FILENAME_LEN+1];
+       /** private key file name */
+       char private_key_filename[NETPM_WLAN_PRIVATE_KEY_FILENAME_LEN+1];
+       /** private key password */
+       char private_key_passwd[NETPM_WLAN_PRIVATE_KEY_PASSWD_LEN+1];
+
+       /** eap type */
+       wlan_eap_type_t eap_type;
+       /** eap phase2 authentication type */
+       wlan_eap_auth_type_t eap_auth;
+} wlan_eap_info_t;
+
+/**
+ * At any point of time only one security mechanism is supported
+ * @see wlan_security_info_t
+ */
+typedef union {
+       /** Wep Authentication */
+       wlan_wep_info_t wep;
+       /** psk Authentication */
+       wlan_psk_info_t psk;
+       /** eap Authentication */
+       wlan_eap_info_t eap;
+} wlan_auth_info_t;
+
+/**
+ * This is main security information structure
+ * @see net_pm_wlan_profile_info_t
+ */
+typedef struct {
+       /** security mode type */
+       wlan_security_mode_type_t sec_mode;
+       /** encryption mode type */
+       wlan_encryption_mode_type_t enc_mode;
+       /** authentication information */
+       wlan_auth_info_t authentication;
+       /** If WPS is supported, then this property will be set to TRUE */
+       char wps_support;
+} wlan_security_info_t;
+
+/**
+ * This is the structure to connect with WPS network.
+ */
+typedef struct {
+       /** PBC / PIN */
+       net_wifi_wps_type_t type;
+
+       /** Optional. This pin is needed when the user input PIN code */
+       char pin[NET_WLAN_MAX_WPSPIN_LEN + 1];
+} net_wifi_wps_info_t;
+
+/**
+ * This is the profile structure to connect hidden WiFi network.
+ */
+typedef struct {
+       /** Basic feature */
+       char essid[NET_WLAN_ESSID_LEN + 1];
+
+       /** Infrastructure / ad-hoc / auto mode */
+       wlan_connection_mode_type_t wlan_mode;
+
+       /** Security mode and authentication info */
+       wlan_security_info_t security_info;
+} net_wifi_connection_info_t;
+
+/**
+ * \}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __NET_PM_WLAN_H__ */
index 1a8390dd8d7e2586d3ed909840a20fd88586599d..19a99d62719e758db1a8865747fbbaaf91d2ee8f 100755 (executable)
@@ -18,6 +18,8 @@
 #include <string.h>
 #include <glib.h>
 #include <vconf/vconf.h>
+#include <winet-wifi.h>
+#include <connman-lib.h>
 #include "net_connection_private.h"
 
 static GSList *prof_handle_list = NULL;
@@ -48,6 +50,7 @@ struct _libnet_s {
 static struct _profile_list_s profile_iterator = {0, 0, NULL};
 static struct _libnet_s libnet = {NULL, NULL, NULL, NULL, NULL, NULL, false};
 
+/*
 static connection_error_e __libnet_convert_to_cp_error_type(net_err_t err_type)
 {
        switch (err_type) {
@@ -127,6 +130,7 @@ static const char *__libnet_convert_cp_state_to_string(connection_profile_state_
                return "UNKNOWN";
        }
 }
+*/
 
 static void __libnet_set_opened_cb(connection_opened_cb user_cb, void *user_data)
 {
@@ -136,6 +140,7 @@ static void __libnet_set_opened_cb(connection_opened_cb user_cb, void *user_data
        }
 }
 
+/*
 static void __libnet_opened_cb(connection_error_e result)
 {
        if (libnet.opened_cb)
@@ -144,6 +149,7 @@ static void __libnet_opened_cb(connection_error_e result)
        libnet.opened_cb = NULL;
        libnet.opened_user_data = NULL;
 }
+*/
 
 static void __libnet_set_closed_cb(connection_closed_cb user_cb, void *user_data)
 {
@@ -153,6 +159,7 @@ static void __libnet_set_closed_cb(connection_closed_cb user_cb, void *user_data
        }
 }
 
+/*
 static void __libnet_closed_cb(connection_error_e result)
 {
        if (libnet.closed_cb)
@@ -161,6 +168,7 @@ static void __libnet_closed_cb(connection_error_e result)
        libnet.closed_cb = NULL;
        libnet.closed_user_data = NULL;
 }
+*/
 
 static void __libnet_set_default_cb(connection_set_default_cb user_cb, void *user_data)
 {
@@ -170,6 +178,7 @@ static void __libnet_set_default_cb(connection_set_default_cb user_cb, void *use
        }
 }
 
+/*
 static void __libnet_default_cb(connection_error_e result)
 {
        if (libnet.set_default_cb)
@@ -198,6 +207,7 @@ static void __libnet_state_changed_cb(char *profile_name, connection_profile_sta
        if (state >= 0 && cb_info->callback)
                cb_info->callback(state, cb_info->user_data);
 }
+*/
 
 static void __libnet_clear_profile_list(struct _profile_list_s *profile_list)
 {
@@ -209,102 +219,6 @@ static void __libnet_clear_profile_list(struct _profile_list_s *profile_list)
        profile_list->profiles = NULL;
 }
 
-static void __libnet_evt_cb(net_event_info_t*  event_cb, void* user_data)
-{
-       bool is_requested = false;
-       connection_error_e result = CONNECTION_ERROR_NONE;
-
-       switch (event_cb->Event) {
-       case NET_EVENT_OPEN_RSP:
-               is_requested = true;
-               /* fall through */
-       case NET_EVENT_OPEN_IND:
-               result = __libnet_convert_to_cp_error_type(event_cb->Error);
-               CONNECTION_LOG(CONNECTION_INFO, "Got connection open %s : %s\n",
-                                       (is_requested) ? "RSP":"IND",
-                                       __libnet_convert_cp_error_type_to_string(result));
-
-               if (is_requested)
-                       __libnet_opened_cb(result);
-
-               switch (event_cb->Error) {
-               case NET_ERR_NONE:
-               case NET_ERR_ACTIVE_CONNECTION_EXISTS:
-                       CONNECTION_LOG(CONNECTION_INFO, "'Open connection' succeeded\n");
-
-                       __libnet_state_changed_cb(event_cb->ProfileName, CONNECTION_PROFILE_STATE_CONNECTED);
-                       return;
-               default:
-                       CONNECTION_LOG(CONNECTION_ERROR, "'Open connection' failed!! [%s]\n",
-                                               __libnet_convert_cp_error_type_to_string(result));
-               }
-
-               __libnet_state_changed_cb(event_cb->ProfileName, CONNECTION_PROFILE_STATE_DISCONNECTED);
-
-               break;
-       case NET_EVENT_CLOSE_RSP:
-               is_requested = true;
-               /* fall through */
-       case NET_EVENT_CLOSE_IND:
-               result = __libnet_convert_to_cp_error_type(event_cb->Error);
-               CONNECTION_LOG(CONNECTION_INFO, "Got connection close %s : %s\n",
-                                       (is_requested) ? "RSP":"IND",
-                                       __libnet_convert_cp_error_type_to_string(result));
-
-               if (is_requested)
-                       __libnet_closed_cb(result);
-
-               switch (event_cb->Error) {
-               case NET_ERR_NONE:
-                       CONNECTION_LOG(CONNECTION_INFO, "'Close connection' succeeded!\n");
-
-                       __libnet_state_changed_cb(event_cb->ProfileName, CONNECTION_PROFILE_STATE_DISCONNECTED);
-                       return;
-               default:
-                       CONNECTION_LOG(CONNECTION_ERROR, "'Close connection' failed!! [%s]\n",
-                                               __libnet_convert_cp_error_type_to_string(result));
-               }
-
-               break;
-       case NET_EVENT_NET_STATE_IND:
-               CONNECTION_LOG(CONNECTION_INFO, "Got State changed IND\n");
-
-               if (event_cb->Datalength != sizeof(net_state_type_t))
-                       return;
-
-               net_state_type_t *profile_state = (net_state_type_t*)event_cb->Data;
-               connection_profile_state_e cp_state = _profile_convert_to_cp_state(*profile_state);
-
-               CONNECTION_LOG(CONNECTION_INFO,
-                               "Profile State : %s, profile name : %s\n",
-                               __libnet_convert_cp_state_to_string(cp_state),
-                               event_cb->ProfileName);
-
-               __libnet_state_changed_cb(event_cb->ProfileName, cp_state);
-
-               break;
-       case NET_EVENT_WIFI_SCAN_IND:
-       case NET_EVENT_WIFI_SCAN_RSP:
-               CONNECTION_LOG(CONNECTION_INFO, "Got wifi scan IND\n");
-               break;
-       case NET_EVENT_WIFI_POWER_IND:
-       case NET_EVENT_WIFI_POWER_RSP:
-               CONNECTION_LOG(CONNECTION_INFO, "Got wifi power IND\n");
-               break;
-       case NET_EVENT_CELLULAR_SET_DEFAULT_RSP:
-               result = __libnet_convert_to_cp_error_type(event_cb->Error);
-               CONNECTION_LOG(CONNECTION_INFO, "Got set default profile RSP %d\n", result);
-               __libnet_default_cb(result);
-               break;
-       case NET_EVENT_WIFI_WPS_RSP:
-               CONNECTION_LOG(CONNECTION_INFO, "Got wifi WPS RSP\n");
-               /* fall through */
-       default :
-               CONNECTION_LOG(CONNECTION_ERROR, "Error! Unknown Event\n\n");
-               break;
-       }
-}
-
 int __libnet_get_connected_count(struct _profile_list_s *profile_list)
 {
        int count = 0;
@@ -321,6 +235,7 @@ int __libnet_get_connected_count(struct _profile_list_s *profile_list)
 
 void __libnet_copy_connected_profile(net_profile_info_t **dest, struct _profile_list_s *source)
 {
+       /*
        int i = 0;
 
        for (;i < source->count;i++) {
@@ -330,6 +245,7 @@ void __libnet_copy_connected_profile(net_profile_info_t **dest, struct _profile_
                        (*dest)++;
                }
        }
+        */
 }
 
 bool _connection_libnet_init(void)
@@ -337,8 +253,8 @@ bool _connection_libnet_init(void)
        int rv;
 
        if (!libnet.registered) {
-               rv = net_register_client_ext((net_event_cb_t)__libnet_evt_cb, NET_DEVICE_DEFAULT, NULL);
-               if (rv != NET_ERR_NONE)
+               rv = connman_lib_init();
+               if (rv != CONNMAN_LIB_ERR_NONE)
                        return false;
 
                libnet.registered = true;
@@ -353,8 +269,7 @@ bool _connection_libnet_init(void)
 bool _connection_libnet_deinit(void)
 {
        if (libnet.registered) {
-               if (net_deregister_client_ext(NET_DEVICE_DEFAULT) != NET_ERR_NONE)
-                       return false;
+               connman_lib_deinit();
 
                libnet.registered = false;
 
@@ -406,14 +321,15 @@ bool _connection_libnet_check_profile_cb_validity(connection_profile_h profile)
 
 bool _connection_libnet_get_wifi_state(connection_wifi_state_e *state)
 {
-       net_wifi_state_t wlan_state;
+       net_wifi_state_t wlan_state = WIFI_OFF;
+       /*
        net_profile_name_t profile_name;
-
+       TODO:
        if (net_get_wifi_state(&wlan_state, &profile_name) != NET_ERR_NONE) {
                CONNECTION_LOG(CONNECTION_ERROR, "Error!! net_get_wifi_state() failed.\n");
                return false;
        }
-
+        */
        switch (wlan_state) {
        case WIFI_OFF:
                *state = CONNECTION_WIFI_STATE_DEACTIVATED;
@@ -437,8 +353,10 @@ bool _connection_libnet_get_wifi_state(connection_wifi_state_e *state)
 bool _connection_libnet_get_ethernet_state(connection_ethernet_state_e* state)
 {
        struct _profile_list_s ethernet_profiles = {0, 0, NULL};
+       /*
+       TODO:
        net_get_profile_list(NET_DEVICE_ETHERNET, &ethernet_profiles.profiles, &ethernet_profiles.count);
-
+        */
        if (ethernet_profiles.count == 0) {
                *state = CONNECTION_ETHERNET_STATE_DEACTIVATED;
                return true;
@@ -469,7 +387,10 @@ bool _connection_libnet_get_bluetooth_state(connection_bt_state_e* state)
 {
        int i = 0;
        struct _profile_list_s bluetooth_profiles = {0, 0, NULL};
+       /*
+       TODO:
        net_get_profile_list(NET_DEVICE_BLUETOOTH, &bluetooth_profiles.profiles, &bluetooth_profiles.count);
+        */
 
        if (bluetooth_profiles.count == 0) {
                *state = CONNECTION_BT_STATE_DEACTIVATED;
@@ -504,13 +425,14 @@ done:
 int _connection_libnet_get_profile_iterator(connection_iterator_type_e type, connection_profile_iterator_h* profile_iter_h)
 {
        int count = 0;
-       int rv;
+       /*int rv;*/
        net_profile_info_t *profiles = NULL;
 
        struct _profile_list_s all_profiles = {0, 0, NULL};
 
        __libnet_clear_profile_list(&profile_iterator);
-
+       /*
+       TODO:
        rv = net_get_profile_list(NET_DEVICE_MAX, &all_profiles.profiles, &all_profiles.count);
 
        if (rv != NET_ERR_NONE) {
@@ -520,6 +442,7 @@ int _connection_libnet_get_profile_iterator(connection_iterator_type_e type, con
                } else
                        return CONNECTION_ERROR_OPERATION_FAILED;
        }
+        */
 
        *profile_iter_h = &profile_iterator;
 
@@ -597,13 +520,16 @@ int _connection_libnet_destroy_iterator(connection_profile_iterator_h profile_it
 int _connection_libnet_get_current_profile(connection_profile_h *profile)
 {
        net_profile_info_t active_profile;
-       int rv;
-
+       /*int rv;*/
+       /*
+       TODO:
        rv = net_get_active_net_info(&active_profile);
+
        if (rv == NET_ERR_NO_SERVICE)
                return CONNECTION_ERROR_NO_CONNECTION;
        else if (rv != NET_ERR_NONE)
                return CONNECTION_ERROR_OPERATION_FAILED;
+        */
 
        *profile = g_try_malloc0(sizeof(net_profile_info_t));
        if (*profile == NULL)
@@ -622,10 +548,12 @@ int _connection_libnet_open_profile(connection_profile_h profile, connection_ope
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
-
+       TODO:
        if (net_open_connection_with_profile(profile_info->ProfileName) != NET_ERR_NONE)
                return CONNECTION_ERROR_OPERATION_FAILED;
+        */
 
        __libnet_set_opened_cb(callback, user_data);
 
@@ -634,6 +562,7 @@ int _connection_libnet_open_profile(connection_profile_h profile, connection_ope
 
 int _connection_libnet_get_cellular_service_profile(connection_cellular_service_type_e type, connection_profile_h *profile)
 {
+/*
        int i = 0;
        int j = 0;
        int rv = NET_ERR_NONE;
@@ -641,6 +570,7 @@ int _connection_libnet_get_cellular_service_profile(connection_cellular_service_
 
        struct _profile_list_s cellular_profiles = {0, 0, NULL};
 
+       TODO:
        rv = net_get_profile_list(NET_DEVICE_CELLULAR, &cellular_profiles.profiles, &cellular_profiles.count);
        if (rv != NET_ERR_NONE)
                return CONNECTION_ERROR_OPERATION_FAILED;
@@ -680,6 +610,7 @@ int _connection_libnet_get_cellular_service_profile(connection_cellular_service_
 
 done:
        prof_handle_list = g_slist_append(prof_handle_list, *profile);
+*/
 
        return CONNECTION_ERROR_NONE;
 }
@@ -691,6 +622,7 @@ int _connection_libnet_set_cellular_service_profile_sync(connection_cellular_ser
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        connection_cellular_service_type_e service_type;
 
@@ -698,9 +630,10 @@ int _connection_libnet_set_cellular_service_profile_sync(connection_cellular_ser
 
        if (service_type != type)
                return CONNECTION_ERROR_INVALID_PARAMETER;
-
+       TODO:
        if (net_set_default_cellular_service_profile(profile_info->ProfileName) != NET_ERR_NONE)
                return CONNECTION_ERROR_OPERATION_FAILED;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -713,6 +646,7 @@ int _connection_libnet_set_cellular_service_profile_async(connection_cellular_se
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
        connection_cellular_service_type_e service_type;
 
@@ -720,9 +654,10 @@ int _connection_libnet_set_cellular_service_profile_async(connection_cellular_se
 
        if (service_type != type)
                return CONNECTION_ERROR_INVALID_PARAMETER;
-
+       TODO:
        if (net_set_default_cellular_service_profile_async(profile_info->ProfileName) != NET_ERR_NONE)
                return CONNECTION_ERROR_OPERATION_FAILED;
+        */
 
        __libnet_set_default_cb(callback, user_data);
 
@@ -736,10 +671,12 @@ int _connection_libnet_close_profile(connection_profile_h profile, connection_cl
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       /*
        net_profile_info_t *profile_info = profile;
-
+       TODO:
        if (net_close_connection(profile_info->ProfileName) != NET_ERR_NONE)
                return CONNECTION_ERROR_OPERATION_FAILED;
+        */
 
        __libnet_set_closed_cb(callback, user_data);
 
@@ -758,9 +695,11 @@ int _connection_libnet_add_route(const char *interface_name, const char *host_ad
                CONNECTION_LOG(CONNECTION_ERROR, "Invalid IP address Passed\n");
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
-
+       /*
+       TODO:
        if (net_add_route(host_address, interface_name) != NET_ERR_NONE)
                return CONNECTION_ERROR_OPERATION_FAILED;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
@@ -804,16 +743,22 @@ void _connection_libnet_remove_from_profile_cb_list(connection_profile_h profile
 
 int _connection_libnet_set_statistics(net_device_t device_type, net_statistics_type_e statistics_type)
 {
+       /*
+       TODO:
        if (net_set_statistics(device_type, statistics_type) != NET_ERR_NONE)
                return CONNECTION_ERROR_OPERATION_FAILED;
+        */
 
        return CONNECTION_ERROR_NONE;
 }
 
 int _connection_libnet_get_statistics(net_statistics_type_e statistics_type, unsigned long long *size)
 {
+       /*
+       TODO:
        if (net_get_statistics(NET_DEVICE_WIFI, statistics_type, size) != NET_ERR_NONE)
                        return CONNECTION_ERROR_OPERATION_FAILED;
+        */
 
                return CONNECTION_ERROR_NONE;
 }
index 7f2f801cbb7eb9897748583704ae9f5d0e694256..db77a7ffcf83e7ef45f7acd786b20f284a993451 100644 (file)
@@ -1,6 +1,6 @@
 SET(fw_test "${fw_name}-test")
 
-SET(dependents "capi-base-common glib-2.0 network")
+SET(dependents "capi-base-common glib-2.0")
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(${fw_test} REQUIRED ${dependents})
@@ -13,7 +13,8 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall")
 aux_source_directory(. sources)
 FOREACH(src ${sources})
     GET_FILENAME_COMPONENT(src_name ${src} NAME_WE)
-    MESSAGE("${src_name}")
-    ADD_EXECUTABLE(${src_name} ${src})
-    TARGET_LINK_LIBRARIES(${src_name} ${fw_name} ${${fw_test}_LDFLAGS})
+    MESSAGE("${fw_test}")
+    ADD_EXECUTABLE(${fw_test} ${src})
+    TARGET_LINK_LIBRARIES(${fw_test} ${fw_name} ${${fw_test}_LDFLAGS})
+    INSTALL(TARGETS ${fw_test} DESTINATION ${LIB_INSTALL_DIR}/winet-capi-test/)
 ENDFOREACH()