mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
* Need to track if we at the moment are doing forwarding or sending.
This commit is contained in:
parent
34b1d02607
commit
7ec3d191a2
@ -30,7 +30,7 @@
|
|||||||
*
|
*
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
* Author: Adam Dunkels <adam@sics.se>
|
||||||
*
|
*
|
||||||
* $Id: tcpip.c,v 1.5 2007/03/15 19:41:29 adamdunkels Exp $
|
* $Id: tcpip.c,v 1.6 2007/05/08 08:28:59 bg- Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "contiki-conf.h"
|
#include "contiki-conf.h"
|
||||||
@ -66,7 +66,8 @@ enum {
|
|||||||
PACKET_INPUT
|
PACKET_INPUT
|
||||||
};
|
};
|
||||||
|
|
||||||
static unsigned char forwarding = 0;
|
static unsigned char forwarding; /* Forwarding enabled. */
|
||||||
|
unsigned char tcpip_is_forwarding; /* Forwarding right now? */
|
||||||
|
|
||||||
PROCESS(tcpip_process, "TCP/IP stack");
|
PROCESS(tcpip_process, "TCP/IP stack");
|
||||||
|
|
||||||
@ -82,7 +83,9 @@ packet_input(void)
|
|||||||
{
|
{
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
if(forwarding) {
|
if(forwarding) {
|
||||||
|
tcpip_is_forwarding = 1;
|
||||||
if(uip_fw_forward() == UIP_FW_LOCAL) {
|
if(uip_fw_forward() == UIP_FW_LOCAL) {
|
||||||
|
tcpip_is_forwarding = 0;
|
||||||
uip_input();
|
uip_input();
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
#if UIP_CONF_TCP_SPLIT
|
#if UIP_CONF_TCP_SPLIT
|
||||||
@ -92,6 +95,7 @@ packet_input(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tcpip_is_forwarding = 0;
|
||||||
} else {
|
} else {
|
||||||
uip_input();
|
uip_input();
|
||||||
if(uip_len > 0) {
|
if(uip_len > 0) {
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
*
|
*
|
||||||
* Author: Adam Dunkels <adam@sics.se>
|
* Author: Adam Dunkels <adam@sics.se>
|
||||||
*
|
*
|
||||||
* $Id: tcpip.h,v 1.7 2007/04/01 18:20:55 adamdunkels Exp $
|
* $Id: tcpip.h,v 1.8 2007/05/08 08:29:18 bg- Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef __TCPIP_H__
|
#ifndef __TCPIP_H__
|
||||||
#define __TCPIP_H__
|
#define __TCPIP_H__
|
||||||
@ -299,6 +299,11 @@ CCIF void tcpip_input(void);
|
|||||||
void tcpip_output(void);
|
void tcpip_output(void);
|
||||||
void tcpip_set_forwarding(unsigned char f);
|
void tcpip_set_forwarding(unsigned char f);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Are we at the moment forwarding the contents of uip_buf[]?
|
||||||
|
*/
|
||||||
|
extern unsigned char tcpip_is_forwarding;
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
PROCESS_NAME(tcpip_process);
|
PROCESS_NAME(tcpip_process);
|
||||||
|
Loading…
Reference in New Issue
Block a user