[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-devel] Extended udp_recv callback
From: |
bill |
Subject: |
RE: [lwip-devel] Extended udp_recv callback |
Date: |
Tue, 13 Jan 2009 10:12:23 -0500 |
Just a thought: Why not put the netif in the pcb so it's available
everywhere? If you need it here, sure enough someone will need it somewhere
else some day. This would save the overhead on the call making it a
one-time store. And it wouldn't affect lwIP application code.
Bill
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Behalf Of Jakob Stoklund Olesen
> Sent: Tuesday, January 13, 2009 9:59 AM
> To: lwip-devel
> Subject: [lwip-devel] Extended udp_recv callback
>
> Hi,
>
> I would like to add two arguments to the udp_recv() callback function.
> I
> am receiving multicast and unicast UDP packets, and I would like to
> know
> the destination IP address and receiving interface.
>
> The new prototype would look like this:
>
> typedef void (*udp_callback_function)(void *arg, struct udp_pcb *pcb,
> struct pbuf *p,
> struct ip_addr *addr, u16_t port,
> struct ip_addr *dst_addr,
> struct netif *netif);
>
> I have a patch to make this change. My question is: Should I go ahead
> and change the prototype directly, or should I make it conditional on
> an
> UDP_EXTENDED_CALLBACK macro in opts.h?
>
> The code would be a lot cleaner without the macro, and users can easily
> add the two extra arguments to their own udp_recv callbacks.
>
> Is it OK to use a typedef for the function prototype? I have noticed
> that the full abstract prototype is used in many places.
>
> Regards,
> /stoklund
>
>
> _______________________________________________
> lwip-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-devel
- [lwip-devel] Extended udp_recv callback, Jakob Stoklund Olesen, 2009/01/13
- RE: [lwip-devel] Extended udp_recv callback,
bill <=
- Re: [lwip-devel] Extended udp_recv callback, Jakob Stoklund Olesen, 2009/01/13
- Re: [lwip-devel] Extended udp_recv callback, Jonathan Larmour, 2009/01/13
- Re: [lwip-devel] Extended udp_recv callback, Jakob Stoklund Olesen, 2009/01/13
- Re: [lwip-devel] Extended udp_recv callback, Kieran Mansley, 2009/01/13
- Re: [lwip-devel] Extended udp_recv callback, Jonathan Larmour, 2009/01/13
- Re: [lwip-devel] Extended udp_recv callback, Kieran Mansley, 2009/01/13
- Re: [lwip-devel] Extended udp_recv callback, Jonathan Larmour, 2009/01/13
- Re: [lwip-devel] Extended udp_recv callback, Jakob Stoklund Olesen, 2009/01/13
- RE: [lwip-devel] Extended udp_recv callback, bill, 2009/01/13
- Re: [lwip-devel] Extended udp_recv callback, Alain M., 2009/01/13