Hi Marty,

Thanks for your answer.

Regardless of 1.4 or 1.3.2 udp_input() is called from ip_input().
My question is a bit different from your answer since safeRTOS is being
used in my  case. Without safeRTOS, yes you are right.

As I mentioned in the first post, tcpip_init(lwIPPrivateInit, 0) in
lwiplib.c of StellarisWare as safeRTOS is used, then call tcpip_thread() in
tcpip.c.

Inside of tcpip_thread() there is switch (msg->type) to distinguish message
type both 1.4 and 1.3.2

Either ethernet_input() or ip_input actually end up calling udp_input(), but
the thing is mes->type should be TCPIP_MSG_INPKT in order to get into case
clause and call either ethernet_input() or ip_input() otherwise those
functions are not called.

This codes seem like only accepting tcpip message not udp since I don't see
an udp message type something like TCPIP_MSG_INPKT filtered by swithch~case
to call either ethernet_input() or ip_input().

I am not sure this is clear for you regarding my question.

Thanks,
Jin


On Fri, Jul 26, 2013 at 3:54 AM, Pomeroy, Marty <[email protected]>wrote:

> **
> Jin
>
> I have 1.4.0 and this is how it works there:
>
> Make sure you have LWIP_UDP set to 1 in lwipopts.h.  Then udp_input() is
> called from ip_input() if it is a UDP packet type.
>
> Hope that helps!
>
> Marty
>
>  ------------------------------
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Jin
> Won Seo
> *Sent:* Tuesday, July 23, 2013 3:47 PM
> *To:* Mailing list for lwIP users
> *Subject:* [lwip-users] Are UDP packets received at tcpip stack in
> lwip1.3.2 +safeRTOS
>
>      Hi all,
>
> My project uses StellarisWare+lwip1.3.2+BOOTP+TFTP.
>
> Now I am analyzing lwip1.3.2 codes and if RTOS is used then call 
> tcpip_init(lwIPPrivateInit,
> 0) in lwiplib.c.
> Then tcpip_thread() is called in tcpip.c
>
> Depending on received message's type either ethernet_input() or ip_input()
> are executed.
>
> sys_mbox_fetch(mbox, (void *)&msg);
>
>     switch (msg->type) {
> case *TCPIP_MSG_INPKT*:
>       LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: PACKET %p\n", (void *)msg));
> #if LWIP_ARP
>       if (msg->msg.inp.netif->flags & NETIF_FLAG_ETHARP) {
>         *ethernet_input(msg->msg.inp.p, msg->msg.inp.netif);*
>       } else
> #endif /* LWIP_ARP */
>       {
>         *ip_input(msg->msg.inp.p, msg->msg.inp.netif);*
>       }
>       memp_free(MEMP_TCPIP_MSG_INPKT, msg);
>       break;
>
> case TCPIP_MSG_CALLBACK:
> ......
> ......
> }
>
> I am not sure once UDP packets are received, they get through this codes.
> safeRtos seems like only binding tcpip stack, so I am now tracing lwip
> codes to see if UDP packets can be received from
> tcpip_init(lwiPPrivateInit,0) in lwip+safeRTOS.
>
> I know UDP and TCP/IP are different, but I don't how I can receive UDP
> packets using lwip+safeRTOS.
>
> Thanks,
> Jin
>
>
>
>
> _______________________________________________
> lwip-users mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to