Rewrote the tcpip_output() and tcpip_set_outputfunc() so that the latter is a proper function (which simplifies debugging) and so that tcpip_output() checks if the output callback function is NULL before calling it

This commit is contained in:
adamdunkels 2009-02-20 21:21:56 +00:00
parent 7c86f70573
commit 4ec5167276
2 changed files with 43 additions and 13 deletions

View file

@ -62,7 +62,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: tcpip.h,v 1.12 2008/10/14 09:40:56 julienabeille Exp $
* $Id: tcpip.h,v 1.13 2009/02/20 21:21:57 adamdunkels Exp $
*/
#ifndef __TCPIP_H__
#define __TCPIP_H__
@ -288,11 +288,11 @@ CCIF void tcpip_poll_udp(struct uip_udp_conn *conn);
*
* This function just registers a process to be polled when
* an ICMPv6 message is received.
* If no application registers, some ICMPv6 packets will be
* If no application registers, some ICMPv6 packets will be
* processed by the "kernel" as usual (NS, NA, RS, RA, Echo request),
* others will be dropped.
* If an appplication registers here, it will be polled with a
* process_post_synch everytime an ICMPv6 packet is received.
* process_post_synch everytime an ICMPv6 packet is received.
*/
u8_t icmp6_new(void *appstate);
@ -333,9 +333,11 @@ CCIF void tcpip_input(void);
* The eventual parameter is the MAC address of the destination.
*/
#if UIP_CONF_IPV6
extern u8_t (* tcpip_output)(uip_lladdr_t *);
u8_t tcpip_output(uip_lladdr_t *);
void tcpip_set_outputfunc(u8_t (* f)(uip_lladdr_t *));
#else
extern u8_t (* tcpip_output)(void);
void tcpip_set_outputfunc(u8_t (* f)(void));
u8_t tcpip_output(void);
#endif
/**
@ -355,7 +357,7 @@ extern unsigned char tcpip_do_forwarding;
*/
extern unsigned char tcpip_is_forwarding;
#define tcpip_set_outputfunc(outputfunc) tcpip_output = (outputfunc)
#define tcpip_set_forwarding(forwarding) tcpip_do_forwarding = (forwarding)
/** @} */