diff --git a/.travis.yml b/.travis.yml index 60d8db747..d9c98d75d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,3 +68,4 @@ env: - TEST_NAME='compile-tools' - TEST_NAME='native-runs' - TEST_NAME='ipv6' BUILD_COOJA=true + - TEST_NAME='ipv6-nbr' BUILD_COOJA=true diff --git a/arch/cpu/msp430/uip-ipchksum.c b/arch/cpu/msp430/uip-ipchksum.c index e4cb308d0..442c154dc 100644 --- a/arch/cpu/msp430/uip-ipchksum.c +++ b/arch/cpu/msp430/uip-ipchksum.c @@ -51,7 +51,7 @@ uint16_t uip_ipchksum(void) { /* Assumes proper alignement of uip_buf. */ - uint16_t *p = (uint16_t *)&uip_buf[UIP_LLH_LEN]; + uint16_t *p = (uint16_t *)UIP_IP_BUF; register uint16_t sum; sum = p[0]; diff --git a/arch/cpu/native/net/tun6-net.c b/arch/cpu/native/net/tun6-net.c index d46d91d42..f1e8c2e77 100644 --- a/arch/cpu/native/net/tun6-net.c +++ b/arch/cpu/native/net/tun6-net.c @@ -263,7 +263,7 @@ output(const linkaddr_t *localdest) { LOG_DBG("SUT: %u\n", uip_len); if(uip_len > 0) { - return tun_output(&uip_buf[UIP_LLH_LEN], uip_len); + return tun_output(uip_buf, uip_len); } return 0; } @@ -297,7 +297,7 @@ handle_fd(fd_set *rset, fd_set *wset) LOG_INFO("Tun6-handle FD\n"); if(FD_ISSET(tunfd, rset)) { - size = tun_input(&uip_buf[UIP_LLH_LEN], sizeof(uip_buf)); + size = tun_input(uip_buf, sizeof(uip_buf)); LOG_DBG("TUN data incoming read:%d\n", size); uip_len = size; tcpip_input(); diff --git a/arch/cpu/nrf52832/ble/ble-mac.c b/arch/cpu/nrf52832/ble/ble-mac.c index 4fe1ef934..d604a911d 100644 --- a/arch/cpu/nrf52832/ble/ble-mac.c +++ b/arch/cpu/nrf52832/ble/ble-mac.c @@ -347,6 +347,12 @@ off(void) return 1; } /*---------------------------------------------------------------------------*/ +static int +max_payload(void) +{ + return PACKETBUF_SIZE; +} +/*---------------------------------------------------------------------------*/ static void init(void) { @@ -371,7 +377,8 @@ const struct mac_driver ble_ipsp_mac_driver = { send_packet, NULL, on, - off + off, + max_payload }; /*---------------------------------------------------------------------------*/ /** diff --git a/arch/platform/cooja/net/uip-driver.c b/arch/platform/cooja/net/uip-driver.c index 0e7209a6c..fd86cc9c6 100644 --- a/arch/platform/cooja/net/uip-driver.c +++ b/arch/platform/cooja/net/uip-driver.c @@ -48,7 +48,7 @@ static uint8_t uip_driver_send(const linkaddr_t *addr) { - packetbuf_copyfrom(&uip_buf[UIP_LLH_LEN], uip_len); + packetbuf_copyfrom(uip_buf, uip_len); /* XXX we should provide a callback function that is called when the packet is sent. For now, we just supply a NULL pointer. */ @@ -64,9 +64,8 @@ init(void) static void input(void) { - if(packetbuf_datalen() > 0 && - packetbuf_datalen() <= UIP_BUFSIZE - UIP_LLH_LEN) { - memcpy(&uip_buf[UIP_LLH_LEN], packetbuf_dataptr(), packetbuf_datalen()); + if(packetbuf_datalen() > 0 && packetbuf_datalen() <= UIP_BUFSIZE) { + memcpy(uip_buf, packetbuf_dataptr(), packetbuf_datalen()); uip_len = packetbuf_datalen(); tcpip_input(); } diff --git a/arch/platform/jn516x/slip.c b/arch/platform/jn516x/slip.c index 173a14d60..41652e181 100644 --- a/arch/platform/jn516x/slip.c +++ b/arch/platform/jn516x/slip.c @@ -46,7 +46,6 @@ #include #include "net/ipv6/uip.h" -#define BUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN]) #include "dev/slip.h" @@ -117,7 +116,7 @@ unsigned long slip_received, slip_frames; #ifdef SLIP_CONF_RX_BUFSIZE #define RX_BUFSIZE SLIP_CONF_RX_BUFSIZE -#if RX_BUFSIZE < (UIP_BUFSIZE - UIP_LLH_LEN + 16) +#if RX_BUFSIZE < (UIP_BUFSIZE + 16) #error "SLIP_CONF_RX_BUFSIZE too small for UIP_BUFSIZE" #endif @@ -195,7 +194,7 @@ slip_send(void) slip_arch_writeb(SLIP_END); - ptr = &uip_buf[UIP_LLH_LEN]; + ptr = uip_buf; for(i = 0; i < uip_len; ++i) { c = *ptr++; slip_write_char(c); @@ -317,8 +316,7 @@ PROCESS_THREAD(slip_process, ev, data) PROCESS_YIELD_UNTIL(ev == PROCESS_EVENT_POLL); /* Move packet from rxbuf to buffer provided by uIP. */ - uip_len = slip_poll_handler(&uip_buf[UIP_LLH_LEN], - UIP_BUFSIZE - UIP_LLH_LEN); + uip_len = slip_poll_handler(uip_buf, UIP_BUFSIZE); PRINTF("SLIP: recv bytes %u frames RECV: %u. is_full %u, is_dropping %u.\n", end_counter, uip_len, is_full, is_dropping); diff --git a/arch/platform/nrf52dk/contiki-conf.h b/arch/platform/nrf52dk/contiki-conf.h index 7b3b66314..12d1b2fc9 100644 --- a/arch/platform/nrf52dk/contiki-conf.h +++ b/arch/platform/nrf52dk/contiki-conf.h @@ -74,6 +74,10 @@ /* Packet buffer */ #define PACKETBUF_CONF_SIZE 1280 /**< Required IPv6 MTU size */ + +/* Queuebuf */ +#define QUEUEBUF_CONF_ENABLED 0 + /** @} */ /** diff --git a/examples/libs/ipv6-hooks/ipv6-hooks.c b/examples/libs/ipv6-hooks/ipv6-hooks.c index d3ca8861c..8d8561049 100644 --- a/examples/libs/ipv6-hooks/ipv6-hooks.c +++ b/examples/libs/ipv6-hooks/ipv6-hooks.c @@ -10,8 +10,6 @@ #define LOG_MODULE "App" #define LOG_LEVEL LOG_LEVEL_INFO -#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) - /*---------------------------------------------------------------------------*/ PROCESS(ipv6_hooks_process, "IPv6 Hooks"); AUTOSTART_PROCESSES(&ipv6_hooks_process); diff --git a/examples/multicast/sink.c b/examples/multicast/sink.c index 34ad6009d..49180b69a 100644 --- a/examples/multicast/sink.c +++ b/examples/multicast/sink.c @@ -55,8 +55,6 @@ static struct uip_udp_conn *sink_conn; static uint16_t count; -#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) - #if !NETSTACK_CONF_WITH_IPV6 || !UIP_CONF_ROUTER || !UIP_IPV6_MULTICAST || !UIP_CONF_IPV6_RPL #error "This example can not work with the current contiki configuration" #error "Check the values of: NETSTACK_CONF_WITH_IPV6, UIP_CONF_ROUTER, UIP_CONF_IPV6_RPL" diff --git a/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.c b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.c index 287452bb3..101b6441b 100644 --- a/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.c +++ b/examples/platform-specific/cc26x0-cc13x0/cc26x0-web-demo/httpd-simple.c @@ -38,6 +38,7 @@ /*---------------------------------------------------------------------------*/ #include "contiki.h" #include "httpd-simple.h" +#include "net/ipv6/uip-ds6-nbr.h" #include "net/ipv6/uip-ds6-route.h" #include "batmon-sensor.h" #include "lib/sensors.h" @@ -436,8 +437,8 @@ PT_THREAD(generate_index(struct httpd_state *s)) PT_WAIT_THREAD(&s->generate_pt, enqueue_chunk(s, 0, SECTION_OPEN "Neighbors" CONTENT_OPEN)); - for(s->nbr = nbr_table_head(ds6_neighbors); s->nbr != NULL; - s->nbr = nbr_table_next(ds6_neighbors, s->nbr)) { + for(s->nbr = uip_ds6_nbr_head(); s->nbr != NULL; + s->nbr = uip_ds6_nbr_next(s->nbr)) { PT_WAIT_THREAD(&s->generate_pt, enqueue_chunk(s, 0, "\n")); diff --git a/examples/platform-specific/jn516x/tsch/common-conf-jn516x.h b/examples/platform-specific/jn516x/tsch/common-conf-jn516x.h index 568fd4b6d..32f7534e7 100644 --- a/examples/platform-specific/jn516x/tsch/common-conf-jn516x.h +++ b/examples/platform-specific/jn516x/tsch/common-conf-jn516x.h @@ -44,7 +44,7 @@ #define REST_MAX_CHUNK_SIZE 256 /* Network config */ -//#define UIP_CONF_BUFFER_SIZE (REST_MAX_CHUNK_SIZE + UIP_LLH_LEN + UIP_IPUDPH_LEN + COAP_MAX_HEADER_SIZE) +//#define UIP_CONF_BUFFER_SIZE (REST_MAX_CHUNK_SIZE + UIP_IPUDPH_LEN + COAP_MAX_HEADER_SIZE) //#define UIP_CONF_BUFFER_SIZE (REST_MAX_CHUNK_SIZE + 0 + 48 + 70) #define UIP_CONF_BUFFER_SIZE 1280 /* ipv6 required minimum */ diff --git a/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/node.c b/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/node.c index 251b0d135..b3ef311fd 100644 --- a/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/node.c +++ b/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/node.c @@ -50,8 +50,6 @@ #define DEBUG DEBUG_PRINT #include "net/ipv6/uip-debug.h" -#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) - #define INTERVAL (10) #define BLINK_TIME (CLOCK_SECOND/4) diff --git a/examples/platform-specific/nrf52dk/coap-demo/coap-server/coap-server.c b/examples/platform-specific/nrf52dk/coap-demo/coap-server/coap-server.c index 584f54318..9e38d5d3a 100644 --- a/examples/platform-specific/nrf52dk/coap-demo/coap-server/coap-server.c +++ b/examples/platform-specific/nrf52dk/coap-demo/coap-server/coap-server.c @@ -97,7 +97,6 @@ PROCESS_THREAD(er_example_server, ev, data) PRINTF("Starting Erbium Example Server\n"); PRINTF("uIP buffer: %u\n", UIP_BUFSIZE); - PRINTF("LL header: %u\n", UIP_LLH_LEN); PRINTF("IP+UDP header: %u\n", UIP_IPUDPH_LEN); PRINTF("REST max chunk: %u\n", COAP_MAX_CHUNK_SIZE); diff --git a/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c b/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c index 5f2a98e24..4b3279e44 100644 --- a/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c +++ b/examples/platform-specific/zoul/orion/ip64-router/ip64-router.c @@ -45,6 +45,7 @@ #include "contiki-net.h" #include "net/ipv6/uip.h" #include "net/ipv6/uip-ds6.h" +#include "net/ipv6/uip-ds6-nbr.h" #include "net/routing/routing.h" #include "dev/leds.h" #include "ip64/ip64.h" @@ -142,9 +143,9 @@ PT_THREAD(generate_routes(struct httpd_state *s)) #endif ADD("Neighbors
");
 
-  for(nbr = nbr_table_head(ds6_neighbors);
+  for(nbr = uip_ds6_nbr_head();
       nbr != NULL;
-      nbr = nbr_table_next(ds6_neighbors, nbr)) {
+      nbr = uip_ds6_nbr_next(nbr)) {
 
 #if WEBSERVER_CONF_NEIGHBOR_STATUS
 #if BUF_USES_STACK
diff --git a/examples/rpl-border-router/webserver/webserver.c b/examples/rpl-border-router/webserver/webserver.c
index 3658381bf..c4b472837 100644
--- a/examples/rpl-border-router/webserver/webserver.c
+++ b/examples/rpl-border-router/webserver/webserver.c
@@ -32,6 +32,7 @@
 
 #include "contiki.h"
 #include "net/routing/routing.h"
+#include "net/ipv6/uip-ds6-nbr.h"
 #include "net/ipv6/uip-ds6-route.h"
 #include "net/ipv6/uip-sr.h"
 
@@ -90,9 +91,9 @@ PT_THREAD(generate_routes(struct httpd_state *s))
 
   ADD("  Neighbors\n