lwip-users
[Top][All Lists]
Advanced

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

Re: RE : [lwip-users] Get IP address


From: Nicolas Pinault
Subject: Re: RE : [lwip-users] Get IP address
Date: Tue, 25 Sep 2007 08:37:28 +0200
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)


Hi Nicolas,
Bonjour,
I do something like that (sorry, comments are in french, netif_local is my 
netif variable) :
Pas de problème.
     ...
     /* Démarrage du client DHCP si nécessaire */
     #if  LWIP_DHCP
      { err = dhcp_start(&netif_local);
        LWIP_DEBUGF(NETIF_DEBUG, ("dhcp_start...............%s\n", (err == 
ERR_OK)?"OK":"ERROR"));
      }
     #endif /* LWIP_DHCP */

     ...
     /* wait */
     ...

     /* Si le Client DHCP est initialisé... */
     #if  LWIP_DHCP
     if (netif_local.dhcp!=NULL)
      { /* Si on a bien obtenu un bail d'adresse... */
        if (netif_local.ip_addr.addr != 0) /*<< HERE I CHECK THE IP GET BY DHCP 
*/
         { /* Récupération des adresses IP des serveurs DNS si nécessaire */
           if (dns0==0x00000000) dns0 = 
netif_local.dhcp->offered_dns_addr[0].addr;
           if (dns1==0x00000000) dns1 = 
netif_local.dhcp->offered_dns_addr[1].addr;
         }
      }
     #endif /* LWIP_DHCP *
So, there is no function like gethostaddr in lwip ?

Nicolas




reply via email to

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