Hi Ahmed,

On Tue, Jun 04, 2013 at 10:52:23AM -0700, Ahmed Fayek wrote:
> Hi Sylvain,
> 
> thank you very much for your help.
> I'll try that.
> 
>  just a question regarding 2nd part about sio. In my application as I 
> said I route data from ethernet. do IP forwarding do the job 
> automatically or I need to create TX thread and handle that some way.

Both Ethernet and PPPoS require a low level port.

For port using an OS, RX data is usually handled in RX-thread that 
pushes completed frames or chunk of data to lwIP, using respectively 
tcpip_input() and pppos_input() for Ethernet and PPPoS.

TX data is handled from lwIP thread, which calls sio_write() for PPPoS 
and netif->linkoutput() for Ethernet.

lwIP core does not know if a IP packet came from Ethernet or PPP, only 
the attached low level interface using function pointers
(i.e. callbacks) differs.

lwIP supports IP forwarding but does not have a routing table, instead 
you can define LWIP_HOOK_IP4_ROUTE() to a function which takes the 
destination IPv4 address and returns the netif to be used.

/**
 * LWIP_HOOK_IP4_ROUTE(dest):
 * - called from ip_route() (IPv4)
 * - dest: destination IPv4 address
 * Returns the destination netif or NULL if no destination netif is found. In
 * that case, ip_route() continues as normal.
 */

Sylvain

Attachment: signature.asc
Description: Digital signature

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to