From 5c0100c9799ae5b7f86848f0a52bd5c546378a6e Mon Sep 17 00:00:00 2001 From: Nicolas Tsiftes Date: Fri, 2 Dec 2011 15:54:49 +0100 Subject: [PATCH] Use rpl headers. --- core/net/tcpip.c | 13 +++++-------- core/net/uip6.c | 8 +++----- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/core/net/tcpip.c b/core/net/tcpip.c index 552f6ccce..4597d682a 100644 --- a/core/net/tcpip.c +++ b/core/net/tcpip.c @@ -78,17 +78,16 @@ void uip_log(char *msg); #ifdef UIP_FALLBACK_INTERFACE extern struct uip_fallback_interface UIP_FALLBACK_INTERFACE; #endif + #if UIP_CONF_IPV6_RPL -void rpl_init(void); -int rpl_update_header_final(uip_ipaddr_t *addr); -#endif /* UIP_CONF_IPV6_RPL */ +#include "rpl/rpl.h" +#endif + process_event_t tcpip_event; #if UIP_CONF_ICMP6 process_event_t tcpip_icmp6_event; #endif /* UIP_CONF_ICMP6 */ -/*static struct tcpip_event_args ev_args;*/ - /*periodic check of active connections*/ static struct etimer periodic; @@ -601,15 +600,13 @@ tcpip_ipv6_output(void) } /* end of next hop determination */ #if UIP_CONF_IPV6_RPL - if (rpl_update_header_final(nexthop)) { + if(rpl_update_header_final(nexthop)) { uip_len = 0; return; } #endif /* UIP_CONF_IPV6_RPL */ if((nbr = uip_ds6_nbr_lookup(nexthop)) == NULL) { - // printf("add1 %d\n", nexthop->u8[15]); if((nbr = uip_ds6_nbr_add(nexthop, NULL, 0, NBR_INCOMPLETE)) == NULL) { - // printf("add n\n"); uip_len = 0; return; } else { diff --git a/core/net/uip6.c b/core/net/uip6.c index 32c154d6a..9c121c3bd 100644 --- a/core/net/uip6.c +++ b/core/net/uip6.c @@ -95,9 +95,7 @@ #endif #if UIP_CONF_IPV6_RPL -void uip_rpl_input(void); -void rpl_update_header_empty(void); -int rpl_verify_header(int uip_ext_opt_offset); +#include "rpl/rpl.h" #endif /* UIP_CONF_IPV6_RPL */ #if UIP_LOGGING == 1 @@ -854,7 +852,7 @@ ext_hdr_options_process(void) #if UIP_CONF_IPV6_RPL case UIP_EXT_HDR_OPT_RPL: PRINTF("Processing RPL option\n"); - if (rpl_verify_header(uip_ext_opt_offset)) { + if(rpl_verify_header(uip_ext_opt_offset)) { PRINTF("RPL Option Error : Dropping Packet"); return 1; } @@ -1120,7 +1118,7 @@ uip_process(u8_t flag) uip_next_hdr = &UIP_IP_BUF->proto; uip_ext_len = 0; uip_ext_bitmap = 0; - if (*uip_next_hdr == UIP_PROTO_HBHO) { + if(*uip_next_hdr == UIP_PROTO_HBHO) { #if UIP_CONF_IPV6_CHECKS uip_ext_bitmap |= UIP_EXT_HDR_BITMAP_HBHO; #endif /*UIP_CONF_IPV6_CHECKS*/