Adding IPv4 and IPv6 addresses in Network Info.
[apps/native/ug-wifi-efl.git] / sources / libraries / Common / include / common_ip_info.h
1 /*
2  * Wi-Fi
3  *
4  * Copyright 2012 Samsung Electronics Co., Ltd
5  *
6  * Licensed under the Flora License, Version 1.1 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.tizenopensource.org/license
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef __COMMON_IP_INFO_H__
21 #define __COMMON_IP_INFO_H__
22
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27
28 #include <Evas.h>
29 #include <network-wifi-intf.h>
30
31 #include "wlan_manager.h"
32 #include "common_utils.h"
33
34 #define DEFAULT_GUIDE_PROXY_IP "proxy.example.com"
35 #define DEFAULT_GUIDE_PROXY_PORT "8080"
36 #define DEFAULT_GUIDE_IP "0.0.0.0"
37
38 typedef struct ip_info_list {
39         const char *str_pkg_name;
40         Evas_Object *genlist;
41         Elm_Object_Item *ip_toggle_item;
42         Elm_Object_Item *ip_addr_item;
43         Elm_Object_Item *ipv4_addr_item;
44         Elm_Object_Item *ipv6_addr_item;
45         Elm_Object_Item *mac_addr_item;
46         Elm_Object_Item *subnet_mask_item;
47         Elm_Object_Item *gateway_addr_item;
48         Elm_Object_Item *dns_1_item;
49         Elm_Object_Item *dns_2_item;
50         Elm_Object_Item *proxy_addr_item;
51         Elm_Object_Item *proxy_port_item;
52
53         imf_ctxt_panel_cb_t input_panel_cb;
54         void *input_panel_cb_data;
55
56         wifi_manager_ap_h ap;
57         wifi_manager_ip_config_type_e ip_type;
58         wifi_manager_dns_config_type_e dns_type;
59
60 } ip_info_list_t;
61
62 typedef struct prev_ip_info {
63         char *ip_addr;
64         char *subnet_mask;
65         char *gateway_addr;
66         char *dns_1;
67         char *dns_2;
68         char *proxy_data;
69         wifi_manager_ip_config_type_e ip_type;
70         wifi_manager_proxy_type_e proxy_type;
71 } prev_ip_info_t;
72
73 typedef struct full_ip_info {
74         ip_info_list_t *ip_info_list;
75         prev_ip_info_t *prev_ip_info;
76         gboolean is_info_changed;
77         gboolean is_first_create;
78 } full_ip_info_t;
79
80 full_ip_info_t *ip_info_append_items(wifi_manager_ap_h ap, const char *pkg_name,
81                 Evas_Object *genlist,
82                 imf_ctxt_panel_cb_t input_panel_cb, void *input_panel_cb_data);
83 void ip_info_save_data(full_ip_info_t *ipdata);
84 void ip_info_remove(ip_info_list_t *ip_info_list);
85 void ip_info_close_all_keypads(ip_info_list_t *ip_info_list);
86 void ip_info_enable_all_keypads(ip_info_list_t *ip_info_list);
87 void ip_info_delete_prev(prev_ip_info_t *prev_ip_info);
88 #ifdef __cplusplus
89 }
90 #endif
91
92 #endif