Thanks Marty, I should have mentioned what version of lwip lib I use. StellarisWare 10363 which is latest version still uses lwip1.3.2, so I don't see the first line "mpcb->recv(....)", but I see the second line inside udp_input() in udp.c.
I need to look over how/when arguments are filled up. pcb->recv() is called inside udp_input(), so I guess whenever incoming UDP datagram takes place, the arguments are filled up in lwip1.3.2. Thank you for giving me a tip. Jin On Fri, Jul 19, 2013 at 4:05 AM, Pomeroy, Marty <[email protected]>wrote: > ** > >> My question I don't see any arguments passed to callback functions : > udp_recv() and TFTPRecv(). > >> How are the arguments going to be filled up and by whom?? > > > Jin > > After review of the udp.c code, it looks to me that udp_recv is a setup > function (not a callback...), and you use it to tell lwIP what function > to call with UDP traffic. Once set up, your TFTPRecv function is called in > the udp.c module by one of these two lines (in lwIP 1.4.0): > > mpcb->recv(mpcb->recv_arg, mpcb, q, ip_current_src_addr(), src); > ... > pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr(), src); > > Hope that helps! > > Marty > > _______________________________________________ > 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
