lwip-devel
[Top][All Lists]
Advanced

[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





reply via email to

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