Bill Auerbach wrote:
> Thank you, great. I’m glad it’s been done already.
>
>
>
> No, it’s not in 1.2.0 – not that I see.
For 1.2.0 I used something like:
#include "lwip/netif.h"
#if 1
netif = netif_default;
#else
netif = netif_find("e0"); /* Get netif for i/f e0 */
#endif
if (netif)
{
u32_t haddr = ntohl(netif->ip_addr.addr);
printf("lwIP default i/f[%c%c]: IP %d.%d.%d.%d\n",
netif->name[0], netif->name[1],
(int)((haddr >> 24) & 0xff),
(int)((haddr >> 16) & 0xff),
(int)((haddr >> 8) & 0xff),
(int)((haddr >> 0) & 0xff));
} else {
printf("No lwip i/f found\n");
}
Theoretically this could be subject to problems in a dynamic system, should
the interface go down or get deleted. Personally I was using this code just
after DHCP would have been completed, and in the context of my application,
it wouldn't have gone down, so for me it was safe.
Jifl
--
eCosCentric Limited http://www.eCosCentric.com/ The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------ Opinions==mine
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users