Updated current fallback_interface(s) to return int.

This commit is contained in:
Víctor Ariño 2013-07-01 14:47:06 +02:00 committed by Valentin Sawadski
parent b3f6019924
commit 561e70b18e
6 changed files with 17 additions and 10 deletions

View file

@ -192,7 +192,7 @@ uint8_t wfall_send(const uip_lladdr_t *lladdr);
static uip_ipaddr_t last_sender; static uip_ipaddr_t last_sender;
#endif #endif
static void static int
output(void) output(void)
{ {
#if FALLBACK_HAS_ETHERNET_HEADERS&&0 #if FALLBACK_HAS_ETHERNET_HEADERS&&0
@ -204,7 +204,7 @@ output(void)
uip_ipaddr_copy(&last_sender, &UIP_IP_BUF->srcipaddr); uip_ipaddr_copy(&last_sender, &UIP_IP_BUF->srcipaddr);
#endif #endif
PRINTF("FUT: %u\n", uip_len); PRINTF("FUT: %u\n", uip_len);
wfall_send(0); return wfall_send(0);
} }
const struct uip_fallback_interface rpl_interface = { const struct uip_fallback_interface rpl_interface = {

View file

@ -83,7 +83,7 @@ init(void)
slip_set_input_callback(slip_input_callback); slip_set_input_callback(slip_input_callback);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void static int
output(void) output(void)
{ {
if(uip_ipaddr_cmp(&last_sender, &UIP_IP_BUF->srcipaddr)) { if(uip_ipaddr_cmp(&last_sender, &UIP_IP_BUF->srcipaddr)) {
@ -94,6 +94,7 @@ output(void)
PRINTF("SUT: %u\n", uip_len); PRINTF("SUT: %u\n", uip_len);
slip_send(); slip_send();
} }
return 0;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
struct uip_fallback_interface slip_interface = { struct uip_fallback_interface slip_interface = {

View file

@ -222,13 +222,15 @@ tun_init()
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void static int
tun_output(uint8_t *data, int len) tun_output(uint8_t *data, int len)
{ {
/* fprintf(stderr, "*** Writing to tun...%d\n", len); */ /* fprintf(stderr, "*** Writing to tun...%d\n", len); */
if(write(tunfd, data, len) != len) { if(write(tunfd, data, len) != len) {
err(1, "serial_to_tun: write"); err(1, "serial_to_tun: write");
return 1;
} }
return 0;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int int
@ -246,13 +248,14 @@ init(void)
{ {
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void static int
output(void) output(void)
{ {
PRINTF("SUT: %u\n", uip_len); PRINTF("SUT: %u\n", uip_len);
if(uip_len > 0) { if(uip_len > 0) {
tun_output(&uip_buf[UIP_LLH_LEN], uip_len); return tun_output(&uip_buf[UIP_LLH_LEN], uip_len);
} }
return 0;
} }

View file

@ -100,7 +100,7 @@ init(void)
slip_set_input_callback(slip_input_callback); slip_set_input_callback(slip_input_callback);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void static int
output(void) output(void)
{ {
if(uip_ipaddr_cmp(&last_sender, &UIP_IP_BUF->srcipaddr)) { if(uip_ipaddr_cmp(&last_sender, &UIP_IP_BUF->srcipaddr)) {
@ -115,6 +115,7 @@ output(void)
// PRINTF("SUT: %u\n", uip_len); // PRINTF("SUT: %u\n", uip_len);
slip_send(); slip_send();
} }
return 0;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/

View file

@ -84,7 +84,7 @@ init(void)
slip_set_input_callback(slip_input_callback); slip_set_input_callback(slip_input_callback);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void static int
output(void) output(void)
{ {
if(uip_ipaddr_cmp(&last_sender, &UIP_IP_BUF->srcipaddr)) { if(uip_ipaddr_cmp(&last_sender, &UIP_IP_BUF->srcipaddr)) {
@ -95,6 +95,7 @@ output(void)
PRINTF("SUT: %u\n", uip_len); PRINTF("SUT: %u\n", uip_len);
slip_send(); slip_send();
} }
return 0;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
const struct uip_fallback_interface slip_interface = { const struct uip_fallback_interface slip_interface = {

View file

@ -132,7 +132,7 @@ init(void)
{ {
} }
void mac_LowpanToEthernet(void); void mac_LowpanToEthernet(void);
static void static int
output(void) output(void)
{ {
// if(uip_ipaddr_cmp(&last_sender, &UIP_IP_BUF->srcipaddr)) { // if(uip_ipaddr_cmp(&last_sender, &UIP_IP_BUF->srcipaddr)) {
@ -142,6 +142,7 @@ output(void)
PRINTD("SUT: %u\n", uip_len); PRINTD("SUT: %u\n", uip_len);
mac_LowpanToEthernet(); //bounceback trap is done in lowpanToEthernet mac_LowpanToEthernet(); //bounceback trap is done in lowpanToEthernet
// } // }
return 0;
} }
const struct uip_fallback_interface rpl_interface = { const struct uip_fallback_interface rpl_interface = {
init, output init, output