From: Seonah Moon Date: Tue, 25 Apr 2017 08:03:22 +0000 (+0900) Subject: Added some logs for debugging X-Git-Tag: accepted/tizen/unified/20170428.032833~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fconnman.git;a=commitdiff_plain;h=1664a9129b021a21f4d96abea734a9df9913835c Added some logs for debugging Change-Id: I3a133fa6aebd28dea42f7dfd9ecb42d04c45f291 Signed-off-by: Seonah Moon --- diff --git a/src/connection.c b/src/connection.c index 0b6dc4a..4389d58 100755 --- a/src/connection.c +++ b/src/connection.c @@ -962,6 +962,12 @@ int __connman_connection_gateway_add(struct connman_service *service, } if (!active_gateway) { +#if defined TIZEN_EXT + if(new_gateway->ipv4_gateway) + DBG("ConnMan, Set default gateway[%s], active[%d]", + new_gateway->ipv4_gateway->gateway, + new_gateway->ipv4_gateway->active); +#endif set_default_gateway(new_gateway, type); goto done; } diff --git a/src/dhcp.c b/src/dhcp.c index 0a2f6fc..7e5f71d 100755 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -61,6 +61,9 @@ static bool ipv4ll_running; static void dhcp_free(struct connman_dhcp *dhcp) { +#if defined TIZEN_EXT + DBG("dhcp_free [%p]", dhcp); +#endif g_strfreev(dhcp->nameservers); g_strfreev(dhcp->timeservers); g_free(dhcp->pac); @@ -70,10 +73,16 @@ static void dhcp_free(struct connman_dhcp *dhcp) dhcp->pac = NULL; g_free(dhcp); +#if defined TIZEN_EXT + dhcp = NULL; +#endif } static void ipv4ll_stop_client(struct connman_dhcp *dhcp) { +#if defined TIZEN_EXT + DBG("dhcp [%p] ipv4ll_client [%p]", dhcp, dhcp->ipv4ll_client); +#endif if (!dhcp->ipv4ll_client) return; @@ -189,6 +198,10 @@ static int ipv4ll_start_client(struct connman_dhcp *dhcp) int index; int err; +#if defined TIZEN_EXT + DBG("dhcp %p", dhcp); +#endif + if (dhcp->ipv4ll_client) return -EALREADY; @@ -242,7 +255,10 @@ static gboolean dhcp_retry_cb(gpointer user_data) struct connman_dhcp *dhcp = user_data; dhcp->timeout = 0; - +#if defined TIZEN_EXT + DBG("dhcp %p", dhcp); + DBG("dhcp->timeout %d", dhcp->timeout); +#endif g_dhcp_client_start(dhcp->dhcp_client, __connman_ipconfig_get_dhcp_address(dhcp->ipconfig)); @@ -701,7 +717,6 @@ int __connman_dhcp_start(struct connman_ipconfig *ipconfig, #else return g_dhcp_client_start(dhcp->dhcp_client, last_addr); #endif - } void __connman_dhcp_stop(struct connman_ipconfig *ipconfig) diff --git a/src/inet.c b/src/inet.c index fcffab8..45408ce 100755 --- a/src/inet.c +++ b/src/inet.c @@ -1546,6 +1546,9 @@ static int ndisc_send_unspec(int type, int oif, const struct in6_addr *dest, msgh.msg_controllen = cmsg->cmsg_len; ret = sendmsg(fd, &msgh, 0); +#if defined TIZEN_EXT + DBG("sendmsg errno: %d/%s", errno, strerror(errno)); +#endif close(fd); return ret; diff --git a/src/ipconfig.c b/src/ipconfig.c index 8d1db29..411fc45 100755 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -1838,6 +1838,9 @@ void __connman_ipconfig_append_ipv4(struct connman_ipconfig *ipconfig, { struct connman_ipaddress *append_addr = NULL; const char *str; +#if defined TIZEN_EXT + DBG(""); +#endif if (ipconfig->type != CONNMAN_IPCONFIG_TYPE_IPV4) return; @@ -1910,6 +1913,9 @@ void __connman_ipconfig_append_ipv6(struct connman_ipconfig *ipconfig, { struct connman_ipaddress *append_addr = NULL; const char *str, *privacy; +#if defined TIZEN_EXT + DBG(""); +#endif if (ipconfig->type != CONNMAN_IPCONFIG_TYPE_IPV6) return; @@ -1971,6 +1977,9 @@ void __connman_ipconfig_append_ipv6config(struct connman_ipconfig *ipconfig, DBusMessageIter *iter) { const char *str, *privacy; +#if defined TIZEN_EXT + DBG(""); +#endif str = __connman_ipconfig_method2string(ipconfig->method); if (!str) @@ -2013,6 +2022,9 @@ void __connman_ipconfig_append_ipv4config(struct connman_ipconfig *ipconfig, DBusMessageIter *iter) { const char *str; +#if defined TIZEN_EXT + DBG(""); +#endif str = __connman_ipconfig_method2string(ipconfig->method); if (!str) diff --git a/src/network.c b/src/network.c index c57d70e..8a6b906 100755 --- a/src/network.c +++ b/src/network.c @@ -478,6 +478,9 @@ static void check_dhcpv6(struct nd_router_advert *reply, check_dhcpv6, network); return; } +#if defined TIZEN_EXT + DBG("RA message is not received from server in reply of RS."); +#endif connman_network_unref(network); return; } @@ -490,6 +493,9 @@ static void check_dhcpv6(struct nd_router_advert *reply, */ if (!network->connected) { connman_network_unref(network); +#if defined TIZEN_EXT + DBG("Network is not connected"); +#endif return; } @@ -1689,7 +1695,9 @@ int __connman_network_connect(struct connman_network *network) if (network->type != CONNMAN_NETWORK_TYPE_CELLULAR) #endif __connman_device_disconnect(network->device); - +#if defined TIZEN_EXT + DBG("ConnMan, Connect Request [%s]", network->name); +#endif err = network->driver->connect(network); if (err < 0) { if (err == -EINPROGRESS) { @@ -1728,7 +1736,9 @@ int __connman_network_disconnect(struct connman_network *network) return -EUNATCH; network->connecting = false; - +#if defined TIZEN_EXT + DBG("ConnMan, Disconnect request"); +#endif if (network->driver->disconnect) err = network->driver->disconnect(network); @@ -2238,6 +2248,9 @@ int connman_network_set_string(struct connman_network *network, g_free(network->wifi.security); network->wifi.security = g_strdup(value); } else if (g_str_equal(key, "WiFi.Passphrase")) { +#if defined TIZEN_EXT + DBG("ConnMan, %p key %s", network, key); +#endif g_free(network->wifi.passphrase); network->wifi.passphrase = g_strdup(value); } else if (g_str_equal(key, "WiFi.EAP")) { diff --git a/src/rfkill.c b/src/rfkill.c index 20908d7..36426e0 100755 --- a/src/rfkill.c +++ b/src/rfkill.c @@ -169,7 +169,7 @@ int __connman_rfkill_block(enum connman_service_type type, bool block) DBG("type %d block %d", type, block); #if defined TIZEN_EXT - DBG("try to set rfkill block %d, but it's not pormitted", block); + DBG("try to set rfkill block %d, but it's not permitted", block); return 0; #else diff --git a/src/service.c b/src/service.c index 6e99979..259a497 100755 --- a/src/service.c +++ b/src/service.c @@ -1357,6 +1357,7 @@ static int nameserver_add_all(struct connman_service *service) DBG("type %d add service->nameservers_config[%d]:%s",type, i, service->nameservers_config[i]); if(strncmp(service->nameservers_config[i], "::", 2) == 0) { + DBG("Invalid nameserver"); i++; continue; } @@ -1486,6 +1487,9 @@ static int nameserver_remove(struct connman_service *service, if (index < 0) return -ENXIO; +#if defined TIZEN_EXT + DBG("Resolver remove nameserver: %s", nameserver); +#endif return connman_resolver_remove(index, NULL, nameserver); } @@ -1830,6 +1834,9 @@ set_servers: service->nameservers_auto = nameservers; } else { service->nameservers = nameservers; +#if defined TIZEN_EXT + DBG("nameserver remove ip_type: %d", type); +#endif nameserver_remove(service, nameserver); } @@ -2194,7 +2201,9 @@ static void state_changed(struct connman_service *service) if (!allow_property_changed(service)) return; #endif - +#if defined TIZEN_EXT + DBG(" %s, %s", str, service->path); +#endif connman_dbus_property_changed_basic(service->path, CONNMAN_SERVICE_INTERFACE, "State", DBUS_TYPE_STRING, &str); @@ -4835,9 +4844,21 @@ static bool auto_connect_service(GList *services, if (preferred) continue; +#if defined TIZEN_EXT + DBG("Service is not favorite, autoconnecting %d", + autoconnecting); +#endif return autoconnecting; } +#if defined TIZEN_EXT + DBG("service %p identifier %s roaming %d ignore %d " + "ipconfig_usable %d autoconnect %d state %d", + service, + service->identifier, service->roaming, + service->ignore, is_ipconfig_usable(service), + service->autoconnect, service->state); +#endif if (is_ignore(service) || service->state != CONNMAN_SERVICE_STATE_IDLE) continue; diff --git a/src/technology.c b/src/technology.c index 6a69b4e..c43fc32 100755 --- a/src/technology.c +++ b/src/technology.c @@ -673,6 +673,10 @@ static void powered_changed(struct connman_technology *technology) __sync_synchronize(); enabled = technology->enabled; +#if defined TIZEN_EXT + DBG("ConnMan, Powered : %s, %s", + enabled ? "TRUE" : "FALSE",technology->path); +#endif connman_dbus_property_changed_basic(technology->path, CONNMAN_TECHNOLOGY_INTERFACE, "Powered", DBUS_TYPE_BOOLEAN, &enabled);