lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] DHCP with lwIP


From: bockham
Subject: Re: [lwip-users] DHCP with lwIP
Date: Fri, 9 Nov 2007 20:12:18 +0800

----- Receiving the following content -----  
From:  Muhamad Ikhwan Ismail  
Receiver:  lwip-users  
Time: 2007-11-09, 17:14:43 
Subject: [lwip-users] DHCP with lwIP 




>  
>Hi .. 
>First thing first, thanks for reading this and helping out. 
>I am a student given the task of porting the lwip 1.2.0 
>to the 32bit Freescale MPC852T running on a commercial RTOS and im about to 
>write the 
>source code for the ethernet interface setup when I started to give  
>a thought about DHCP for my device to obtain an IP Address and gateway. 
>Following is my question : 
>  
>1. Following is my program flow for the ethernet setup : 
>Bring HW up (not netif, just hardware setup) --> create netif and initialize 
>it with HW address info 
>-->call DHCP (dhcp_start();)-->make netif default and add it into the list. 
>Is the flow for a threaded environment ok ? Did I forget anything....e,g   e 
>the socket API (another requirement) 
>  
This is how I setup an ethernet interface with 1.1.1

struct netif ether_if;

(1) netif_add(&ether_if, NULL, NULL, NULL, NULL, ethernetif_init, tcpip_input);
(2) start dhcp_coarse_tmr(use OS function)
(3) start dhcp_fine_tmr(use OS function)
(4) setup HW
(5) dhcp_start(&ether_if)

I think it's fine for 1.2.0.

BTW, I think 1.3.0 will be released soon, so suggest you use the latest CVS 
version.
It's thread safe.


>2. How am I suppose to figure out the memory allignment?  

I set MEM_ALIGNMENT_SIZE to 4, on my LPC2210 (also a 32-bit processor), suggest 
you to do so
It's a big issue should to be emphasized in the document I think. For I ever 
trapped for two days for I ignore this when I first came to lwip


>  
>Also any link which could help me porting lwip would be welcome...  
>Thanks a lot in advance.... 
>  
>Ikhwan 






reply via email to

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