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);
+void netconfig_set_vconf_int(const char * key, int value, gboolean log);
+void netconfig_set_vconf_str(const char * key, const char * value, gboolean log);
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);
Name: net-config
Summary: TIZEN Network Configuration service
-Version: 1.2.2
+Version: 1.2.3
Release: 3
Group: System/Network
License: Apache-2.0
}
}
- netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_OFF_BY_AIRPLANE, 0);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_OFF_BY_AIRPLANE, 0, TRUE);
netconfig_send_restriction_to_net_popup("Wi-Fi unavailable", "toast_popup", "wifi");
}
builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
if (ip_addr != NULL) {
- netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, ip_addr);
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, ip_addr, TRUE);
g_variant_builder_add(builder, "{sv}", "IPv4Address",
g_variant_new_string(ip_addr));
} else {
- netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, "");
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, "", TRUE);
g_variant_builder_add(builder, "{sv}", "IPv4Address",
g_variant_new_string(""));
}
if (ip_addr6 != NULL) {
- netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, ip_addr6);
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, ip_addr6, TRUE);
g_variant_builder_add(builder, "{sv}", "IPv6Address",
g_variant_new_string(ip_addr6));
} else {
- netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, "");
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, "", TRUE);
g_variant_builder_add(builder, "{sv}", "IPv6Address",
g_variant_new_string(""));
}
if (profile == NULL && old_network_status != VCONFKEY_NETWORK_OFF) {
builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
- netconfig_set_vconf_int(VCONFKEY_NETWORK_STATUS, VCONFKEY_NETWORK_OFF);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_STATUS, VCONFKEY_NETWORK_OFF, TRUE);
g_variant_builder_add(builder, "{sv}", "NetworkStatus",
g_variant_new_int32(VCONFKEY_NETWORK_OFF));
- netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, "");
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, "", TRUE);
g_variant_builder_add(builder, "{sv}", "IPv4Address",
g_variant_new_string(""));
- netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, "");
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, "", TRUE);
g_variant_builder_add(builder, "{sv}", "IPv6Address",
g_variant_new_string(""));
- netconfig_set_vconf_str(VCONFKEY_NETWORK_PROXY, "");
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_PROXY, "", TRUE);
g_variant_builder_add(builder, "{sv}", "ProxyAddress",
g_variant_new_string(""));
params = g_variant_new("(@a{sv})", g_variant_builder_end(builder));
- netconfig_set_vconf_int(VCONFKEY_NETWORK_CONFIGURATION_CHANGE_IND, 0);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_CONFIGURATION_CHANGE_IND, 0, TRUE);
netconfig_dbus_emit_signal(NULL, NETCONFIG_NETWORK_PATH,
NETCONFIG_NETWORK_INTERFACE, "NetworkConfigChanged",
params);
- netconfig_set_vconf_int("memory/private/wifi/frequency", 0);
+ netconfig_set_vconf_int("memory/private/wifi/frequency", 0, TRUE);
g_variant_builder_unref(builder);
builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
if (netconfig_is_wifi_profile(profile) == TRUE) {
- netconfig_set_vconf_int(VCONFKEY_NETWORK_STATUS,
- VCONFKEY_NETWORK_WIFI);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_STATUS, VCONFKEY_NETWORK_WIFI, TRUE);
g_variant_builder_add(builder, "{sv}", "NetworkStatus",
g_variant_new_int32(VCONFKEY_NETWORK_WIFI));
- netconfig_set_vconf_int("memory/private/wifi/frequency", freq);
+ netconfig_set_vconf_int("memory/private/wifi/frequency", freq, TRUE);
netconfig_set_system_event(SYS_EVT_NETWORK_STATUS,
EKEY_NETWORK_STATUS, EVAL_NETWORK_WIFI);
return;
}
- netconfig_set_vconf_int(VCONFKEY_NETWORK_STATUS,
- VCONFKEY_NETWORK_CELLULAR);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_STATUS, VCONFKEY_NETWORK_CELLULAR, TRUE);
g_variant_builder_add(builder, "{sv}", "NetworkStatus",
g_variant_new_int32(VCONFKEY_NETWORK_CELLULAR));
netconfig_clatd_enable();
}
} else if (netconfig_is_ethernet_profile(profile) == TRUE) {
- netconfig_set_vconf_int(VCONFKEY_NETWORK_STATUS,
- VCONFKEY_NETWORK_ETHERNET);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_STATUS, VCONFKEY_NETWORK_ETHERNET, TRUE);
g_variant_builder_add(builder, "{sv}", "NetworkStatus",
g_variant_new_int32(VCONFKEY_NETWORK_ETHERNET));
netconfig_set_system_event(SYS_EVT_NETWORK_STATUS,
EKEY_NETWORK_STATUS, EVAL_NETWORK_ETHERNET);
} else if (netconfig_is_bluetooth_profile(profile) == TRUE) {
- netconfig_set_vconf_int(VCONFKEY_NETWORK_STATUS,
- VCONFKEY_NETWORK_BLUETOOTH);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_STATUS, VCONFKEY_NETWORK_BLUETOOTH, TRUE);
g_variant_builder_add(builder, "{sv}", "NetworkStatus",
g_variant_new_int32(VCONFKEY_NETWORK_BLUETOOTH));
netconfig_set_system_event(SYS_EVT_NETWORK_STATUS,
EKEY_NETWORK_STATUS, EVAL_NETWORK_BT);
} else{
- netconfig_set_vconf_int(VCONFKEY_NETWORK_STATUS,
- VCONFKEY_NETWORK_OFF);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_STATUS, VCONFKEY_NETWORK_OFF, TRUE);
g_variant_builder_add(builder, "{sv}", "NetworkStatus",
g_variant_new_int32(VCONFKEY_NETWORK_OFF));
netconfig_set_system_event(SYS_EVT_NETWORK_STATUS,
if (g_strcmp0(old_ip, ip_addr) != 0 || old_ip == NULL) {
if (ip_addr != NULL) {
- netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, ip_addr);
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, ip_addr, TRUE);
g_variant_builder_add(builder, "{sv}", "IPv4Address",
g_variant_new_string(ip_addr));
} else if (old_ip != NULL && strlen(old_ip) > 0) {
- netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, "");
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, "", TRUE);
g_variant_builder_add(builder, "{sv}", "IPv4Address",
g_variant_new_string(""));
}
if (g_strcmp0(old_ip6, ip_addr6) != 0 || old_ip6 == NULL) {
if (ip_addr6 != NULL) {
- netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, ip_addr6);
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, ip_addr6, TRUE);
g_variant_builder_add(builder, "{sv}", "IPv6Address",
g_variant_new_string(ip_addr6));
} else if (old_ip6 != NULL && strlen(old_ip6) > 0) {
- netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, "");
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, "", TRUE);
g_variant_builder_add(builder, "{sv}", "IPv6Address",
g_variant_new_string(""));
}
if (g_strcmp0(old_proxy, proxy_addr) != 0) {
if (proxy_addr == NULL) {
- netconfig_set_vconf_str(VCONFKEY_NETWORK_PROXY, "");
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_PROXY, "", TRUE);
g_variant_builder_add(builder, "{sv}", "ProxyAddress",
g_variant_new_string(""));
} else {
- netconfig_set_vconf_str(VCONFKEY_NETWORK_PROXY, proxy_addr);
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_PROXY, proxy_addr, TRUE);
g_variant_builder_add(builder, "{sv}", "ProxyAddress",
g_variant_new_string(proxy_addr));
}
params = g_variant_new("(@a{sv})", g_variant_builder_end(builder));
- netconfig_set_vconf_int(VCONFKEY_NETWORK_CONFIGURATION_CHANGE_IND, 1);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_CONFIGURATION_CHANGE_IND, 1, TRUE);
netconfig_dbus_emit_signal(NULL, NETCONFIG_NETWORK_PATH,
NETCONFIG_NETWORK_INTERFACE, "NetworkConfigChanged",
params);
}
endline:
- DBG("tx[%llu] rx[%llu]", *tx, *rx);
-
fclose(fp);
return ret;
}
netconfig_vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_RCV, &val);
last_rx = (guint64)val + rx_diff;
- netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_SNT, (int)last_tx);
- netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_RCV, (int)last_rx);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_SNT, (int)last_tx, FALSE);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_RCV, (int)last_rx, FALSE);
/* TOTAL */
netconfig_vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_SNT, &val);
netconfig_vconf_get_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_RCV, &val);
total_rx = (guint64)val + rx_diff;
- netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_SNT, (int)total_tx);
- netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_RCV, (int)total_rx);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_SNT, (int)total_tx, FALSE);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_RCV, (int)total_rx, FALSE);
}
void netconfig_wifi_reset_last_bytes(void)
{
- netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_SNT, 0);
- netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_RCV, 0);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_SNT, 0, FALSE);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_RCV, 0, FALSE);
}
static gboolean handle_get_wifi_total_tx_bytes(
Network_statistics *object,
GDBusMethodInvocation *context)
{
- netconfig_set_vconf_int(VCONFKEY_NETWORK_CELLULAR_PKT_TOTAL_SNT, 0);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_CELLULAR_PKT_TOTAL_SNT, 0, TRUE);
network_statistics_complete_reset_cellular_total_tx_bytes(object, context);
return TRUE;
}
Network_statistics *object,
GDBusMethodInvocation *context)
{
- netconfig_set_vconf_int(VCONFKEY_NETWORK_CELLULAR_PKT_TOTAL_RCV, 0);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_CELLULAR_PKT_TOTAL_RCV, 0, TRUE);
network_statistics_complete_reset_cellular_total_rx_bytes(object, context);
return TRUE;
}
Network_statistics *object,
GDBusMethodInvocation *context)
{
- netconfig_set_vconf_int(VCONFKEY_NETWORK_CELLULAR_PKT_LAST_SNT, 0);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_CELLULAR_PKT_LAST_SNT, 0, TRUE);
network_statistics_complete_reset_cellular_last_tx_bytes(object, context);
return TRUE;
}
Network_statistics *object,
GDBusMethodInvocation *context)
{
- netconfig_set_vconf_int(VCONFKEY_NETWORK_CELLULAR_PKT_LAST_RCV, 0);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_CELLULAR_PKT_LAST_RCV, 0, TRUE);
network_statistics_complete_reset_cellular_last_rx_bytes(object, context);
return TRUE;
}
Network_statistics *object,
GDBusMethodInvocation *context)
{
- netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_SNT, 0);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_SNT, 0, TRUE);
network_statistics_complete_reset_wifi_total_tx_bytes(object, context);
return TRUE;
}
Network_statistics *object,
GDBusMethodInvocation *context)
{
- netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_RCV, 0);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_TOTAL_RCV, 0, TRUE);
network_statistics_complete_reset_wifi_total_rx_bytes(object, context);
return TRUE;
}
Network_statistics *object,
GDBusMethodInvocation *context)
{
- netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_SNT, 0);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_SNT, 0, TRUE);
network_statistics_complete_reset_wifi_last_tx_bytes(object, context);
return TRUE;
}
Network_statistics *object,
GDBusMethodInvocation *context)
{
- netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_RCV, 0);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_PKT_LAST_RCV, 0, TRUE);
network_statistics_complete_reset_wifi_last_rx_bytes(object, context);
return TRUE;
}
return battery_plugin->get_battery_wifi_list(data, __netconfig_stc_get_wifi_stats);
}
-void netconfig_set_vconf_int(const char * key, int value)
+void netconfig_set_vconf_int(const char * key, int value, gboolean log)
{
int ret = 0;
- if (g_strcmp0(key, VCONFKEY_WIFI_TRANSFER_STATE) != 0)
+ if (log)
DBG("[%s: %d]", key, value);
ret = vconf_set_int(key, value);
ERR("Failed to set");
}
-void netconfig_set_vconf_str(const char * key, const char * value)
+void netconfig_set_vconf_str(const char * key, const char * value, gboolean log)
{
int ret = 0;
- DBG("[%s: %s]", key, value);
+ if (log)
+ DBG("[%s: %s]", key, value);
ret = vconf_set_str(key, value);
if (ret != VCONF_OK)
}
mac_lower_str = g_ascii_strup(mac_str, (gssize)mac_len);
- netconfig_set_vconf_str(VCONFKEY_WIFI_BSSID_ADDRESS, mac_lower_str);
+ netconfig_set_vconf_str(VCONFKEY_WIFI_BSSID_ADDRESS, mac_lower_str, TRUE);
g_free(mac_lower_str);
fclose(file);
if (snr_level != rssi_data->last_snr_level) {
default_ifname = netconfig_get_default_ifname();
if (g_strcmp0(default_ifname, interface_name) == 0)
- netconfig_set_vconf_int(VCONFKEY_WIFI_STRENGTH, snr_level);
+ netconfig_set_vconf_int(VCONFKEY_WIFI_STRENGTH, snr_level, FALSE);
if (g_strcmp0(rssi_data->default_path, path) == 0) {
wifi_emit_rssi_changed((Wifi *)get_wifi_object(), interface_name, snr_level);
}
if (transfer_state != last_transfer_state) {
- netconfig_set_vconf_int(VCONFKEY_WIFI_TRANSFER_STATE, transfer_state);
+ netconfig_set_vconf_int(VCONFKEY_WIFI_TRANSFER_STATE, transfer_state, FALSE);
last_transfer_state = transfer_state;
}
default_ifname = netconfig_get_default_ifname();
if (g_strcmp0(default_ifname, interface_name) == 0)
- netconfig_set_vconf_int(VCONFKEY_WIFI_STRENGTH, VCONFKEY_WIFI_STRENGTH_MAX);
+ netconfig_set_vconf_int(VCONFKEY_WIFI_STRENGTH, VCONFKEY_WIFI_STRENGTH_MAX, FALSE);
wifi_emit_rssi_changed((Wifi *)get_wifi_object(),
interface_name, VCONFKEY_WIFI_STRENGTH_MAX);
netconfig_setting_update_interface_off_for_restricted(device_data->interface_name, TRUE);
}
- netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_RESTRICTED, 1);
+ netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_RESTRICTED, 1, TRUE);
} else {
/* network restricted off */
GSList *ifname_list = NULL;
- netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_RESTRICTED, 0);
+ netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_RESTRICTED, 0, TRUE);
ifname_list = netconfig_setting_get_interfaces_off_by_restricted();
for (list = ifname_list; list; list = list->next) {
}
}
- netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_AIRPLANE, 1);
+ netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_AIRPLANE, 1, TRUE);
} else {
/* airplane mode off */
GSList *ifname_list = NULL;
- netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_AIRPLANE, 0);
+ netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_AIRPLANE, 0, TRUE);
ifname_list = netconfig_setting_get_interfaces_off_by_airplane();
for (list = ifname_list; list; list = list->next) {
netconfig_setting_update_interface_off_for_emergency(device_data->interface_name, TRUE);
}
- netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_EMERGENCY, 1);
+ netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_EMERGENCY, 1, TRUE);
} else {
/* power saving mode off */
GSList *ifname_list = NULL;
- netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_EMERGENCY, 0);
+ netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_EMERGENCY, 0, TRUE);
ifname_list = netconfig_setting_get_interfaces_off_by_emergency();
for (list = ifname_list; list; list = list->next) {
char *interface_name = list->data;
netconfig_setting_update_interface_off_for_emergency(device_data->interface_name, TRUE);
}
- netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_EMERGENCY, 1);
+ netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_EMERGENCY, 1, TRUE);
} else {
/* emergency mode off */
GSList *ifname_list = NULL;
- netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_EMERGENCY, 0);
+ netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_EMERGENCY, 0, TRUE);
ifname_list = netconfig_setting_get_interfaces_off_by_emergency();
for (list = ifname_list; list; list = list->next) {
}
- netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_AIRPLANE, 0);
+ netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_AIRPLANE, 0, TRUE);
wifi_complete_load_driver(wifi, context);
return TRUE;
return TRUE;
}
- netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_AIRPLANE, 0);
+ netconfig_set_vconf_int(VCONF_WIFI_OFF_STATE_BY_AIRPLANE, 0, TRUE);
wifi_complete_remove_driver(wifi, context);
return TRUE;
rand_mac_add[2], rand_mac_add[3],
rand_mac_add[4], rand_mac_add[5]);
- netconfig_set_vconf_str(VCONF_ETH_MAC_ADDRESS, rand_addr);
+ netconfig_set_vconf_str(VCONF_ETH_MAC_ADDRESS, rand_addr, TRUE);
} else { /* Valid MAC address */
g_strlcpy(rand_addr, mac_addr, WLAN_MAC_ADDR_MAX);
}
return;
}
- netconfig_set_vconf_str(VCONFKEY_WIFI_CONNECTED_AP_NAME, essid_name);
+ netconfig_set_vconf_str(VCONFKEY_WIFI_CONNECTED_AP_NAME, essid_name, TRUE);
/* Block Network Connected popup for 3sec
* to avoid multiple popup's due to ready signals */
static void __unset_wifi_connected_essid(void)
{
- netconfig_set_vconf_str(VCONFKEY_WIFI_CONNECTED_AP_NAME, "");
+ netconfig_set_vconf_str(VCONFKEY_WIFI_CONNECTED_AP_NAME, "", TRUE);
}
static const char *__get_wifi_connected_essid(void)
}
}
- netconfig_set_vconf_int(VCONFKEY_WIFI_STATE, wifi_state);
- netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_STATE, network_wifi_state);
+ netconfig_set_vconf_int(VCONFKEY_WIFI_STATE, wifi_state, TRUE);
+ netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_STATE, network_wifi_state, TRUE);
}
void wifi_state_update_power_state(const char *interface_name, gboolean powered)