#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
-#include <ITapiSim.h>
-#include <TapiUtility.h>
#include "log.h"
#include "util.h"
#include "network-dpm.h"
#include "network-monitor.h"
#include "netsupplicant.h"
-#include "wifi-tel-intf.h"
#include "generated-code.h"
/* Define TCP buffer sizes for various networks */
rmax_size = NET_TCP_BUFFERSIZE_WIFI_RMEM_MAX;
wmax_size = NET_TCP_BUFFERSIZE_WIFI_WMEM_MAX;
} else if (netconfig_is_cellular_profile(profile) == TRUE) {
- TapiHandle *tapi_handle = NULL;
int telephony_svctype = 0, telephony_pstype = 0;
- tapi_handle = (TapiHandle *)netconfig_tel_init();
- if (NULL != tapi_handle) {
- tel_get_property_int(tapi_handle,
- TAPI_PROP_NETWORK_SERVICE_TYPE,
- &telephony_svctype);
- tel_get_property_int(tapi_handle, TAPI_PROP_NETWORK_PS_TYPE,
- &telephony_pstype);
- netconfig_tel_deinit();
- }
-
+ netconfig_get_telephony_network_type(&telephony_svctype, &telephony_pstype);
DBG("Default cellular %d, %d", telephony_svctype, telephony_pstype);
switch (telephony_pstype) {
/* default profile is NULL and new connected profile is NULL */
if (!profile) {
- profile = __netconfig_get_default_profile();
+ char *tmp_profile = __netconfig_get_default_profile();
- if (profile && netconfig_is_cellular_profile(profile) &&
- !netconfig_is_cellular_internet_profile(profile)) {
+ if (tmp_profile && netconfig_is_cellular_profile(tmp_profile) &&
+ !netconfig_is_cellular_internet_profile(tmp_profile)) {
DBG("not a default cellular profile");
- profile = NULL;
+ g_free(tmp_profile);
+ tmp_profile = NULL;
}
- if (!profile) {
+ if (!tmp_profile) {
__netconfig_update_default_connection_info();
return;
}
+
+ netconfig_default_connection_info.profile = g_strdup(tmp_profile);
+ __netconfig_get_default_connection_info(tmp_profile);
+ __netconfig_update_default_connection_info();
+ g_free(tmp_profile);
+ return;
}
netconfig_default_connection_info.profile = g_strdup(profile);
__netconfig_get_default_connection_info(profile);
__netconfig_update_default_connection_info();
-
}
void netconfig_update_default(void)
while (g_variant_iter_loop(next, "{sv}", &key1, &variant)) {
if (g_strcmp0(key1, "Interface") == 0) {
value = g_variant_get_string(variant, NULL);
- if (ifname)
- g_free(ifname);
ifname = g_strdup(value);
+ g_free(key1);
+ g_variant_unref(variant);
+ break;
}
}
}