summaryrefslogtreecommitdiff
path: root/gdhcp/client.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-08-17 12:42:54 +0200
committerMarcel Holtmann <marcel@holtmann.org>2010-08-17 12:42:54 +0200
commit4b819888f4556ed4b4633f7f14a9265a2f478896 (patch)
tree686a76c046eeea55c1065ecfa9da2b667a346ba0 /gdhcp/client.c
parent14821c662c074412c9124dde33c07f49f6196525 (diff)
downloadconnman-4b819888f4556ed4b4633f7f14a9265a2f478896.tar.gz
connman-4b819888f4556ed4b4633f7f14a9265a2f478896.tar.bz2
connman-4b819888f4556ed4b4633f7f14a9265a2f478896.zip
Add more debug statements to DHCP library
Diffstat (limited to 'gdhcp/client.c')
-rw-r--r--gdhcp/client.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c
index a7bd88a5..430ecc86 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -600,6 +600,9 @@ static gboolean request_timeout(gpointer user_data)
{
GDHCPClient *dhcp_client = user_data;
+ debug(dhcp_client, "request timeout (retries %d)",
+ dhcp_client->retry_times);
+
dhcp_client->retry_times++;
start_request(dhcp_client);
@@ -616,6 +619,9 @@ static int switch_listening_mode(GDHCPClient *dhcp_client,
GIOChannel *listener_channel;
int listener_sockfd;
+ debug(dhcp_client, "switch listening mode (%d ==> %d)",
+ dhcp_client->listen_mode, listen_mode);
+
if (dhcp_client->listen_mode == listen_mode)
return 0;
@@ -665,6 +671,9 @@ static int switch_listening_mode(GDHCPClient *dhcp_client,
static void start_request(GDHCPClient *dhcp_client)
{
+ debug(dhcp_client, "start request (retries %d)",
+ dhcp_client->retry_times);
+
if (dhcp_client->retry_times == REQUEST_RETRIES) {
dhcp_client->state = INIT_SELECTING;
@@ -710,6 +719,8 @@ static uint32_t get_lease(struct dhcp_packet *packet)
static void restart_dhcp(GDHCPClient *dhcp_client, int retry_times)
{
+ debug(dhcp_client, "restart DHCP (retries %d)", retry_times);
+
if (dhcp_client->timeout > 0) {
g_source_remove(dhcp_client->timeout);
dhcp_client->timeout = 0;
@@ -726,6 +737,8 @@ static gboolean start_rebound_timeout(gpointer user_data)
{
GDHCPClient *dhcp_client = user_data;
+ debug(dhcp_client, "start rebound timeout");
+
switch_listening_mode(dhcp_client, L2);
dhcp_client->lease_seconds >>= 1;
@@ -755,6 +768,8 @@ static gboolean start_rebound_timeout(gpointer user_data)
static void start_rebound(GDHCPClient *dhcp_client)
{
+ debug(dhcp_client, "start rebound");
+
dhcp_client->state = REBINDING;
dhcp_client->timeout = g_timeout_add_seconds_full(G_PRIORITY_HIGH,
@@ -768,6 +783,8 @@ static gboolean start_renew_timeout(gpointer user_data)
{
GDHCPClient *dhcp_client = user_data;
+ debug(dhcp_client, "start renew timeout");
+
dhcp_client->state = RENEWING;
dhcp_client->lease_seconds >>= 1;
@@ -791,6 +808,8 @@ static gboolean start_renew_timeout(gpointer user_data)
static void start_bound(GDHCPClient *dhcp_client)
{
+ debug(dhcp_client, "start bound");
+
dhcp_client->state = BOUND;
dhcp_client->timeout = g_timeout_add_seconds_full(G_PRIORITY_HIGH,
@@ -803,6 +822,8 @@ static gboolean restart_dhcp_timeout(gpointer user_data)
{
GDHCPClient *dhcp_client = user_data;
+ debug(dhcp_client, "restart DHCP timeout");
+
dhcp_client->ack_retry_times++;
restart_dhcp(dhcp_client, dhcp_client->ack_retry_times);