lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] Extended udp_recv callback


From: Jakob Stoklund Olesen
Subject: [lwip-devel] Extended udp_recv callback
Date: Tue, 13 Jan 2009 15:59:18 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

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




reply via email to

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