summaryrefslogtreecommitdiff
path: root/apps/netutils/dhcpc
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-10-20 13:47:30 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-10-20 13:47:30 +0000
commit915c0105267a9685d3fa1bc915dc08bbb5883d55 (patch)
tree748852e6262da138e2481a706be911c0b548df57 /apps/netutils/dhcpc
parente67fe7912645818ff9f4f19481b64fe363f5d357 (diff)
downloadnuttx-915c0105267a9685d3fa1bc915dc08bbb5883d55.tar.gz
nuttx-915c0105267a9685d3fa1bc915dc08bbb5883d55.tar.bz2
nuttx-915c0105267a9685d3fa1bc915dc08bbb5883d55.zip
DNS fixes from Darcy Gong (part 1 of 2)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5235 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/netutils/dhcpc')
-rw-r--r--apps/netutils/dhcpc/dhcpc.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/apps/netutils/dhcpc/dhcpc.c b/apps/netutils/dhcpc/dhcpc.c
index 9801242fe..f5e15c8dc 100644
--- a/apps/netutils/dhcpc/dhcpc.c
+++ b/apps/netutils/dhcpc/dhcpc.c
@@ -352,9 +352,9 @@ void *dhcpc_open(const void *macaddr, int maclen)
struct sockaddr_in addr;
struct timeval tv;
- dbg("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
- ((uint8_t*)macaddr)[0], ((uint8_t*)macaddr)[1], ((uint8_t*)macaddr)[2],
- ((uint8_t*)macaddr)[3], ((uint8_t*)macaddr)[4], ((uint8_t*)macaddr)[5]);
+ ndbg("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
+ ((uint8_t*)macaddr)[0], ((uint8_t*)macaddr)[1], ((uint8_t*)macaddr)[2],
+ ((uint8_t*)macaddr)[3], ((uint8_t*)macaddr)[4], ((uint8_t*)macaddr)[5]);
/* Allocate an internal DHCP structure */
@@ -456,7 +456,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
{
/* Send the DISCOVER command */
- dbg("Broadcast DISCOVER\n");
+ ndbg("Broadcast DISCOVER\n");
if (dhcpc_sendmsg(pdhcpc, presult, DHCPDISCOVER) < 0)
{
return ERROR;
@@ -474,7 +474,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
* by a new OFFER.
*/
- dbg("Received OFFER from %08x\n", ntohl(presult->serverid.s_addr));
+ ndbg("Received OFFER from %08x\n", ntohl(presult->serverid.s_addr));
pdhcpc->ipaddr.s_addr = presult->ipaddr.s_addr;
pdhcpc->serverid.s_addr = presult->serverid.s_addr;
@@ -509,7 +509,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
{
/* Send the REQUEST message to obtain the lease that was offered to us. */
- dbg("Send REQUEST\n");
+ ndbg("Send REQUEST\n");
if (dhcpc_sendmsg(pdhcpc, presult, DHCPREQUEST) < 0)
{
return ERROR;
@@ -531,7 +531,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
if (msgtype == DHCPACK)
{
- dbg("Received ACK\n");
+ ndbg("Received ACK\n");
state = STATE_HAVE_LEASE;
}
@@ -541,7 +541,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
else if (msgtype == DHCPNAK)
{
- dbg("Received NAK\n");
+ ndbg("Received NAK\n");
break;
}
@@ -552,7 +552,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
else if (msgtype == DHCPOFFER)
{
- dbg("Received another OFFER, send DECLINE\n");
+ ndbg("Received another OFFER, send DECLINE\n");
(void)dhcpc_sendmsg(pdhcpc, presult, DHCPDECLINE);
}
@@ -560,7 +560,7 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
else
{
- dbg("Ignoring msgtype=%d\n", msgtype);
+ ndbg("Ignoring msgtype=%d\n", msgtype);
}
}
@@ -582,26 +582,26 @@ int dhcpc_request(void *handle, struct dhcpc_state *presult)
}
while (state != STATE_HAVE_LEASE);
- dbg("Got IP address %d.%d.%d.%d\n",
- (presult->ipaddr.s_addr >> 24 ) & 0xff,
- (presult->ipaddr.s_addr >> 16 ) & 0xff,
- (presult->ipaddr.s_addr >> 8 ) & 0xff,
- (presult->ipaddr.s_addr ) & 0xff);
- dbg("Got netmask %d.%d.%d.%d\n",
- (presult->netmask.s_addr >> 24 ) & 0xff,
- (presult->netmask.s_addr >> 16 ) & 0xff,
- (presult->netmask.s_addr >> 8 ) & 0xff,
- (presult->netmask.s_addr ) & 0xff);
- dbg("Got DNS server %d.%d.%d.%d\n",
- (presult->dnsaddr.s_addr >> 24 ) & 0xff,
- (presult->dnsaddr.s_addr >> 16 ) & 0xff,
- (presult->dnsaddr.s_addr >> 8 ) & 0xff,
- (presult->dnsaddr.s_addr ) & 0xff);
- dbg("Got default router %d.%d.%d.%d\n",
- (presult->default_router.s_addr >> 24 ) & 0xff,
- (presult->default_router.s_addr >> 16 ) & 0xff,
- (presult->default_router.s_addr >> 8 ) & 0xff,
- (presult->default_router.s_addr ) & 0xff);
- dbg("Lease expires in %d seconds\n", presult->lease_time);
+ ndbg("Got IP address %d.%d.%d.%d\n",
+ (presult->ipaddr.s_addr ) & 0xff,
+ (presult->ipaddr.s_addr >> 8 ) & 0xff,
+ (presult->ipaddr.s_addr >> 16 ) & 0xff,
+ (presult->ipaddr.s_addr >> 24 ) & 0xff);
+ ndbg("Got netmask %d.%d.%d.%d\n",
+ (presult->netmask.s_addr ) & 0xff,
+ (presult->netmask.s_addr >> 8 ) & 0xff,
+ (presult->netmask.s_addr >> 16 ) & 0xff,
+ (presult->netmask.s_addr >> 24 ) & 0xff);
+ ndbg("Got DNS server %d.%d.%d.%d\n",
+ (presult->dnsaddr.s_addr ) & 0xff,
+ (presult->dnsaddr.s_addr >> 8 ) & 0xff,
+ (presult->dnsaddr.s_addr >> 16 ) & 0xff,
+ (presult->dnsaddr.s_addr >> 24 ) & 0xff);
+ ndbg("Got default router %d.%d.%d.%d\n",
+ (presult->default_router.s_addr ) & 0xff,
+ (presult->default_router.s_addr >> 8 ) & 0xff,
+ (presult->default_router.s_addr >> 16 ) & 0xff,
+ (presult->default_router.s_addr >> 24 ) & 0xff);
+ ndbg("Lease expires in %d seconds\n", presult->lease_time);
return OK;
}