Revert "net: remove get/set host ip"
authorMunkyu Im <munkyu.im@samsung.com>
Tue, 12 May 2015 08:12:57 +0000 (17:12 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 12 May 2015 08:30:54 +0000 (17:30 +0900)
This reverts commit ed4a07e79ff064ba3c7814188b1e1785c7a1d0d4.

Change-Id: I6085a41c3ffdd17c506edba45881d10c58772dc4
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
tizen/src/emul_state.c
tizen/src/emul_state.h
tizen/src/emulator_common.h

index 0bbc9ebcf94feb97064404e34e68b82e4b452c44..94534b31ee9d0fbb4eb96c0a8823e4d525b5650d 100644 (file)
@@ -195,6 +195,36 @@ char* get_emul_guest_ip(void)
     return _emul_info.guest_ip;
 }
 
+void set_emul_host_ip(char *kernel_cmdline)
+{
+#ifdef SUPPORT_LEGACY_ARGS
+    char *buf = strstr(kernel_cmdline, HOST_IP_PREFIX);
+#else
+    char *buf = get_variable("host_ip");
+#endif
+    if (buf) {
+        char buf_host_ip[MAXLEN] = {0,};
+        int len = strlen(HOST_IP_PREFIX);
+        int i, j;
+        int max_len = strlen(buf);
+        for(i = len, j = 0; i < max_len; i++) {
+            if (buf[i] == ' ' || buf[i] == '\0')
+                break;
+            buf_host_ip[j++] = buf[i];
+        }
+
+        buf_host_ip[j] = '\0';
+        LOG_INFO("host_ip information=%s\n", buf_host_ip);
+        strncpy(_emul_info.host_ip, buf_host_ip, sizeof(_emul_info.host_ip));
+    }
+}
+
+char* get_emul_host_ip(void)
+{
+    LOG_INFO("host ip: %s\n", _emul_info.guest_ip);
+    return _emul_info.host_ip;
+}
+
 /* maximum number of touch point */
 void set_emul_max_touch_point(int cnt)
 {
index 6923ed1633793209857560dffb94365ee11e8584..5b0e7fd2adff292ba7c32d4e14cb90baa7b1864b 100644 (file)
@@ -104,6 +104,7 @@ typedef  struct EmulatorConfigInfo {
 
     bool tap_enable;
     char guest_ip[16];
+    char host_ip[16];
 
     int spice_port;
     char *vm_name;
@@ -152,6 +153,7 @@ void set_emul_max_touch_point(int cnt);
 void set_emul_vm_base_port(int port);
 void set_emul_ecs_port(int port);
 void set_emul_guest_ip(char *ip);
+void set_emul_host_ip(char *ip);
 void set_emul_vm_name(char *vm_name);
 void set_emul_skin_path(char *path);
 void set_emul_gpu_accel(bool enable);
@@ -202,6 +204,7 @@ int get_host_lock_key_state_darwin(int key);
 int get_emul_caps_lock_state(void);
 int get_emul_num_lock_state(void);
 char* get_emul_guest_ip(void);
+char* get_emul_host_ip(void);
 bool is_emul_tap_enable(void);
 char* get_emul_http_proxy_addr(void);
 char* get_emul_http_proxy_port(void);
index a29efff56f502111133750c65be5c0edb27fecec..34142b2df5ff08d252df9ac65e9596afddd00576 100644 (file)
@@ -60,6 +60,7 @@
 #define JAVA_MAX_COMMAND_LENGTH 1024
 #define MAXLEN  512
 #define HTTP_PROXY_PREFIX "http_proxy="
+#define HOST_IP_PREFIX "host_ip="
 
 
 #define JAR_SKINFILE "emulator-skin.jar"