diff --git a/core/net/tcpip.c b/core/net/tcpip.c index 7bc0e65d7..fc9b98071 100644 --- a/core/net/tcpip.c +++ b/core/net/tcpip.c @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $Id: tcpip.c,v 1.6 2007/05/08 08:28:59 bg- Exp $ + * $Id: tcpip.c,v 1.7 2007/05/20 00:04:18 oliverschmidt Exp $ */ #include "contiki-conf.h" @@ -66,23 +66,17 @@ enum { PACKET_INPUT }; -static unsigned char forwarding; /* Forwarding enabled. */ +unsigned char tcpip_do_forwarding; /* Forwarding enabled. */ unsigned char tcpip_is_forwarding; /* Forwarding right now? */ PROCESS(tcpip_process, "TCP/IP stack"); -/*---------------------------------------------------------------------------*/ -void -tcpip_set_forwarding(unsigned char f) -{ - forwarding = f; -} /*---------------------------------------------------------------------------*/ static void packet_input(void) { if(uip_len > 0) { - if(forwarding) { + if(tcpip_do_forwarding) { tcpip_is_forwarding = 1; if(uip_fw_forward() == UIP_FW_LOCAL) { tcpip_is_forwarding = 0; diff --git a/core/net/tcpip.h b/core/net/tcpip.h index d925fd34b..63a918ad1 100644 --- a/core/net/tcpip.h +++ b/core/net/tcpip.h @@ -60,7 +60,7 @@ * * Author: Adam Dunkels * - * $Id: tcpip.h,v 1.8 2007/05/08 08:29:18 bg- Exp $ + * $Id: tcpip.h,v 1.9 2007/05/20 00:04:18 oliverschmidt Exp $ */ #ifndef __TCPIP_H__ #define __TCPIP_H__ @@ -297,13 +297,19 @@ CCIF extern process_event_t tcpip_event; CCIF void tcpip_input(void); void tcpip_output(void); -void tcpip_set_forwarding(unsigned char f); + +/* + * Is forwarding generally enabled? + */ +extern unsigned char tcpip_do_forwarding; /* * Are we at the moment forwarding the contents of uip_buf[]? */ extern unsigned char tcpip_is_forwarding; +#define tcpip_set_forwarding(forwarding) tcpip_do_forwarding = (forwarding) + /** @} */ PROCESS_NAME(tcpip_process);