Update CNetConMgr and code clean 66/37166/3
authorJuWan Kim <juwan.kim@samsung.com>
Fri, 20 Mar 2015 04:57:59 +0000 (13:57 +0900)
committerJuWan Kim <juwan.kim@samsung.com>
Sat, 21 Mar 2015 04:20:58 +0000 (13:20 +0900)
Change-Id: Ib8d0e03a674fc5acc787d7a0adda49807163eca5
Signed-off-by: JuWan Kim <juwan.kim@samsung.com>
15 files changed:
log.txt [deleted file]
ug/include/NetConMgr.h
ug/network/CMakeLists.txt
ug/network/include/common.h
ug/network/include/connection_mgr.h [deleted file]
ug/network/include/main_view.h
ug/network/include/vconf_mgr.h
ug/network/src/connection_mgr.cpp [deleted file]
ug/network/src/ip_setting_view.cpp
ug/network/src/main_view.cpp
ug/proxy/include/common.h [deleted file]
ug/proxy/include/defs.h
ug/proxy/include/main_view.h
ug/proxy/src/main_view.cpp
ug/src/NetConMgr.cpp

diff --git a/log.txt b/log.txt
deleted file mode 100644 (file)
index cc4d26d..0000000
--- a/log.txt
+++ /dev/null
@@ -1,211 +0,0 @@
-+ GBS_ROOT=/home/juwankim/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/
-+ BUILD_DIR=home/abuild/rpmbuild/BUILD/
-+ cd /home/juwankim/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/home/abuild/rpmbuild/BUILD/
-+ ls -1
-+ PROJECT=org.tizen.settings-tv-ref-0.1
-+ echo Source Copying..
-Source Copying..
-+ cp -rf src/data_wrapper.c src/main.c src/parser.c src/settings_provider.c src/timeout_handler.c src/utils.c src/view_bottomslider.c src/view_bottomsublist.c src/view_device_manager.c src/view_maincatalog.c src/view_need_pwd.c src/view_pwd_popup.c src/view_resetpopup.c src/view_sublist.c src/view_system_clock.c src/view_uigadget.c src/view_upgrade_popup.c src/viewmgr.c /home/juwankim/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/src/
-+ cp -rf ug/channel ug/network ug/proxy ug/system ug/wifi-direct /home/juwankim/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ug/
-+ cp -rf include/data_wrapper.h include/dbg.h include/def.h include/json_marco.h include/parser.h include/settings_provider.h include/timeout_handler.h include/utils.h include/view_bottomslider.h include/view_bottomsublist.h include/view_device_manager.h include/view_maincatalog.h include/view_need_pwd.h include/view_pwd_popup.h include/view_resetpopup.h include/view_sublist.h include/view_system_clock.h include/view_uigadget.h include/view_upgrade_popup.h include/viewmgr.h /home/juwankim/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/include/
-+ echo Build Start
-Build Start
-+ sudo chroot /home/juwankim/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/ /bin/bash -c cd /home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ && make -j16 && exit
--- Configuring done
--- Generating done
--- Build files have been written to: /home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-qemu: Unsupported syscall: 350
-edje_cc: Warning. Part 'elm.text' in group 'elm/progressbar/horizontal/scan_progress' contains description 'default:0' which has text.min: 1 X; but not text.ellipsis: -1;
-edje_cc: Warning. This is almost certainly not what you want.
-edje_cc: Warning. Part 'elm.text' in group 'elm/progressbar/horizontal/update_progressbar' contains description 'default:0' which has text.min: 1 X; but not text.ellipsis: -1;
-edje_cc: Warning. This is almost certainly not what you want.
-[  0%] Built target ug-proxy-settings.edj
-[  0%] Built target ug_auto_program.edj
-[  0%] Built target ug_auto_program_theme.edj
-[  0%] Scanning dependencies of target ug-auto-program
-Built target ug-proxy-settings-theme.edj
-[  2%] [  4%] [  6%] [  8%] [ 10%] [ 12%] [ 12%] Building C object ug/channel/CMakeFiles/ug-auto-program.dir/src/ug_auto_program.c.o
-Building C object ug/channel/CMakeFiles/ug-auto-program.dir/src/util.c.o
-[ 14%] Building C object ug/channel/CMakeFiles/ug-auto-program.dir/src/viewmgr_auto_program.c.o
-Building C object ug/channel/CMakeFiles/ug-auto-program.dir/src/view_scan_start.c.o
-Built target ug_clock_theme.edj
-Scanning dependencies of target ug-proxy-settings
-[ 14%] Building C object ug/channel/CMakeFiles/ug-auto-program.dir/src/view_search_page.c.o
-Building C object ug/channel/CMakeFiles/ug-auto-program.dir/src/view_result_page.c.o
-Built target ug-network-settings.edj
-[ 16%] Building C object ug/channel/CMakeFiles/ug-auto-program.dir/src/tv_scan.c.o
-[ 18%] [ 18%] [ 18%] [ 20%] Building C object ug/proxy/CMakeFiles/ug-proxy-settings.dir/src/main_view.c.o
-Built target ug-network-settings-theme.edj
-Building C object ug/proxy/CMakeFiles/ug-proxy-settings.dir/src/ug_proxy_settings.c.o
-Built target org.tizen.settings-tv-ref-theme.edj
-[ 20%] [ 20%] Building C object ug/proxy/CMakeFiles/ug-proxy-settings.dir/src/vconf_mgr.c.o
-[ 22%] Built target ug-wifi-direct.edj
-Built target ug_clock.edj
-[ 24%] Building C object ug/proxy/CMakeFiles/ug-proxy-settings.dir/src/connection_mgr.c.o
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ug/channel/src/tv_scan.c: In function '_handle_signal':
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ug/channel/src/tv_scan.c:300:1: warning: no return statement in function returning non-void [-Wreturn-type]
- }
- ^
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ug/channel/src/tv_scan.c: At top level:
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ug/channel/src/tv_scan.c:103:13: warning: '_handle_begin_signal' defined but not used [-Wunused-function]
- static void _handle_begin_signal(struct tv_scan *tvs,
-             ^
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ug/channel/src/tv_scan.c:136:13: warning: '_handle_progress_signal' defined but not used [-Wunused-function]
- static void _handle_progress_signal(struct tv_scan *tvs,
-             ^
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ug/channel/src/tv_scan.c:161:13: warning: '_channel_count' defined but not used [-Wunused-function]
- static void _channel_count(unsigned int *atv, unsigned int *dtv,
-             ^
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ug/channel/src/tv_scan.c:190:13: warning: '_handle_found_signal' defined but not used [-Wunused-function]
- static void _handle_found_signal(struct tv_scan *tvs,
-             ^
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ug/channel/src/tv_scan.c:227:13: warning: '_handle_done_signal' defined but not used [-Wunused-function]
- static void _handle_done_signal(struct tv_scan *tvs,
-             ^
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ug/channel/src/tv_scan.c:250:18: warning: '_handle_signal' defined but not used [-Wunused-function]
- static Eina_Bool _handle_signal(void *data)
-                  ^
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ug/channel/src/tv_scan.c: In function 'tv_scan_pause':
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/ug/channel/src/tv_scan.c:541:1: warning: control reaches end of non-void function [-Wreturn-type]
- }
- ^
-[ 26%] Building C object ug/proxy/CMakeFiles/ug-proxy-settings.dir/src/wifi_mgr.c.o
-Scanning dependencies of target ug-network-settings
-[ 28%] Scanning dependencies of target ug-clock
-Building C object ug/proxy/CMakeFiles/ug-proxy-settings.dir/src/util.c.o
-[ 30%] [ 32%] [ 34%] [ 36%] [ 38%] [ 40%] Building C object ug/network/CMakeFiles/ug-network-settings.dir/src/main_view.c.o
-[ 42%] Building C object ug/network/CMakeFiles/ug-network-settings.dir/src/ug_network_settings.c.o
-Building C object ug/network/CMakeFiles/ug-network-settings.dir/src/vconf_mgr.c.o
-Building C object ug/network/CMakeFiles/ug-network-settings.dir/src/wifi_mgr.c.o
-Building C object ug/network/CMakeFiles/ug-network-settings.dir/src/ip_setting_view.c.o
-[ 44%] Building C object ug/network/CMakeFiles/ug-network-settings.dir/src/network_viewmgr.c.o
-Building C object ug/system/clock/CMakeFiles/ug-clock.dir/src/ug_clock_spin_control.c.o
-Building C object ug/system/clock/CMakeFiles/ug-clock.dir/src/ug_clock.c.o
-[ 46%] [ 46%] Linking C shared library libug-auto-program.so
-Building C object ug/system/clock/CMakeFiles/ug-clock.dir/src/ug_clock_sublist.c.o
-Built target ug-wifi-direct-theme.edj
-Building C object ug/system/clock/CMakeFiles/ug-clock.dir/src/ug_clock_utils.c.o
-[ 48%] [ 51%] Building C object ug/network/CMakeFiles/ug-network-settings.dir/src/connection_mgr.c.o
-Building C object ug/network/CMakeFiles/ug-network-settings.dir/src/util.c.o
-[ 53%] [ 55%] Building C object ug/network/CMakeFiles/ug-network-settings.dir/src/wifi_passcode_view.c.o
-Linking C shared library libug-proxy-settings.so
-Building C object ug/system/clock/CMakeFiles/ug-clock.dir/src/ug_clock_time_spin_control.c.o
-Scanning dependencies of target ug-wifi-direct
-[ 55%] [ 57%] Built target ug-auto-program
-[ 61%] [ 61%] [ 63%] Building C object ug/wifi-direct/CMakeFiles/ug-wifi-direct.dir/src/ug_wifi_direct.c.o
-Building C object ug/wifi-direct/CMakeFiles/ug-wifi-direct.dir/src/wifi_direct_view.c.o
-Building C object ug/wifi-direct/CMakeFiles/ug-wifi-direct.dir/src/util.c.o
-Building C object ug/wifi-direct/CMakeFiles/ug-wifi-direct.dir/src/wifi_direct_mgr.c.o
-[ 63%] Built target ug-proxy-settings
-Linking C shared library libug-clock.so
-Linking C shared library libug-network-settings.so
-[ 63%] [ 63%] Built target ug-clock
-Built target ug-network-settings
-[ 63%] Built target org.tizen.settings-tv-ref.edj
-Linking C shared library libug-wifi-direct.so
-Scanning dependencies of target settings-tv-ref
-[ 67%] [ 67%] [ 73%] [ 73%] [ 73%] [ 75%] [ 77%] [ 79%] [ 79%] [ 81%] Built target ug-wifi-direct
-Building C object CMakeFiles/settings-tv-ref.dir/src/utils.c.o
-Building C object CMakeFiles/settings-tv-ref.dir/src/main.c.o
-[ 83%] Building C object CMakeFiles/settings-tv-ref.dir/src/viewmgr.c.o
-Building C object CMakeFiles/settings-tv-ref.dir/src/parser.c.o
-Building C object CMakeFiles/settings-tv-ref.dir/src/view_uigadget.c.o
-Building C object CMakeFiles/settings-tv-ref.dir/src/data_wrapper.c.o
-Building C object CMakeFiles/settings-tv-ref.dir/src/view_maincatalog.c.o
-Building C object CMakeFiles/settings-tv-ref.dir/src/view_sublist.c.o
-[ 87%] [ 87%] Building C object CMakeFiles/settings-tv-ref.dir/src/view_bottomsublist.c.o
-[ 89%] Building C object CMakeFiles/settings-tv-ref.dir/src/view_bottomslider.c.o
-Building C object CMakeFiles/settings-tv-ref.dir/src/settings_provider.c.o
-Building C object CMakeFiles/settings-tv-ref.dir/src/view_pwd_popup.c.o
-[ 91%] Building C object CMakeFiles/settings-tv-ref.dir/src/view_device_manager.c.o
-[ 93%] [ 95%] Building C object CMakeFiles/settings-tv-ref.dir/src/view_upgrade_popup.c.o
-Building C object CMakeFiles/settings-tv-ref.dir/src/view_system_clock.c.o
-Building C object CMakeFiles/settings-tv-ref.dir/src/view_resetpopup.c.o
-[ 97%] In file included from /home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/src/settings_provider.c:21:0:
-/usr/include/media/sound_manager.h:220:1: warning: 'sound_session_notify_e' is deprecated (declared at /usr/include/media/sound_manager.h:193) [-Wdeprecated-declarations]
- typedef void (*sound_session_notify_cb) (sound_session_notify_e notify, void *user_data) DEPRECATED; // will be deprecated
- ^
-/usr/include/media/sound_manager.h:229:1: warning: 'sound_interrupted_code_e' is deprecated (declared at /usr/include/media/sound_manager.h:202) [-Wdeprecated-declarations]
- typedef void(* sound_interrupted_cb)(sound_interrupted_code_e code, void *user_data) DEPRECATED; // will be deprecated
- ^
-/usr/include/media/sound_manager.h:526:1: warning: 'volume_key_type_e' is deprecated (declared at /usr/include/media/sound_manager.h:84) [-Wdeprecated-declarations]
- int sound_manager_set_volume_key_type(volume_key_type_e type) DEPRECATED;// will be deprecated
- ^
-/usr/include/media/sound_manager.h:726:1: warning: 'sound_session_notify_cb' is deprecated [-Wdeprecated-declarations]
- int sound_manager_set_session_notify_cb(sound_session_notify_cb callback, void *user_data) DEPRECATED;// will be deprecated
- ^
-/usr/include/media/sound_manager.h:745:1: warning: 'sound_interrupted_cb' is deprecated [-Wdeprecated-declarations]
- int sound_manager_set_interrupted_cb(sound_interrupted_cb callback, void *user_data) DEPRECATED;// will be deprecated;
- ^
-/usr/include/media/sound_manager.h:991:1: warning: 'sound_route_e' is deprecated (declared at /usr/include/media/sound_manager.h:363) [-Wdeprecated-declarations]
- typedef bool(* sound_available_route_cb)(sound_route_e route, void *user_data) DEPRECATED;// will be deprecated
- ^
-/usr/include/media/sound_manager.h:1001:1: warning: 'sound_route_e' is deprecated (declared at /usr/include/media/sound_manager.h:363) [-Wdeprecated-declarations]
- typedef void(* sound_available_route_changed_cb)(sound_route_e route, bool available, void *user_data) DEPRECATED;// will be deprecated
- ^
-/usr/include/media/sound_manager.h:1010:1: warning: 'sound_device_in_e' is deprecated (declared at /usr/include/media/sound_manager.h:339) [-Wdeprecated-declarations]
- typedef void(* sound_active_device_changed_cb)(sound_device_in_e in, sound_device_out_e out, void *user_data) DEPRECATED;// will be deprecated
- ^
-/usr/include/media/sound_manager.h:1010:1: warning: 'sound_device_out_e' is deprecated (declared at /usr/include/media/sound_manager.h:348) [-Wdeprecated-declarations]
-/usr/include/media/sound_manager.h:1022:1: warning: 'sound_available_route_cb' is deprecated [-Wdeprecated-declarations]
- int sound_manager_foreach_available_route (sound_available_route_cb callback, void *user_data) DEPRECATED;// will be deprecated
- ^
-/usr/include/media/sound_manager.h:1032:1: warning: 'sound_route_e' is deprecated (declared at /usr/include/media/sound_manager.h:363) [-Wdeprecated-declarations]
- int sound_manager_set_active_route (sound_route_e route) DEPRECATED;// will be deprecated
- ^
-/usr/include/media/sound_manager.h:1043:1: warning: 'sound_device_in_e' is deprecated (declared at /usr/include/media/sound_manager.h:339) [-Wdeprecated-declarations]
- int sound_manager_get_active_device (sound_device_in_e *in, sound_device_out_e *out) DEPRECATED;// will be deprecated
- ^
-/usr/include/media/sound_manager.h:1043:1: warning: 'sound_device_out_e' is deprecated (declared at /usr/include/media/sound_manager.h:348) [-Wdeprecated-declarations]
-/usr/include/media/sound_manager.h:1052:1: warning: 'sound_route_e' is deprecated (declared at /usr/include/media/sound_manager.h:363) [-Wdeprecated-declarations]
- bool sound_manager_is_route_available (sound_route_e route) DEPRECATED;// will be deprecated
- ^
-/usr/include/media/sound_manager.h:1065:1: warning: 'sound_available_route_changed_cb' is deprecated [-Wdeprecated-declarations]
- int sound_manager_set_available_route_changed_cb (sound_available_route_changed_cb callback, void *user_data) DEPRECATED;// will be deprecated
- ^
-/usr/include/media/sound_manager.h:1084:1: warning: 'sound_active_device_changed_cb' is deprecated [-Wdeprecated-declarations]
- int sound_manager_set_active_device_changed_cb (sound_active_device_changed_cb callback, void *user_data);
- ^
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/src/settings_provider.c: In function '_get_int':
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/src/settings_provider.c:403:20: warning: unused variable 'index' [-Wunused-variable]
-  int status, size, index;
-                    ^
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/src/settings_provider.c:403:14: warning: unused variable 'size' [-Wunused-variable]
-  int status, size, index;
-              ^
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/src/settings_provider.c: At top level:
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/src/settings_provider.c:170:21: warning: 'sleeptimer_value' defined but not used [-Wunused-variable]
- static unsigned int sleeptimer_value[] = {
-                     ^
-/home/abuild/rpmbuild/BUILD/org.tizen.settings-tv-ref-0.1/src/settings_provider.c:313:12: warning: '_find_index' defined but not used [-Wunused-function]
- static int _find_index(unsigned int *array, int size, int val, int *index)
-            ^
-[100%] Building C object CMakeFiles/settings-tv-ref.dir/src/view_need_pwd.c.o
-Building C object CMakeFiles/settings-tv-ref.dir/src/timeout_handler.c.o
-Linking C executable settings-tv-ref
-[100%] Built target settings-tv-ref
-+ echo Build Done
-Build Done
index 3a17e42..38c0498 100644 (file)
@@ -8,6 +8,15 @@ class CNetConMgr {
 private:
        static CNetConMgr *instance;
        struct SNetConMgr *m;
+
+private:
+       static void sm_CbIpAddrChanged(const char *ipv4, const char *ipv6, void* data);
+       void m_OnIpAddrChanged(void *data);
+
+       static void sm_CbProfileStateChanged(connection_profile_state_e state, void *data);
+       bool m_GetEthernetProfile(void);
+       bool m_UpdateProfile(void);
+
 private:
        CNetConMgr(void) : m(0) {}
        virtual ~CNetConMgr() {}
@@ -17,12 +26,32 @@ public:
        static void Finalize(void);
        static CNetConMgr *GetInstance(void);
 
-       bool GetProfileInfo(connection_profile_h out_profile);
+       void RefreshEthernetProfile(void);
+       bool GetEthernetState(bool *state);
+
+       bool GetProfileName(char *out_name);
+       bool IsConnected(void);
+
+       bool SetIpConfType(connection_ip_config_type_e);
+       bool SetIpAddr(char *ip);
+       bool SetSubnetMask(char *submask);
+       bool SetGateway(char *gateway);
+       bool SetDNS(char *dns);
+
+       bool GetIpAddr(char *ip);
+       bool GetSubnetMask(char *submask);
+       bool GetGateway(char *gateway);
+       bool GetDNS(char *dns);
+
        bool SetProxyType(EProxyMethod method);
        bool GetProxyType(EProxyMethod *method);
        bool SetProxyAddr(char *ip);
        bool GetProxyAddr(char *ip);
+
        const char *GetErrorMsg(connection_error_e err);
+
+       bool RegisterIpChangedCallback(void(*ip_changed_cb)(bool change_state, void *data), void *data);
+
 };
 
 #endif /* __NETCONMGR_H__ */
index f53b0bc..2357079 100644 (file)
@@ -50,10 +50,10 @@ SET(SRCS
        src/network_viewmgr.cpp
        src/ip_setting_view.cpp
        src/vconf_mgr.cpp
-       src/connection_mgr.cpp
        src/util.cpp
        src/wifi_passcode_view.cpp
        ../src/WifiMgr.cpp
+       ../src/NetConMgr.cpp
 )
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
index 19f2c19..8f15b48 100644 (file)
@@ -17,7 +17,6 @@
 #ifndef __NETWORK_COMMON_H__
 #define __NETWORK_COMMON_H__
 
-#include <net_connection.h>
 #include <wifi.h>
 
 #define IP_STRING_MAX_SIZE 20
@@ -37,8 +36,6 @@ enum setting_mode {
 
 struct connection_info {
        enum network_type_enum cur_type;
-       connection_h connection;
-       connection_profile_h profile;
        char name[MAX_NAME_SIZE];
        wifi_ap_h ap;
 };
diff --git a/ug/network/include/connection_mgr.h b/ug/network/include/connection_mgr.h
deleted file mode 100644 (file)
index 32a9751..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CONNECTION_MGR_H__
-#define __CONNECTION_MGR_H__
-
-#include <Elementary.h>
-#include <net_connection.h>
-#include "common.h"
-
-int connection_mgr_set_profile(
-               connection_h connection,
-               connection_profile_h profile,
-               struct network_info *info);
-connection_h connection_mgr_create(void);
-int connection_mgr_destroy(connection_h connection);
-int connection_mgr_uninit(connection_h connection);
-int connection_mgr_get_profile_info(connection_h connection, struct connection_info *info);
-Eina_Bool connection_mgr_is_connected(connection_h connection);
-int connection_mgr_ip_dynamic_config(connection_h connection,connection_profile_h profile);
-int connection_mgr_get_ethernet_state(connection_h connection,Eina_Bool *plugin);
-int connection_mgr_get_ip_info(connection_profile_h profile,struct network_info *info);
-#if 0
-int connection_mgr_register_ethernet_state_cb(
-               connection_h connection,
-               connection_ethernet_state_chaged_cb cb, void *data);
-int connection_mgr_set_profile_state_changed_cb(
-               connection_profile_h profile,
-               connection_profile_state_changed_cb cb, void *data);
-int connection_mgr_get_is_online_async(
-               connection_h connection,
-               connection_is_online_async_cb cb, void *data);
-int connection_mgr_check_gateway_async(
-               connection_profile_h profile,
-               connection_profile_check_gateway_async_cb cb, void *data);
-#endif
-
-#endif /* __CONNECTION_MGR_H__ */
index 8b01e27..199007d 100644 (file)
 #ifndef __MAIN_VIEW_H__
 #define __MAIN_VIEW_H__
 
-#include <Elementary.h>
-#include <net_connection.h>
-#include <ui-gadget-module.h>
-#include "network_viewmgr.h"
-
 struct view_class *main_view_vclass_get(void);
 
 #endif /* __MAIN_VIEW_H__ */
index e3335c2..2d57b66 100644 (file)
@@ -18,7 +18,6 @@
 #define __VCONF_MGR_H__
 
 #include <vconf.h>
-#include "connection_mgr.h"
 #include "common.h"
 
 int vconf_mgr_get_network_type(enum network_type_enum *network_type);
diff --git a/ug/network/src/connection_mgr.cpp b/ug/network/src/connection_mgr.cpp
deleted file mode 100644 (file)
index f9da7c2..0000000
+++ /dev/null
@@ -1,650 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <Elementary.h>
-#include <aul.h>
-#include "defs.h"
-#include "dbg.h"
-#include "connection_mgr.h"
-
-/**
- * Converts the error type to string information.
- *
- * @param[in] err_type Error type
- * @return error string information;
- */
-static const char *_convert_error_to_string(connection_error_e err_type)
-{
-       _DBG("Not Yet");
-#if 0
-       switch (err_type) {
-       case CONNECTION_ERROR_NONE:
-               return "NONE";
-       case CONNECTION_ERROR_INVALID_PARAMETER:
-               return "INVALID_PARAMETER";
-       case CONNECTION_ERROR_OUT_OF_MEMORY:
-               return "OUT_OF_MEMORY";
-       case CONNECTION_ERROR_INVALID_OPERATION:
-               return "INVALID_OPERATION";
-       case CONNECTION_ERROR_ADDRESS_FAMILY_NOT_SUPPORTED:
-               return "ADDRESS_FAMILY_NOT_SUPPORTED";
-       case CONNECTION_ERROR_OPERATION_FAILED:
-               return "OPERATION_FAILED";
-       case CONNECTION_ERROR_ITERATOR_END:
-               return "ITERATOR_END";
-       case CONNECTION_ERROR_NO_CONNECTION:
-               return "NO_CONNECTION";
-       case CONNECTION_ERROR_NOW_IN_PROGRESS:
-               return "NOW_IN_PROGRESS";
-       case CONNECTION_ERROR_ALREADY_EXISTS:
-               return "ALREADY_EXISTS";
-       case CONNECTION_ERROR_OPERATION_ABORTED:
-               return "OPERATION_ABORTED";
-       case CONNECTION_ERROR_DHCP_FAILED:
-               return "DHCP_FAILED";
-       case CONNECTION_ERROR_INVALID_KEY:
-               return "INVALID_KEY";
-       case CONNECTION_ERROR_NO_REPLY:
-               return "NO_REPLY";
-       case CONNECTION_ERROR_NO_KEYWORD:
-               return "NO_KEYWORD";
-       case CONNECTION_ERROR_TCP_RST:
-               return "RST_IN_TCP_RESPONSE";
-       case CONNECTION_ERROR_TCP_SYN_TIMEOUT:
-               return "TCP_SYN_TIMEOUT";
-       case CONNECTION_ERROR_OFFLINE:
-               return "CONNECTION_OFFLINE";
-       case CONNECTION_ERROR_NETWORK_MONITOR_FAILURE:
-               return "monitor failer";
-       case CONNECTION_ERROR_INVALID_GATEWAY:
-               return "invalid gateway";
-       case CONNECTION_ERROR_INVALID_MACADDRESS:
-               return "invalid mac addr";
-       default:
-               break;
-       }
-#endif
-
-       return "Unknown";
-}
-
-/**
- * Creates a handle for managing data connections.
- *
- * The handle must be released with connection_destroy().
- *
- * @return connetcion if the operation is successful; NULL if failed;
- */
-connection_h connection_mgr_create(void)
-{
-       int ret;
-       connection_h connection;
-
-       connection = NULL;
-       ret = connection_create(&connection);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("connection_create failed");
-               connection = NULL;
-       }
-
-       return connection;
-}
-
-/**
- * Destroys the connection handle.
- *
- * @param[in] connection The handle of the connection
- * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed;
- */
-int connection_mgr_destroy(connection_h connection)
-{
-       int ret;
-
-       if (!connection) {
-               _ERR("connection is NULL.");
-               return RET_FAILED;
-       }
-
-       ret = connection_destroy(connection);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("connection_destroy() failed.");
-               return RET_FAILED;
-       }
-
-       return RET_SUCCESS;
-}
-
-/**
- * Gets the ethernet profile information.
- *
- * Iterates all the profile in the connection, and gets the ethernet one.
- *
- * @param[in] connection The handle of the connection
- * @param[out] info The structure to store profile information
- * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed;
- */
-int connection_mgr_get_profile_info(
-               connection_h connection, struct connection_info *info)
-{
-       connection_profile_iterator_h iter;
-       connection_profile_h profile;
-       connection_profile_type_e type;
-       char *name;
-       int ret;
-
-       if (!info || !connection) {
-               _ERR("param is NULL.");
-               return RET_FAILED;
-       }
-
-       ret = connection_get_profile_iterator(connection,
-                       CONNECTION_ITERATOR_TYPE_REGISTERED, &iter);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("Fail to get profile iterator [%d]\n", ret);
-               return RET_FAILED;
-       }
-
-       while (connection_profile_iterator_has_next(iter)) {
-               profile = NULL;
-               if (connection_profile_iterator_next(iter,
-                               &profile) != CONNECTION_ERROR_NONE) {
-                       _ERR("Fail to get profile handle\n");
-                       return RET_FAILED;
-               }
-
-               if (!profile) {
-                       _ERR("get profile failed.");
-                       return RET_FAILED;
-               }
-
-               if (connection_profile_get_type(profile,
-                               &type) != CONNECTION_ERROR_NONE) {
-                       _ERR("Fail to get profile type\n");
-                       return RET_FAILED;
-               }
-
-               name = NULL;
-               if (connection_profile_get_name(profile,
-                               &name) != CONNECTION_ERROR_NONE) {
-                       _ERR("Fail to get profile name\n");
-                       return RET_FAILED;
-               }
-
-               if (!name) {
-                       _ERR("get name failed.");
-                       return RET_FAILED;
-               }
-
-               if (type == CONNECTION_PROFILE_TYPE_ETHERNET) {
-                       strncpy(info->name, name, MAX_NAME_SIZE - 1);
-                       info->profile = profile;
-               }
-
-               free(name);
-       }
-
-       return RET_SUCCESS;
-}
-
-/**
- * Registers the callback called when the state of profile is changed.
- *
- * If the state of profile is changed, the registered callback will be called.
- *
- * @param[in] profile The handle of the profile
- * @param[in] cb The callback function to be called
- * @param[in] data User data
- * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed;
- */
-#if 0
-int connection_mgr_set_profile_state_changed_cb(
-               connection_profile_h profile,
-               connection_profile_state_changed_cb cb, void *data)
-{
-       int ret;
-
-       if (!profile || !cb || !data) {
-               _ERR("the param is invalid.");
-               return RET_FAILED;
-       }
-
-       ret = connection_profile_set_state_changed_cb(profile,
-                       cb, data);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("connection_profile_set_state_changed_cb() failed.");
-               return RET_FAILED;
-       }
-
-       return RET_SUCCESS;
-}
-#endif
-
-/**
- * Gets the state of the connection.
- *
- * @param[in] connection The handle of the connection
- * @return EINA_TRUE if the connection is OK; EINA_FALSE otherwise;
- */
-Eina_Bool connection_mgr_is_connected(connection_h connection)
-{
-       int ret;
-       connection_ethernet_state_e state;
-
-       if (!connection) {
-               _ERR("the connection is NULL.");
-               return EINA_FALSE;
-       }
-
-       ret = connection_get_ethernet_state(connection, &state);
-       if (ret == CONNECTION_ERROR_NONE &&
-                       state == CONNECTION_ETHERNET_STATE_CONNECTED)
-               return EINA_TRUE;
-
-       return EINA_FALSE;
-}
-
-/**
- * Sets the profile information.
- *
- * Sets the network information to profile.
- *
- * @param[in] connection The handle of the connection
- * @param[in] profile The handle of the profile
- * @param[in] info Network information
- * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed;
- */
-int connection_mgr_set_profile(connection_h connection,
-               connection_profile_h profile,
-               struct network_info *info)
-{
-       int ret;
-
-       if (!connection || !profile || !info) {
-               _ERR("the param is invalid.");
-               return RET_FAILED;
-       }
-
-       ret = connection_update_profile(connection, profile);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("connection_update_profile failed.\n");
-               return RET_FAILED;
-       }
-
-       ret = connection_profile_set_ip_config_type(profile,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       CONNECTION_IP_CONFIG_TYPE_STATIC);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("connection_profile_set_ip_config_type() failed.");
-               return RET_FAILED;
-       }
-
-       ret = connection_profile_set_ip_address(profile,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       info->ip_addr);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("connection_profile_set_ip_address() failed.");
-               return RET_FAILED;
-       }
-
-       ret = connection_profile_set_subnet_mask(profile,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       info->submask);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("fail to set_subnet_mask %d\n" , ret);
-               return RET_FAILED;
-       }
-
-       ret = connection_profile_set_gateway_address(profile,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       info->gateway);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("fail to set_gateway_address %d\n" , ret);
-               return RET_FAILED;
-       }
-
-       ret = connection_profile_set_dns_address(profile, 1,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       info->dns);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("fail to set_dns_address %d\n" , ret);
-               return RET_FAILED;
-       }
-
-       ret = connection_update_profile(connection, profile);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("connection_update_profile failed.\n");
-               return RET_FAILED;
-       }
-
-       return RET_SUCCESS;
-}
-
-/**
- * Gets whether the profile can access to the internet asynchronously.
- *
- * The result will return in the registered callback.
- *
- * @param[in] connection The handle of the connection
- * @param[in] cb The callback function to be called
- * @param[in] data User data
- * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed;
- */
-#if 0
-int connection_mgr_get_is_online_async(
-               connection_h connection,
-               connection_is_online_async_cb cb, void *data)
-{
-       int ret;
-
-       if (!connection || !cb || !data) {
-               _ERR("the param is invalid.");
-               return RET_FAILED;
-       }
-
-       ret = connection_get_is_online_async(connection, cb, data);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("connection_get_is_online_async() failed.");
-               return RET_FAILED;
-       }
-
-       return RET_SUCCESS;
-}
-#endif
-
-/**
- * Validates gateway address set for Ethernet Asynchronusly.
- *
- * The result will return in the registered callback.
- *
- * @param[in] profile The handle of the profile
- * @param[in] cb The callback function to be called
- * @param[in] data User data
- * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed;
- */
-#if 0
-int connection_mgr_check_gateway_async(
-               connection_profile_h profile,
-               connection_profile_check_gateway_async_cb cb, void *data)
-{
-       int ret;
-
-       if (!profile || !cb || !data) {
-               _ERR("the param is invalid.");
-               return RET_FAILED;
-       }
-
-       ret = connection_profile_check_gateway_async(profile, cb, data);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("connection_get_is_online_async() failed.");
-               return RET_FAILED;
-       }
-
-       return RET_SUCCESS;
-}
-#endif
-
-/**
- * Sets the IP config type into dynamic.
- *
- * Called when the profile need getting IP dynamically.
- *
- * @param[in] connection The handle of the connection
- * @param[in] profile The handle of the profile
- * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed;
- */
-int connection_mgr_ip_dynamic_config(
-               connection_h connection,
-               connection_profile_h profile)
-{
-       int ret;
-
-       if (!connection || !profile) {
-               _ERR("The param is invalid.\n");
-               return RET_FAILED;
-       }
-
-       ret = connection_update_profile(connection, profile);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("connection_update_profile failed, ret: %s.\n",
-                               _convert_error_to_string((connection_error_e) ret));
-               return RET_FAILED;
-       }
-
-       ret = connection_profile_set_ip_config_type(profile,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       CONNECTION_IP_CONFIG_TYPE_DYNAMIC);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("Fail to set ip method type[%s]\n",
-                               _convert_error_to_string((connection_error_e) ret));
-               return RET_FAILED;
-       }
-
-       ret = connection_update_profile(connection, profile);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("connection_update_profile failed, ret: %s.\n",
-                               _convert_error_to_string((connection_error_e) ret));
-               return RET_FAILED;
-       }
-
-       return RET_SUCCESS;
-}
-
-/**
- * Registers callback for ethernet cable.
- *
- * Including  cable plugged [in/out] event.
- *
- * @param[in] connection The handle of the connection
- * @param[in] cb The callback function to be called
- * @param[in] data User data
- * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed;
- */
-#if 0
-int connection_mgr_register_ethernet_state_cb(
-               connection_h connection,
-               connection_ethernet_state_chaged_cb cb, void *data)
-{
-       int ret;
-
-       if (!connection || !cb || !data) {
-               _ERR("the param is invalid.");
-               return RET_FAILED;
-       }
-
-       ret = connection_set_ethernet_state_chaged_cb(connection, cb, data);
-       if (ret != RET_SUCCESS) {
-               _ERR("connection_set_ethernet_state_chaged_cb() failed.");
-               return RET_FAILED;
-       }
-
-       return RET_SUCCESS;
-}
-#endif
-
-/**
- * Gets the state of ethernet.
- *
- * The returned state is for the ethernet connection state.
- *
- * @param[in] connection The handle of the connection
- * @param[out] plugin The cable plugged state
- * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed;
- */
-int connection_mgr_get_ethernet_state(
-               connection_h connection, Eina_Bool *plugin)
-{
-       int ret;
-       connection_ethernet_state_e state;
-
-       if (!connection || !plugin) {
-               _ERR("the param is invalid.");
-               return RET_FAILED;
-       }
-
-       ret = connection_get_ethernet_state(connection, &state);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("connection_get_ethernet_state() failed.");
-               return RET_FAILED;
-       }
-
-       if (state == CONNECTION_ETHERNET_STATE_DEACTIVATED)
-               *plugin = EINA_FALSE;
-       else
-               *plugin = EINA_TRUE;
-
-       return RET_SUCCESS;
-}
-
-/**
- * Sets the network information.
- *
- * Including IP, submask and gateway.
- *
- * @param[in] profile The handle of the profile
- * @param[in] info The structure of network
- * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed;
- */
-int connection_mgr_set_ip_config(
-               connection_profile_h profile,
-               struct network_info *info)
-{
-       int ret;
-
-       if (!profile || !info) {
-               _ERR("the param is invalid.");
-               return RET_FAILED;
-       }
-
-       ret = connection_profile_set_ip_address(profile,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       info->ip_addr);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("set ip address fail, ret: %s\n",
-                               _convert_error_to_string((connection_error_e) ret));
-               return RET_FAILED;
-       }
-
-       ret = connection_profile_set_subnet_mask(profile,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       info->submask);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("set subnet mask fail. %s\n",
-                               _convert_error_to_string((connection_error_e) ret));
-               return RET_FAILED;
-       }
-
-       ret = connection_profile_set_gateway_address(profile,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       info->gateway);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("set gateway address fail %s\n",
-               _convert_error_to_string((connection_error_e) ret));
-               return RET_FAILED;
-       }
-
-       return RET_SUCCESS;
-}
-
-/**
- * Sets the DNS.
- *
- * @param[in] profile The handle of the profile
- * @param[in] info The structure of network
- * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed;
- */
-int connection_mgr_set_dns_config(
-               connection_profile_h profile,
-               struct network_info *info)
-{
-       int ret;
-
-       if (!profile || !info) {
-               _ERR("the param is invalid.");
-               return RET_FAILED;
-       }
-
-       ret = connection_profile_set_dns_address(profile, 1,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       info->dns);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("set dns address fail %d\n",
-                               _convert_error_to_string((connection_error_e) ret));
-               return RET_FAILED;
-       }
-
-       return RET_SUCCESS;
-}
-
-/**
- * Gets the network information.
- *
- * @param[in] profile The handle of the profile
- * @param[out] info The structure of network
- * @return RET_SUCCESS if the operation is successful; RET_FAILED if failed;
- */
-int connection_mgr_get_ip_info(
-               connection_profile_h profile,
-               struct network_info *info)
-{
-       char *str_value;
-
-       if (!profile || !info) {
-               _ERR("the param is invalid.");
-               return RET_FAILED;
-       }
-
-       if (connection_profile_get_ip_address(profile,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       &str_value) != CONNECTION_ERROR_NONE) {
-               _ERR("Fail to get IP address!\n");
-               strncpy(info->ip_addr, ZERO_IP, IP_STRING_MAX_SIZE);
-       } else {
-               strncpy(info->ip_addr, str_value, IP_STRING_MAX_SIZE);
-               free(str_value);
-       }
-
-       if (connection_profile_get_subnet_mask(profile,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       &str_value) != CONNECTION_ERROR_NONE) {
-               _ERR("Fail to get subnet mask!\n");
-               strncpy(info->submask, ZERO_IP, IP_STRING_MAX_SIZE);
-       } else {
-               strncpy(info->submask, str_value, IP_STRING_MAX_SIZE);
-               free(str_value);
-       }
-
-       if (connection_profile_get_gateway_address(profile,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       &str_value) != CONNECTION_ERROR_NONE) {
-               _ERR("Fail to get gateway!\n");
-               strncpy(info->gateway, ZERO_IP, IP_STRING_MAX_SIZE);
-       } else {
-               strncpy(info->gateway, str_value, IP_STRING_MAX_SIZE);
-               free(str_value);
-       }
-
-       if (connection_profile_get_dns_address(profile, 1,
-                       CONNECTION_ADDRESS_FAMILY_IPV4,
-                       &str_value) != CONNECTION_ERROR_NONE) {
-               _ERR("Fail to get DNS1!\n");
-               strncpy(info->dns, ZERO_IP, IP_STRING_MAX_SIZE);
-       } else {
-               strncpy(info->dns, str_value, IP_STRING_MAX_SIZE);
-               free(str_value);
-       }
-
-       return RET_SUCCESS;
-}
index 458a88b..481e90a 100644 (file)
@@ -28,6 +28,7 @@
 #include "util.h"
 
 #include "WifiMgr.h"
+#include "NetConMgr.h"
 
 #define KEY_PRIV "priv"
 
@@ -90,14 +91,12 @@ struct _priv {
        enum connection_setting_enum cur_type;
        enum network_type_enum network_type;
 
-       connection_h connection;
-       connection_profile_h profile;
-
        wifi_ap_h ap;
 
        char name[MAX_NAME_SIZE];
 
        CWifiMgr *pWifiMgr;
+       CNetConMgr *pNetConMgr;
 };
 
 static void _show_confirm_popup(struct _priv *priv);
@@ -274,21 +273,17 @@ static int _get_cur_mode(struct _priv *priv)
 static int _get_connection_profile_info(struct _priv  *priv)
 {
        struct connection_info info;
-       int ret;
 
        if (!priv) {
                _ERR("the param is invalid.");
                return RET_FAILED;
        }
 
-       ret = connection_mgr_get_profile_info(priv->connection, &info);
-       if (ret != RET_SUCCESS) {
+       if(!priv->pNetConMgr->GetProfileName(info.name)) {
                _ERR("connection_mgr_get_profile_info() failed.");
                return RET_FAILED;
        }
 
-       priv->profile = info.profile;
-
        return RET_SUCCESS;
 }
 
@@ -319,10 +314,21 @@ static int _get_cur_ip_info(struct _priv *priv)
 
        if (priv->network_type == TYPE_WIRED) {
                if (priv->ip_mode == MODE_AUTO) {
-                       ret = connection_mgr_get_ip_info(priv->profile, &info);
-                       if (ret != RET_SUCCESS) {
+                       if (!priv->pNetConMgr->GetIpAddr(info.ip_addr)) {
                                _ERR("connection_mgr_get_ip_info() failed.");
-                               return ret;
+                               return RET_FAILED;
+                       }
+                       if (!priv->pNetConMgr->GetSubnetMask(info.submask)) {
+                               _ERR("connection_mgr_get_ip_info() failed.");
+                               return RET_FAILED;
+                       }
+                       if (!priv->pNetConMgr->GetGateway(info.gateway)) {
+                               _ERR("connection_mgr_get_ip_info() failed.");
+                               return RET_FAILED;
+                       }
+                       if (!priv->pNetConMgr->GetDNS(info.dns)) {
+                               _ERR("connection_mgr_get_ip_info() failed.");
+                               return RET_FAILED;
                        }
                } else if (priv->ip_mode == MODE_MAN) {
                        ret = vconf_mgr_get_wired_network_info(&info);
@@ -2063,9 +2069,19 @@ static int  _config_network_manually(struct _priv *priv)
 
        switch (priv->network_type) {
        case TYPE_WIRED:
-               ret = connection_mgr_set_profile(priv->connection,
-                               priv->profile, &priv->info);
-               if (ret != RET_SUCCESS) {
+               if (!priv->pNetConMgr->SetIpAddr(priv->info.ip_addr)) {
+                       _ERR("set profile failed.");
+                       return ret;
+               }
+               if (!priv->pNetConMgr->SetSubnetMask(priv->info.submask)) {
+                       _ERR("set profile failed.");
+                       return ret;
+               }
+               if (!priv->pNetConMgr->SetGateway(priv->info.gateway)) {
+                       _ERR("set profile failed.");
+                       return ret;
+               }
+               if (!priv->pNetConMgr->SetDNS(priv->info.dns)) {
                        _ERR("set profile failed.");
                        return ret;
                }
@@ -2135,9 +2151,7 @@ static int  _config_network_dynamic(struct _priv *priv)
 
        switch (priv->network_type) {
        case TYPE_WIRED:
-               ret = connection_mgr_ip_dynamic_config(priv->connection,
-                               priv->profile);
-               if (ret != RET_SUCCESS) {
+               if(!priv->pNetConMgr->SetIpConfType(CONNECTION_IP_CONFIG_TYPE_DYNAMIC)) {
                        _ERR("connection_mgr_ip_dynamic_config() failed.");
                        return RET_FAILED;
                }
@@ -2561,8 +2575,10 @@ static Evas_Object *_create(struct viewmgr *vmgr, void *data)
        priv->ug = vmgr->ug;
        priv->vmgr = vmgr;
 
+       priv->pNetConMgr = CNetConMgr::GetInstance();
+       ASSERT(priv->pNetConMgr);
+
        info = (struct connection_info *) data;
-       priv->connection = info->connection;
        priv->network_type = info->cur_type;
        priv->ap = info->ap;
        strncpy(priv->name, info->name, MAX_NAME_SIZE - 1);
index 4effc56..3837878 100644 (file)
 #include "main_view.h"
 #include "vconf_mgr.h"
 #include "ip_setting_view.h"
-#include "connection_mgr.h"
 #include "i18n.h"
 #include "common.h"
 #include "wifi_passcode_view.h"
 #include "util.h"
 
 #include "WifiMgr.h"
+#include "NetConMgr.h"
 
 #define BTN_ACT 4
 #define BTN_TYPE 2
@@ -81,8 +81,6 @@ struct _priv {
        Eina_Bool wifi_conn;
        Eina_Bool wired_conn;
 
-       connection_h connection;
-       connection_profile_h profile;
        char profile_name[MAX_NAME_SIZE];
 
        wifi_ap_h ap;
@@ -90,6 +88,7 @@ struct _priv {
        char *ap_pwd;
 
        CWifiMgr *pWifiMgr;
+       CNetConMgr *pNetConMgr;
 };
 
 static void _show_confirm_popup(struct _priv *priv);
@@ -145,7 +144,10 @@ static void _fini_priv(struct _priv *priv)
        if (priv->timer)
                ecore_timer_del(priv->timer);
 
-       connection_mgr_destroy(priv->connection);
+       if(priv->pNetConMgr) {
+               CNetConMgr::Finalize();
+               priv->pNetConMgr = NULL;
+       }
 
        if (priv->ap)
        {
@@ -503,34 +505,6 @@ static void _set_action_btn_pos(struct _priv  *priv)
 }
 
 /**
-* Get the connection profile infomation
-*
-* @param[in] priv _priv object bypassed
-* @return 0 on success,otherwise -1
-*/
-static int _get_connection_profile_info(struct _priv  *priv)
-{
-       struct connection_info info;
-       int ret;
-
-       if (!priv) {
-               _ERR("the param is invalid.");
-               return RET_FAILED;
-       }
-
-       ret = connection_mgr_get_profile_info(priv->connection, &info);
-       if (ret != RET_SUCCESS) {
-               _ERR("connection_mgr_get_profile_info() failed.");
-               return RET_FAILED;
-       }
-
-       priv->profile = info.profile;
-       strncpy(priv->profile_name, info.name, MAX_NAME_SIZE - 1);
-
-       return RET_SUCCESS;
-}
-
-/**
 * Callback function to set content to list panel
 *
 * Depending on different ethernet, set corresponding connection state
@@ -538,9 +512,7 @@ static int _get_connection_profile_info(struct _priv  *priv)
 *
 * @param[in] priv _priv object bypassed
 */
-#if 0
-static void _connection_ethernet_state_callback(
-               connection_ethernet_cable_state_e state, void *data)
+static void _connection_ethernet_state_callback(bool state, void *data)
 {
        struct _priv *priv;
 
@@ -549,16 +521,16 @@ static void _connection_ethernet_state_callback(
                return;
        }
 
-       priv = data;
+       priv = (struct _priv *) data;
 
        if (priv->network_type != TYPE_WIRED) {
                _ERR("cur network type is wireless, return.");
                return;
        }
 
-       if (state == CONNECTION_ETHERNET_CABLE_ATTACHED) {
+       if (state == true) { // ethernet connected
                _fill_content_part(priv, priv->wired_con_box);
-       } else if (state == CONNECTION_ETHERNET_CABLE_DETACHED) {
+       } else {
                _fill_content_part(priv, priv->wired_discon_ly);
 
                priv->wired_conn = EINA_FALSE;
@@ -566,7 +538,6 @@ static void _connection_ethernet_state_callback(
 
        _set_action_btn_pos(priv);
 }
-#endif
 
 /**
 * Initialize the connection information
@@ -576,33 +547,29 @@ static void _connection_ethernet_state_callback(
 */
 static int _init_connection(struct _priv  *priv)
 {
-       int ret = RET_FAILED;
-
        if (!priv) {
                _ERR("the param is invalid.");
                return RET_FAILED;
        }
 
-       priv->connection = connection_mgr_create();
-       if (!priv->connection) {
-               _ERR("connection_mgr_create() failed.");
+       if(!CNetConMgr::Initialize()) {
+               _ERR("the param is invalid.");
                return RET_FAILED;
        }
 
-#if 0
-       ret = connection_mgr_register_ethernet_state_cb
-                       (priv->connection,
-                       _connection_ethernet_state_callback,
-                       priv);
-       if (ret != RET_SUCCESS) {
-               _ERR("register_ethernet_state_cb() failed.");
+       priv->pNetConMgr = CNetConMgr::GetInstance();
+       if (!priv->pNetConMgr) {
+               _ERR("Fail to get instance");
                return RET_FAILED;
        }
-#endif
 
-       ret = _get_connection_profile_info(priv);
-       if (ret != RET_SUCCESS) {
-               _ERR("_get_connection_profile_info() failed.");
+       if(!priv->pNetConMgr->GetProfileName(priv->profile_name)) {
+               _ERR("Fail to get instance");
+               return RET_FAILED;
+       }
+
+       if(!priv->pNetConMgr->RegisterIpChangedCallback( _connection_ethernet_state_callback, priv)) {
+               _ERR("register_ethernet_state_cb() failed.");
                return RET_FAILED;
        }
 
@@ -731,8 +698,7 @@ static int _create_wired_connect_part(struct _priv *priv)
 */
 static int _display_wired_setting(struct _priv  *priv)
 {
-       Eina_Bool plugin;
-       int ret;
+       bool plugin;
 
        if (!priv) {
                _ERR("the param is invalid.");
@@ -743,11 +709,9 @@ static int _display_wired_setting(struct _priv  *priv)
 
        _create_wired_disconnect_part(priv);
 
-       ret = connection_mgr_get_ethernet_state(priv->connection,
-                       &plugin);
-       if (ret != RET_SUCCESS) {
+       if(!priv->pNetConMgr->GetEthernetState(&plugin)) {
                _ERR("connection_mgr_get_ethernet_state() failed.");
-               plugin = EINA_FALSE;
+               plugin = false;
        }
 
        if (plugin) {
@@ -1721,9 +1685,7 @@ static const char *_convert_error_to_string(connection_error_e err_type)
 * @param[in] result the connection error type
 * @param[in] data the user data
 */
-#if 0
-static void _connection_get_is_online_async_cb(
-               connection_error_e result, void *data)
+static void _connection_get_is_online_async_cb(        bool state, void *data)
 {
        struct _priv *priv;
 
@@ -1732,11 +1694,10 @@ static void _connection_get_is_online_async_cb(
                return;
        }
 
-       priv = data;
+       priv = (struct _priv *) data;
 
-       if (result != CONNECTION_ERROR_NONE) {
-               _ERR("connection result: %s.",
-                               _convert_error_to_string(result));
+       if (state != true) {
+               _ERR("connection result");
                _show_confirm_popup(priv);
        } else {
                ug_destroy_me(priv->ug);
@@ -1749,34 +1710,29 @@ static void _connection_get_is_online_async_cb(
 * @param[in] result the connection error type
 * @param[in] data the user data
 */
-static void _connection_check_gateway_async_cb(
-               connection_error_e result, void *data)
+static void _connection_check_gateway_async_cb(bool state, void *data)
 {
        struct _priv *priv;
-       int ret;
+       bool ret;
 
        if (!data) {
                _ERR("the param is invalid.");
                return;
        }
 
-       priv = data;
+       priv = (struct _priv *) data;
 
-       if (result != CONNECTION_ERROR_NONE) {
-               _ERR("connection result: %s.",
-                               _convert_error_to_string(result));
+       if (state != true) {
+               _ERR("connection disconnected");
                _show_confirm_popup(priv);
        } else {
-               ret = connection_mgr_get_is_online_async(priv->connection,
-                               _connection_get_is_online_async_cb,
-                               (void *)priv);
-               if (ret != RET_SUCCESS) {
+               ret = priv->pNetConMgr->RegisterIpChangedCallback( _connection_get_is_online_async_cb, (void *)priv);
+               if (ret != true) {
                        _ERR("connection_mgr_get_is_online_async() failed.");
                        return;
                }
        }
 }
-#endif
 
 /**
 * Write the connection information saved last time to the profile
@@ -1801,12 +1757,12 @@ static int _connection_set_last_network(struct _priv *priv)
                return ret;
        }
 
+       bool result =  false;
        if (ip_mode == MODE_AUTO) {
-               ret = connection_mgr_ip_dynamic_config(priv->connection,
-                               priv->profile);
-               if (ret != RET_SUCCESS) {
+               result = priv->pNetConMgr->SetIpConfType(CONNECTION_IP_CONFIG_TYPE_DYNAMIC);
+               if (result != true) {
                        _ERR("connection_mgr_ip_dynamic_config() failed.");
-                       return ret;
+                       return RET_FAILED;
                }
        } else {
                ret = vconf_mgr_get_wired_network_info(&info);
@@ -1814,13 +1770,6 @@ static int _connection_set_last_network(struct _priv *priv)
                        _ERR("vconf_mgr_get_wired_network_info() failed.");
                        return ret;
                }
-
-               ret = connection_mgr_set_profile(priv->connection,
-                               priv->profile, &info);
-               if (ret != RET_SUCCESS) {
-                       _ERR("set profile failed.");
-                       return ret;
-               }
        }
 
        return RET_SUCCESS;
@@ -1843,7 +1792,11 @@ static int _wired_connect_proc(struct _priv *priv)
 
        _show_progress_popup(priv);
 
-       _get_connection_profile_info(priv);
+       priv->pNetConMgr->RefreshEthernetProfile();
+       if(!priv->pNetConMgr->GetProfileName(priv->profile_name)) {
+               _ERR("Fail to get profile name");
+               return RET_FAILED;
+       }
 
        ret = _connection_set_last_network(priv);
        if (ret != RET_SUCCESS) {
@@ -1851,15 +1804,12 @@ static int _wired_connect_proc(struct _priv *priv)
                return ret;
        }
 
-       _DBG("Not Yet");
-#if 0
-       ret = connection_mgr_check_gateway_async(priv->profile,
-                       _connection_check_gateway_async_cb, (void *)priv);
-       if (ret != RET_SUCCESS) {
+       bool result = false;
+       result = priv->pNetConMgr->RegisterIpChangedCallback( _connection_check_gateway_async_cb, (void *)priv);
+       if (result != true) {
                _ERR("connection_mgr_get_is_online_async() failed.");
-               return ret;
+               return RET_FAILED;
        }
-#endif
 
        return RET_SUCCESS;
 }
@@ -2237,7 +2187,6 @@ static void _other_btn_clicked_cb(void *data,
        priv->cur_view = NETWORK_IP_SETTING_VIEW;
 
        info.cur_type = priv->network_type;
-       info.connection = priv->connection;
 
        if (priv->network_type == TYPE_WIRED) {
                strncpy(info.name, priv->profile_name,
diff --git a/ug/proxy/include/common.h b/ug/proxy/include/common.h
deleted file mode 100644 (file)
index ceaf2dc..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __PROXY_COMMON_H__
-#define __PROXY_COMMON_H__
-
-#define MOTHED_STRING_LEN 15
-#define IP_STRING_LEN 15
-#define MOTHED_URL_LEN 100
-#define STRING_MAX_LEN 100
-#define METHOD_NUM 3
-
-#define IP_ZERO "0.0.0.0"
-#define URL_BLANK ""
-
-#endif /* __PROXY_COMMON_H__ */
index abfcb00..576cebd 100644 (file)
 #ifndef __DEFS_H__
 #define __DEFS_H__
 
+/* Common */
+#define MOTHED_STRING_LEN 15
+#define IP_STRING_LEN 15
+#define MOTHED_URL_LEN 100
+#define STRING_MAX_LEN 100
+#define METHOD_NUM 3
+
+#define IP_ZERO "0.0.0.0"
+#define URL_BLANK ""
+
 #define ELM_SCALE elm_config_scale_get()
 
 #define RET_SUCCESS 0
index 8f7a1f4..c6e8170 100644 (file)
@@ -17,8 +17,6 @@
 #ifndef __MAIN_VIEW_H__
 #define __MAIN_VIEW_H__
 
-#include <Elementary.h>
-
 Evas_Object *create_main_view(Evas_Object *win, ui_gadget_h ug);
 void destroy_main_view(Evas_Object *base);
 
index 6db110d..510f151 100644 (file)
@@ -22,7 +22,6 @@
 #include "main_view.h"
 #include "i18n.h"
 #include "util.h"
-#include "common.h"
 
 #include "UgCommon.h"
 #include "WifiMgr.h"
index 68e96a3..cefce3d 100644 (file)
 #include "dbg.h"
 #include "NetConMgr.h"
 
+#define IP_STRING_MAX_SIZE 20
+#define MAX_NAME_SIZE 256
+#define CONTENT_TXT_SIZE 500
+#define ZERO_IP "0.0.0.0"
+
 CNetConMgr *CNetConMgr::instance = NULL;
 
 struct SNetConMgr {
        connection_h handle;
+       connection_profile_h ethernet_profile_h;
+       void(*ip_changed_cb)(bool change_state, void *data);
 };
 
+
+void CNetConMgr::sm_CbIpAddrChanged(const char *ipv4, const char *ipv6, void* data)
+{
+       _DBG("IP addr is changed!! [IPv4:%s] [IPv6:%s]", ipv4, ipv6);
+
+       CNetConMgr::GetInstance()->m_OnIpAddrChanged(data);
+}
+
+
+void CNetConMgr::m_OnIpAddrChanged(void *data)
+{
+       if(m->ip_changed_cb)
+               m->ip_changed_cb(true, data);
+}
+
+
+void CNetConMgr::sm_CbProfileStateChanged(connection_profile_state_e state, void *data)
+{
+
+       _DBG("Profile is changed!!!!!!!!!!!!!!!!!!!!!!!!!");
+
+       /* TODO : check the flow again */
+       CNetConMgr::GetInstance()->RefreshEthernetProfile();
+}
+
+
+bool CNetConMgr::m_GetEthernetProfile(void)
+{
+       ASSERT(m);
+
+       connection_profile_iterator_h iter = NULL;
+       connection_profile_h profile = NULL;
+       connection_profile_type_e type;
+
+       int ret;
+       char name[MAX_NAME_SIZE] = {0};
+
+       ret = connection_get_profile_iterator(m->handle, CONNECTION_ITERATOR_TYPE_REGISTERED, &iter);
+       if (ret != CONNECTION_ERROR_NONE) {
+               _ERR("Fail to get profile iterator: %s", GetErrorMsg((connection_error_e) ret));
+               return false;
+       }
+
+       /* TODO : check whether to use do ~ while */
+       while (connection_profile_iterator_has_next(iter)) {
+               if (connection_profile_iterator_next(iter, &profile) != CONNECTION_ERROR_NONE) {
+                       _ERR("Fail to get profile handle");
+                       return false;
+               }
+
+               ASSERT(profile); /* weird, profile should be existed */
+
+               if (connection_profile_get_type(profile, &type) != CONNECTION_ERROR_NONE) {
+                       _ERR("Fail to get profile type");
+                       return false;
+               }
+
+               if (type == CONNECTION_PROFILE_TYPE_ETHERNET)
+               {
+                       /* FIXME : should check when tere are many same profiles. */
+                       m->ethernet_profile_h = profile;
+                       GetProfileName(name);
+                       _DBG("GetProfileName = %s", name);
+               }
+       }
+
+       ret = connection_destroy_profile_iterator(iter);
+       if (ret != CONNECTION_ERROR_NONE) {
+               _ERR("Fail to get profile iterator: %s", GetErrorMsg((connection_error_e) ret));
+               return false;
+       }
+
+       /* FIXME:API return wrong parameter */
+       ret = connection_profile_set_state_changed_cb( m->ethernet_profile_h, sm_CbProfileStateChanged, (void *)instance);
+       if (ret != CONNECTION_ERROR_NONE) {
+               _ERR("connection_profile_set_state_changed_cb() failed.");
+               return false;
+       }
+
+       return true;
+}
+
+
+bool CNetConMgr::m_UpdateProfile(void)
+{
+       ASSERT(m);
+
+       int ret = -1;
+
+       ret = connection_update_profile( m->handle, m->ethernet_profile_h);
+       if (ret != CONNECTION_ERROR_NONE) {
+               _ERR("connection_update_profile failed");
+               return false;
+       }
+
+       return true;
+}
+
+
 bool CNetConMgr::Initialize(void)
 {
        ASSERT(!instance);
@@ -21,7 +127,6 @@ bool CNetConMgr::Initialize(void)
        if(!instance->m) {
                _ERR("Fail to allocate memory");
                delete (instance);
-               instance = NULL;
                return false;
        }
 
@@ -35,13 +140,19 @@ bool CNetConMgr::Initialize(void)
                return false;
        }
 
+       if(!instance->m_GetEthernetProfile()) {
+               _ERR("Fail to get ethernet_profile");
+       }
+
        return true;
 }
 
 
 void CNetConMgr::Finalize(void)
 {
-       ASSERT(instance);
+       if(!instance)
+               return;
+
        ASSERT(instance->m);
 
        int ret = 0;
@@ -62,66 +173,275 @@ CNetConMgr *CNetConMgr::GetInstance(void)
 }
 
 
-bool CNetConMgr::GetProfileInfo(connection_profile_h out_profile)
+void CNetConMgr::RefreshEthernetProfile(void)
 {
        ASSERT(m);
 
-       connection_profile_iterator_h iter = NULL;
-       connection_profile_h profile = NULL;
-       connection_profile_type_e type;
+       if(!m_GetEthernetProfile()) {
+               _ERR("Fail to get ethernet_profile");
+       }
+}
+
+
+bool CNetConMgr::GetEthernetState(bool *out_state)
+{
+       ASSERT(m);
+
+       int ret = -1;
+       connection_ethernet_state_e state;
+
+       if (!out_state) {
+               _ERR("the param is invalid.");
+               return false;
+       }
+
+       ret = connection_get_ethernet_state(m->handle, &state);
+       if (ret != CONNECTION_ERROR_NONE) {
+               _ERR("connection_get_ethernet_state() failed.");
+               return false;
+       }
+
+       if (state == CONNECTION_ETHERNET_STATE_DEACTIVATED)
+               *out_state = false;
+       else
+               *out_state = true;
+
+       return true;
+}
+
+
+bool CNetConMgr::GetProfileName(char *out_name)
+{
+       ASSERT(m);
 
        char *name;
-       int ret;
 
-       if (!out_profile) {
-               _ERR("param is NULL.");
+       if(!m->ethernet_profile_h) {
+               _ERR("There is no ethernet profile Try to call RefreshEthernetProfile()");
                return false;
        }
 
-       ret = connection_get_profile_iterator(m->handle, CONNECTION_ITERATOR_TYPE_REGISTERED, &iter);
+       if (connection_profile_get_name(m->ethernet_profile_h, &name) != CONNECTION_ERROR_NONE) {
+               _ERR("Fail to get profile name\n");
+               return false;
+       }
+
+       strncpy(out_name, name, MAX_NAME_SIZE - 1);
+
+       delete (name);
+}
+
+
+bool CNetConMgr::IsConnected(void)
+{
+       ASSERT(m);
+
+       int ret;
+       connection_ethernet_state_e state;
+
+       ret = connection_get_ethernet_state(m->handle, &state);
+       if (ret == CONNECTION_ERROR_NONE && state == CONNECTION_ETHERNET_STATE_CONNECTED)
+               return true;
+
+       return false;
+}
+
+
+bool CNetConMgr::SetIpConfType(connection_ip_config_type_e type)
+{
+       ASSERT(m);
+
+       if(!m_UpdateProfile()) return false;
+
+       int ret = -1;
+
+       ret = connection_profile_set_ip_config_type( m->ethernet_profile_h, CONNECTION_ADDRESS_FAMILY_IPV4, type);
        if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("Fail to get profile iterator: %s", GetErrorMsg((connection_error_e) ret));
+               _ERR("connection_profile_set_ip_config_type() failed.");
                return false;
        }
 
-       while (connection_profile_iterator_has_next(iter)) {
-               if (connection_profile_iterator_next(iter, &profile) != CONNECTION_ERROR_NONE) {
-                       _ERR("Fail to get profile handle");
-                       return false;
-               }
+       if(!m_UpdateProfile()) return false;
 
-               ASSERT(profile); /* weird */
+       return true;
+}
 
-               if (connection_profile_get_type(profile, &type) != CONNECTION_ERROR_NONE) {
-                       _ERR("Fail to get profile type");
-                       return false;
-               }
 
-               if (type == CONNECTION_PROFILE_TYPE_ETHERNET)
-                       out_profile = profile;
+bool CNetConMgr::SetIpAddr(char *ip)
+{
+       ASSERT(m);
+
+       if(!m_UpdateProfile()) return false;
+       if(!SetIpConfType(CONNECTION_IP_CONFIG_TYPE_STATIC)) return false;
+
+       int ret = -1;
+       ret = connection_profile_set_ip_address( m->ethernet_profile_h, CONNECTION_ADDRESS_FAMILY_IPV4, ip);
+       if (ret != CONNECTION_ERROR_NONE) {
+               _ERR("connection_profile_set_ip_address() failed.");
+               return false;
        }
 
-       /* TODO : should check when tere are many same profiles. */
+       if(!m_UpdateProfile()) return false;
 
        return true;
 }
 
 
-bool CNetConMgr::SetProxyType(EProxyMethod method)
+bool CNetConMgr::SetSubnetMask(char *submask)
 {
        ASSERT(m);
 
-       connection_profile_h profile = NULL;
-       connection_proxy_type_e type;
+       if(!m_UpdateProfile()) return false;
+       if(!SetIpConfType(CONNECTION_IP_CONFIG_TYPE_STATIC)) return false;
 
-       int ret;
+       int ret = -1;
+       ret = connection_profile_set_subnet_mask( m->ethernet_profile_h, CONNECTION_ADDRESS_FAMILY_IPV4, submask);
+       if (ret != CONNECTION_ERROR_NONE) {
+               _ERR("fail to set_subnet_mask");
+               return false;
+       }
+
+       if(!m_UpdateProfile()) return false;
+}
+
+
+bool CNetConMgr::SetGateway(char *gateway)
+{
+       ASSERT(m);
+
+       if(!m_UpdateProfile()) return false;
+       if(!SetIpConfType(CONNECTION_IP_CONFIG_TYPE_STATIC)) return false;
+
+       int ret = -1;
+       ret = connection_profile_set_gateway_address( m->ethernet_profile_h, CONNECTION_ADDRESS_FAMILY_IPV4, gateway);
+       if (ret != CONNECTION_ERROR_NONE) {
+               _ERR("fail to set_gateway_address");
+               return false;
+       }
+
+       if(!m_UpdateProfile()) return false;
+}
+
+
+bool CNetConMgr::SetDNS(char *dns)
+{
+       ASSERT(m);
 
-       ret = GetProfileInfo(profile);
+       if(!m_UpdateProfile()) return false;
+       if(!SetIpConfType(CONNECTION_IP_CONFIG_TYPE_STATIC)) return false;
+
+       int ret = -1;
+       ret = connection_profile_set_dns_address( m->ethernet_profile_h, 1, CONNECTION_ADDRESS_FAMILY_IPV4, dns);
        if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("GetProfileInfo() failed");
+               _ERR("fail to set_dns_address");
                return false;
        }
 
+       if(!m_UpdateProfile()) return false;
+}
+
+
+bool CNetConMgr::GetIpAddr(char *ip)
+{
+       ASSERT(m);
+
+       if(!ip) {
+               _ERR("Invalid parameter");
+               return false;
+       }
+
+       char *str_value;
+
+       if (connection_profile_get_ip_address( m->ethernet_profile_h, CONNECTION_ADDRESS_FAMILY_IPV4, &str_value) != CONNECTION_ERROR_NONE) {
+               _ERR("Fail to get IP address!");
+               strncpy(ip, ZERO_IP, IP_STRING_MAX_SIZE);
+       } else {
+               strncpy(ip, str_value, IP_STRING_MAX_SIZE);
+               delete(str_value);
+       }
+
+       return true;
+}
+
+
+bool CNetConMgr::GetSubnetMask(char *submask)
+{
+       ASSERT(m);
+
+       if(!submask) {
+               _ERR("Invalid parameter");
+               return false;
+       }
+
+       char *str_value;
+       if (connection_profile_get_subnet_mask( m->ethernet_profile_h, CONNECTION_ADDRESS_FAMILY_IPV4, &str_value) != CONNECTION_ERROR_NONE) {
+               _ERR("Fail to get subnet mask!");
+               strncpy(submask, ZERO_IP, IP_STRING_MAX_SIZE);
+       } else {
+               strncpy(submask, str_value, IP_STRING_MAX_SIZE);
+               delete(str_value);
+       }
+
+       return true;
+}
+
+
+bool CNetConMgr::GetGateway(char *gateway)
+{
+       ASSERT(m);
+
+       if(!gateway) {
+               _ERR("Invalid parameter");
+               return false;
+       }
+
+       char *str_value;
+       if (connection_profile_get_gateway_address( m->ethernet_profile_h, CONNECTION_ADDRESS_FAMILY_IPV4, &str_value) != CONNECTION_ERROR_NONE) {
+               _ERR("Fail to get gateway!");
+               strncpy(gateway, ZERO_IP, IP_STRING_MAX_SIZE);
+       } else {
+               strncpy(gateway, str_value, IP_STRING_MAX_SIZE);
+               delete(str_value);
+       }
+
+       return true;
+}
+
+
+bool CNetConMgr::GetDNS(char *dns)
+{
+       ASSERT(m);
+
+       if(!dns) {
+               _ERR("Invalid parameter");
+               return false;
+       }
+
+       char *str_value;
+       if (connection_profile_get_dns_address( m->ethernet_profile_h, 1, CONNECTION_ADDRESS_FAMILY_IPV4, &str_value) != CONNECTION_ERROR_NONE) {
+               _ERR("Fail to get DNS1!");
+               strncpy(dns, ZERO_IP, IP_STRING_MAX_SIZE);
+       } else {
+               strncpy(dns, str_value, IP_STRING_MAX_SIZE);
+               delete(str_value);
+       }
+
+       return true;
+}
+
+
+bool CNetConMgr::SetProxyType(EProxyMethod method)
+{
+       ASSERT(m);
+       if(!m->ethernet_profile_h) {
+               _ERR("There is no ethernet profile Try to call RefreshEthernetProfile()");
+               return false;
+       }
+
+       connection_proxy_type_e type;
+
+       int ret;
+
        switch (method) {
        case PROXY_METHOD_NONE:
                type = CONNECTION_PROXY_TYPE_DIRECT;
@@ -136,7 +456,7 @@ bool CNetConMgr::SetProxyType(EProxyMethod method)
                return false;
        }
 
-       ret = connection_profile_set_proxy_type(profile, type);
+       ret = connection_profile_set_proxy_type( m->ethernet_profile_h, type);
        if (ret != CONNECTION_ERROR_NONE) {
                _ERR("connection_profile_set_proxy_type() failed");
                return false;
@@ -149,8 +469,11 @@ bool CNetConMgr::SetProxyType(EProxyMethod method)
 bool CNetConMgr::GetProxyType(EProxyMethod *method)
 {
        ASSERT(m);
+       if(!m->ethernet_profile_h) {
+               _ERR("There is no ethernet profile Try to call RefreshEthernetProfile()");
+               return false;
+       }
 
-       connection_profile_h profile = NULL;
        connection_proxy_type_e type;
 
        int ret;
@@ -160,13 +483,7 @@ bool CNetConMgr::GetProxyType(EProxyMethod *method)
                return false;
        }
 
-       ret = GetProfileInfo(profile);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("GetProfileInfo() failed");
-               return false;
-       }
-
-       ret = connection_profile_get_proxy_type(profile, &type);
+       ret = connection_profile_get_proxy_type( m->ethernet_profile_h, &type);
        if (ret != CONNECTION_ERROR_NONE) {
                _ERR("connection_profile_get_proxy_type() failed");
                return false;
@@ -193,18 +510,14 @@ bool CNetConMgr::GetProxyType(EProxyMethod *method)
 bool CNetConMgr::SetProxyAddr(char *ip)
 {
        ASSERT(m);
-
-       connection_profile_h profile;
-       int ret;
-
-       profile = NULL;
-       ret = GetProfileInfo(profile);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("GetProfileInfo() failed");
+       if(!m->ethernet_profile_h) {
+               _ERR("There is no ethernet profile Try to call RefreshEthernetProfile()");
                return false;
        }
 
-       ret = connection_profile_set_proxy_address(profile,     CONNECTION_ADDRESS_FAMILY_IPV4, ip);
+       int ret;
+
+       ret = connection_profile_set_proxy_address( m->ethernet_profile_h,      CONNECTION_ADDRESS_FAMILY_IPV4, ip);
        if (ret != CONNECTION_ERROR_NONE) {
                _ERR("connection_profile_set_proxy_address() failed");
                return false;
@@ -217,8 +530,11 @@ bool CNetConMgr::SetProxyAddr(char *ip)
 bool CNetConMgr::GetProxyAddr(char *ip)
 {
        ASSERT(m);
+       if(!m->ethernet_profile_h) {
+               _ERR("There is no ethernet profile Try to call RefreshEthernetProfile()");
+               return false;
+       }
 
-       connection_profile_h profile;
        int ret;
        char *str;
 
@@ -227,21 +543,13 @@ bool CNetConMgr::GetProxyAddr(char *ip)
                return false;
        }
 
-       profile = NULL;
-       ret = GetProfileInfo(profile);
-       if (ret != CONNECTION_ERROR_NONE) {
-               _ERR("GetProfileInfo() failed");
-               return false;
-       }
-
-       ret = connection_profile_get_proxy_address(profile,     CONNECTION_ADDRESS_FAMILY_IPV4, &str);
+       ret = connection_profile_get_proxy_address( m->ethernet_profile_h,      CONNECTION_ADDRESS_FAMILY_IPV4, &str);
        if (ret != CONNECTION_ERROR_NONE) {
                _ERR("connection_profile_get_proxy_address() failed");
                return false;
        }
 
-       /* FIXME : hardcoding */
-       strncpy(ip, str, 20);
+       strncpy(ip, str, IP_STRING_MAX_SIZE );
        delete (str);
 
        return true;
@@ -286,3 +594,19 @@ const char *CNetConMgr::GetErrorMsg(connection_error_e err)
        return "Unknown";
 }
 
+
+bool CNetConMgr::RegisterIpChangedCallback(void(*ip_changed_cb)(bool connected, void *data), void *data)
+{
+       ASSERT(m);
+
+       int ret = -1;
+
+       ret = connection_set_ip_address_changed_cb( m->handle, sm_CbIpAddrChanged, data);
+       if (ret != CONNECTION_ERROR_NONE) {
+               _ERR("connection_set_ip_address_changed_cb() failed.");
+               return false;
+       }
+       m->ip_changed_cb = ip_changed_cb;
+
+       return true;
+}