lwip-users
[Top][All Lists]
Advanced

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

RE : [lwip-users] Get IP address


From: Frédéric BERNON
Subject: RE : [lwip-users] Get IP address
Date: Mon, 24 Sep 2007 17:49:11 +0200

Hi Nicolas,

I do something like that (sorry, comments are in french, netif_local is my 
netif variable) :

     ...
     /* 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 */

 
  
====================================
Frédéric BERNON 
HYMATOM SA 
Chef de projet informatique 
Microsoft Certified Professional 
Tél. : +33 (0)4-67-87-61-10 
Fax. : +33 (0)4-67-70-85-44 
Email : address@hidden 
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
 


-----Message d'origine-----
De : address@hidden [mailto:address@hidden De la part de Nicolas Pinault
Envoyé : lundi 24 septembre 2007 17:13
À : Mailing list for lwIP users
Objet : [lwip-users] Get IP address


Hi all,

Is there a way for a task to know the IP address of a netif ? Usefull when 
using DHCP for example.

Nicolas


_______________________________________________
lwip-users mailing list
address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-users

Attachment: Frédéric BERNON.vcf
Description: Frédéric BERNON.vcf


reply via email to

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