If DHCPC selected, show leased IP address
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2840 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
f71c623cfb
commit
1f54dbb87f
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* examples/uip/main.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009-2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Based on uIP which also has a BSD style license:
|
||||
@ -57,6 +57,9 @@
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-lib.h>
|
||||
#ifdef CONFIG_EXAMPLE_UIP_DHCPC
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
/* Here we include the header file for the application(s) we use in
|
||||
* our project as defined in the config/<board-name>/defconfig file
|
||||
@ -193,6 +196,7 @@ int user_start(int argc, char *argv[])
|
||||
resolv_conf(&ds.dnsaddr);
|
||||
}
|
||||
dhcpc_close(handle);
|
||||
printf("IP: %s\n", inet_ntoa(ds.ipaddr));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user