2 * Network Configuration Module
4 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef __NETCONFIG_UTIL_H__
21 #define __NETCONFIG_UTIL_H__
31 #define NETCONFIG_ADD_FOUND_AP_NOTI "add_found_ap_noti"
32 #define NETCONFIG_DEL_FOUND_AP_NOTI "del_found_ap_noti"
33 #define NETCONFIG_ADD_PORTAL_NOTI "add_portal_noti"
34 #define NETCONFIG_DEL_PORTAL_NOTI "del_portal_noti"
35 #define NETCONFIG_TIZENMOBILEENV "/run/tizen-mobile-env"
37 #define MAX_SIZE_ERROR_BUFFER 256
39 #if defined TIZEN_WEARABLE
41 WC_POPUP_TYPE_SESSION_OVERLAPPED,
42 WC_POPUP_TYPE_WIFI_CONNECTED,
43 WC_POPUP_TYPE_CAPTIVE_PORTAL,
44 WC_POPUP_TYPE_WIFI_RESTRICT
45 }netconfig_wcpopup_type_e;
48 GKeyFile *netconfig_keyfile_load(const char *pathname);
49 void netconfig_keyfile_save(GKeyFile *keyfile, const char *pathname);
51 void netconfig_start_timer_seconds(guint secs,
52 gboolean(*callback) (gpointer), void *user_data, guint *timer_id);
53 void netconfig_start_timer(guint msecs,
54 gboolean(*callback) (gpointer), void *user_data, guint *timer_id);
55 void netconfig_stop_timer(guint *timer_id);
57 void netconfig_wifi_enable_device_picker_test(void);
58 void netconfig_wifi_device_picker_service_start(void);
59 void netconfig_wifi_device_picker_service_stop(void);
61 gboolean netconfig_is_wifi_direct_on(void);
62 gboolean netconfig_is_wifi_tethering_on(void);
64 gboolean netconfig_interface_up(const char *ifname);
65 gboolean netconfig_interface_down(const char *ifname);
67 int netconfig_execute_file(const char *file_path, char *const args[], char *const env[]);
68 int netconfig_execute_clatd(const char *file_path, char *const args[]);
69 int netconfig_add_route_ipv6(gchar *ip_addr, gchar *interface, gchar *gateway, unsigned char prefix_len);
70 int netconfig_del_route_ipv6(gchar *ip_addr, gchar *interface, gchar *gateway, unsigned char prefix_len);
71 int netconfig_add_route_ipv4(gchar *ip_addr, gchar *subnet, gchar *interface, gint address_family);
72 int netconfig_del_route_ipv4(gchar *ip_addr, gchar *subnet, gchar *interface, gint address_family);
74 gboolean handle_launch_direct(Wifi *wifi, GDBusMethodInvocation *context);
76 gboolean netconfig_send_notification_to_net_popup(const char * noti, const char * data);
77 int netconfig_send_message_to_net_popup(const char *title,
78 const char *content, const char *type, const char *ssid);
79 void netconfig_set_system_event(const char * sys_evt, const char * evt_key, const char * evt_val);
80 #if defined TIZEN_WEARABLE
81 int wc_launch_syspopup(netconfig_wcpopup_type_e type);
82 int wc_launch_popup(netconfig_wcpopup_type_e type);
84 void netconfig_set_vconf_int(const char * key, int value);
85 void netconfig_set_vconf_str(const char * key, const char * value);
86 char* netconfig_get_env(const char *key);
87 void netconfig_set_mac_address_from_file(void);
93 #endif /* __NETCONFIG_UTIL_H__ */