lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Printing the newly acquired DHCP config in lwip


From: Paul Archer
Subject: Re: [lwip-users] Printing the newly acquired DHCP config in lwip
Date: Mon, 16 Apr 2012 14:02:11 +1000

On Fri, Apr 13, 2012 at 9:14 PM, Arvind NR <address@hidden> wrote:
> Can any one please guid me on how to print the newly acquired DHCP
> configuration.

Use an interface callback.
void netif_status_callback(struct netif *netif)
{
    if (netif->flags & NETIF_FLAG_UP)
    {
        syslog(LOG_DEBUG, "IP(%c%c%d):      %d.%d.%d.%d",
               netif->name[0], netif->name[1], netif->num,
               ip4_addr1(&netif->ip_addr.addr),
               ip4_addr2(&netif->ip_addr.addr),
               ip4_addr3(&netif->ip_addr.addr),
               ip4_addr4(&netif->ip_addr.addr));
        syslog(LOG_DEBUG, "Netmask(%c%c%d): %d.%d.%d.%d",
               netif->name[0], netif->name[1], netif->num,
               ip4_addr1(&netif->netmask.addr),
               ip4_addr2(&netif->netmask.addr),
               ip4_addr3(&netif->netmask.addr),
               ip4_addr4(&netif->netmask.addr));
        syslog(LOG_DEBUG, "Gateway(%c%c%d): %d.%d.%d.%d",
               netif->name[0], netif->name[1], netif->num,
               ip4_addr1(&netif->gw.addr),
               ip4_addr2(&netif->gw.addr),
               ip4_addr3(&netif->gw.addr),
               ip4_addr4(&netif->gw.addr));
    }
}

netif_set_status_callback(&s_EMAC_if, netif_status_callback);


----
Regards
Paul Archer
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]