/*
* Network Configuration Module
*
- * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2000 - 2012 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.
#endif
#include <glib.h>
+#include <stdbool.h>
#include "wifi.h"
+#include "plugin.h"
+
+#define NETCONFIG_TIZEN_SYSTEM_ENV "/run/tizen-system-env"
#define MAX_SIZE_ERROR_BUFFER 256
+#define ETHERNET_FEATURE "http://tizen.org/feature/network.ethernet"
+#define TETHERING_FEATURE "http://tizen.org/feature/network.tethering"
+#define WIFI_DIRECT_FEATURE "http://tizen.org/feature/network.wifi.direct"
+#define WIFI_SOFTAP_FEATURE "http://tizen.org/feature/network.wifi.softap"
+
+/** Macros to handle rtattributes */
+#define RTA_ALIGNTO 4
+#define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
+#define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
+#define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
+#define NLMSG_TAIL(nmsg) \
+ ((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len)))
+
+typedef enum {
+ NETCONFIG_SUPPORTED_FEATURE_ETHERNET = 0,
+ NETCONFIG_SUPPORTED_FEATURE_TETHERING,
+ NETCONFIG_SUPPORTED_FEATURE_WIFI_DIRECT,
+ NETCONFIG_SUPPORTED_FEATURE_WIFI_SOFTAP,
+ NETCONFIG_SUPPORTED_FEATURE_MAX,
+} netconfig_supported_feature_e;
+
+bool netconfig_check_feature_supported(netconfig_supported_feature_e feature);
+
+gboolean netconfig_check_passphrase(const gchar *service, const char *passphrase);
GKeyFile *netconfig_keyfile_load(const char *pathname);
void netconfig_keyfile_save(GKeyFile *keyfile, const char *pathname);
gboolean(*callback) (gpointer), void *user_data, guint *timer_id);
void netconfig_stop_timer(guint *timer_id);
+void netconfig_wifi_enable_device_picker_test(void);
void netconfig_wifi_device_picker_service_start(void);
void netconfig_wifi_device_picker_service_stop(void);
gboolean netconfig_is_wifi_direct_on(void);
gboolean netconfig_is_wifi_tethering_on(void);
-gboolean netconfig_execute_file(const char *file_path,
- char *const args[], char *const env[]);
-int netconfig_add_route_ipv6(gchar *ip_addr, gchar *interface, gchar *gateway, unsigned char prefix_len);
+gboolean netconfig_interface_up(const char *ifname);
+gboolean netconfig_interface_down(const char *ifname);
+int __netconfig_get_interface_index(const char *interface_name);
+
+int netconfig_execute_cmd(const char *cmd);
+int netconfig_execute_file(const char *file_path, char *const args[], char *const env[]);
+int netconfig_execute_file_no_wait(const char *file_path,
+ char *const args[]);
+int netconfig_execute_clatd(const char *file_path, char *const args[]);
+int netconfig_add_route_ipv6(gchar *interface, gchar *gateway);
int netconfig_del_route_ipv6(gchar *ip_addr, gchar *interface, gchar *gateway, unsigned char prefix_len);
+int netconfig_add_route_ipv4(gchar *ip_addr, gchar *subnet, gchar *interface, gint address_family);
+int netconfig_del_route_ipv4(gchar *ip_addr, gchar *subnet, gchar *interface, gint address_family);
-gboolean netconfig_iface_wifi_launch_direct(NetconfigWifi *wifi, GError **error);
-void netconfig_set_wifi_mac_address(void);
+gboolean handle_launch_direct(Wifi *wifi, GDBusMethodInvocation *context);
+gboolean handle_launch_mdns(Network *object, GDBusMethodInvocation *context,
+ gchar *name);
-void netconfig_add_wifi_found_notification(void);
-void netconfig_del_wifi_found_notification(void);
-gboolean netconfig_interface_up(const char *ifname);
-gboolean netconfig_interface_down(const char *ifname);
+gboolean netconfig_send_notification_to_net_popup(const char * noti, const char * data);
+int netconfig_send_message_to_net_popup(const char *title,
+ const char *content, const char *type, const char *ssid);
+int netconfig_send_restriction_to_net_popup(const char *title,
+ const char *type, const char *restriction);
+void netconfig_set_system_event(int sys_evt, int evt_key, int evt_val);
+void netconfig_set_vconf_int(const char * key, int value);
+void netconfig_set_vconf_str(const char * key, const char * value);
+int netconfig_vconf_get_int(const char * key, int *value);
+int netconfig_vconf_get_bool(const char * key, int *value);
+char* netconfig_get_env(const char *key);
+void netconfig_set_mac_address_from_file(void);
+void __netconfig_pop_wifi_connected_poppup(const char *ssid);
+void netconfig_get_telephony_network_type(int *svctype, int *pstype);
+gboolean __netconfig_wifi_get_sim_imsi(Wifi *wifi, GDBusMethodInvocation *context);
+netconfig_error_e __netconfig_wifi_req_aka_auth(GArray *rand_data, GArray *autn_data,
+ GDBusMethodInvocation *context, struct wifi_authentication_data **data);
+gboolean __netconfig_wifi_req_sim_auth(GArray *rand_data,
+ GDBusMethodInvocation *context, struct wifi_authentication_data **data);
+gboolean netconfig_tapi_check_sim_state(void);
+gboolean __netconfig_wifi_get_aka_authdata(Wifi *wifi,
+ GDBusMethodInvocation *context, struct wifi_authentication_data **data);
+gboolean __netconfig_wifi_get_sim_authdata(Wifi *wifi,
+ GDBusMethodInvocation *context, struct wifi_authentication_data **data);
+
+void netconfig_plugin_init();
+void netconfig_plugin_deinit();
+gboolean netconfig_get_headed_plugin_flag();
+gboolean netconfig_get_telephony_plugin_flag();
#ifdef __cplusplus
}
#endif
+typedef enum {
+ TIZEN_PROFILE_UNKNOWN = 0,
+ TIZEN_PROFILE_MOBILE = 0x1,
+ TIZEN_PROFILE_WEARABLE = 0x2,
+ TIZEN_PROFILE_TV = 0x4,
+ TIZEN_PROFILE_IVI = 0x8,
+ TIZEN_PROFILE_COMMON = 0x10,
+} tizen_profile_t;
+extern tizen_profile_t _get_tizen_profile();
+
+#define TIZEN_TELEPHONY_ENABLE (_get_tizen_profile() == TIZEN_PROFILE_MOBILE)
+#define TIZEN_WLAN_BOARD_SPRD (_get_tizen_profile() == TIZEN_PROFILE_MOBILE)
+#define TIZEN_TV (_get_tizen_profile() == TIZEN_PROFILE_TV)
+#define TIZEN_NTP_ENABLE 1 /* 1: enable, 0: disable */
+
#endif /* __NETCONFIG_UTIL_H__ */