From bd4233a9536a9776d0e752d68f142a8fb7dc3154 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Mon, 1 Dec 2014 15:17:00 +0100 Subject: [PATCH 01/14] Cleanup packetbuf: use rime attributes and addresses only when rime is enabled. Saves 32 byte per queuebuf in the non-rime case. --- apps/powertrace/powertrace.c | 4 ++-- core/net/ipv4/uip-over-mesh.c | 2 ++ core/net/mac/contikimac/contikimac.c | 7 +++++-- core/net/mac/cxmac/cxmac.c | 4 +++- core/net/packetbuf.h | 12 +++++++++++- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/apps/powertrace/powertrace.c b/apps/powertrace/powertrace.c index a060a06f9..139d96af8 100644 --- a/apps/powertrace/powertrace.c +++ b/apps/powertrace/powertrace.c @@ -283,7 +283,7 @@ output_sniffer(int mac_status) add_packet_stats(OUTPUT); } /*---------------------------------------------------------------------------*/ -#if ! NETSTACK_CONF_WITH_IPV6 +#if NETSTACK_CONF_WITH_RIME static void sniffprint(char *prefix, int seqno) { @@ -347,7 +347,7 @@ powertrace_printsniff(powertrace_onoff_t onoff) break; } } -#endif +#endif /* NETSTACK_CONF_WITH_RIME */ /*---------------------------------------------------------------------------*/ RIME_SNIFFER(powersniff, input_sniffer, output_sniffer); /*---------------------------------------------------------------------------*/ diff --git a/core/net/ipv4/uip-over-mesh.c b/core/net/ipv4/uip-over-mesh.c index 8fe373238..92c5dbfd4 100644 --- a/core/net/ipv4/uip-over-mesh.c +++ b/core/net/ipv4/uip-over-mesh.c @@ -260,7 +260,9 @@ uip_over_mesh_send(void) an underlying power-saving MAC layer knows that it should be waiting for an ACK. */ if(BUF->proto == UIP_PROTO_TCP) { +#if NETSTACK_CONF_WITH_RIME packetbuf_set_attr(PACKETBUF_ATTR_ERELIABLE, 1); +#endif /* NETSTACK_CONF_WITH_RIME */ packetbuf_set_attr(PACKETBUF_ATTR_RELIABLE, 1); /* packetbuf_set_attr(PACKETBUF_ATTR_PACKET_TYPE, PACKETBUF_ATTR_PACKET_TYPE_STREAM);*/ } diff --git a/core/net/mac/contikimac/contikimac.c b/core/net/mac/contikimac/contikimac.c index ec52e1256..cdfffc13b 100644 --- a/core/net/mac/contikimac/contikimac.c +++ b/core/net/mac/contikimac/contikimac.c @@ -546,8 +546,11 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr, packetbuf_addr(PACKETBUF_ADDR_RECEIVER)->u8[1]); #endif /* NETSTACK_CONF_WITH_IPV6 */ } - is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) || - packetbuf_attr(PACKETBUF_ATTR_ERELIABLE); + is_reliable = packetbuf_attr(PACKETBUF_ATTR_RELIABLE) +#if NETSTACK_CONF_WITH_RIME + || packetbuf_attr(PACKETBUF_ATTR_ERELIABLE) +#endif /* NETSTACK_CONF_WITH_RIME */ + ; if(!packetbuf_attr(PACKETBUF_ATTR_IS_CREATED_AND_SECURED)) { packetbuf_set_attr(PACKETBUF_ATTR_MAC_ACK, 1); diff --git a/core/net/mac/cxmac/cxmac.c b/core/net/mac/cxmac/cxmac.c index acedf8dfe..ebf7651dd 100644 --- a/core/net/mac/cxmac/cxmac.c +++ b/core/net/mac/cxmac/cxmac.c @@ -625,7 +625,9 @@ send_packet(void) that will need an upper layer ACK (as signified by the PACKETBUF_ATTR_RELIABLE packet attribute), we keep the radio on. */ if(got_strobe_ack && (packetbuf_attr(PACKETBUF_ATTR_RELIABLE) || - packetbuf_attr(PACKETBUF_ATTR_ERELIABLE) || +#if NETSTACK_CONF_WITH_RIME + packetbuf_attr(PACKETBUF_ATTR_ERELIABLE) || +#endif /* NETSTACK_CONF_WITH_RIME */ packetbuf_attr(PACKETBUF_ATTR_PACKET_TYPE) == PACKETBUF_ATTR_PACKET_TYPE_STREAM)) { on(); /* Wait for ACK packet */ diff --git a/core/net/packetbuf.h b/core/net/packetbuf.h index 86e44bb16..048493897 100644 --- a/core/net/packetbuf.h +++ b/core/net/packetbuf.h @@ -354,9 +354,11 @@ enum { PACKETBUF_ATTR_RELIABLE, PACKETBUF_ATTR_PACKET_ID, PACKETBUF_ATTR_PACKET_TYPE, +#if NETSTACK_CONF_WITH_RIME PACKETBUF_ATTR_REXMIT, PACKETBUF_ATTR_MAX_REXMIT, PACKETBUF_ATTR_NUM_REXMIT, +#endif /* NETSTACK_CONF_WITH_RIME */ PACKETBUF_ATTR_PENDING, PACKETBUF_ATTR_FRAME_TYPE, #if LLSEC802154_SECURITY_LEVEL @@ -371,18 +373,22 @@ enum { #endif /* LLSEC802154_SECURITY_LEVEL */ /* Scope 2 attributes: used between end-to-end nodes. */ +#if NETSTACK_CONF_WITH_RIME PACKETBUF_ATTR_HOPS, PACKETBUF_ATTR_TTL, PACKETBUF_ATTR_EPACKET_ID, PACKETBUF_ATTR_EPACKET_TYPE, PACKETBUF_ATTR_ERELIABLE, +#endif /* NETSTACK_CONF_WITH_RIME */ /* These must be last */ PACKETBUF_ADDR_SENDER, PACKETBUF_ADDR_RECEIVER, +#if NETSTACK_CONF_WITH_RIME PACKETBUF_ADDR_ESENDER, PACKETBUF_ADDR_ERECEIVER, - +#endif /* NETSTACK_CONF_WITH_RIME */ + PACKETBUF_ATTR_MAX }; @@ -404,7 +410,11 @@ enum { }; #endif /* LLSEC802154_USES_EXPLICIT_KEYS */ +#if NETSTACK_CONF_WITH_RIME #define PACKETBUF_NUM_ADDRS 4 +#else /* NETSTACK_CONF_WITH_RIME */ +#define PACKETBUF_NUM_ADDRS 2 +#endif /* NETSTACK_CONF_WITH_RIME */ #define PACKETBUF_NUM_ATTRS (PACKETBUF_ATTR_MAX - PACKETBUF_NUM_ADDRS) #define PACKETBUF_ADDR_FIRST PACKETBUF_ADDR_SENDER From 0dbed5b91995c6fc9be476e371a7d96de6c75c10 Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Sat, 22 Nov 2014 21:49:05 +0100 Subject: [PATCH 02/14] Allow specifying a max outgoing segment size per TCP socket --- core/net/ip/tcp-socket.c | 5 +++-- core/net/ip/tcp-socket.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/net/ip/tcp-socket.c b/core/net/ip/tcp-socket.c index f914ae206..aa6e7656f 100644 --- a/core/net/ip/tcp-socket.c +++ b/core/net/ip/tcp-socket.c @@ -56,10 +56,10 @@ call_event(struct tcp_socket *s, tcp_socket_event_t event) static void senddata(struct tcp_socket *s) { - int len; + int len = MIN(s->output_data_max_seg, uip_mss()); if(s->output_data_len > 0) { - len = MIN(s->output_data_len, uip_mss()); + len = MIN(s->output_data_len, len); s->output_data_send_nxt = len; uip_send(s->output_data_ptr, len); } @@ -255,6 +255,7 @@ tcp_socket_register(struct tcp_socket *s, void *ptr, s->input_data_maxlen = input_databuf_len; s->output_data_ptr = output_databuf; s->output_data_maxlen = output_databuf_len; + s->output_data_max_seg = uip_mss(); s->input_callback = input_callback; s->event_callback = event_callback; list_add(socketlist, s); diff --git a/core/net/ip/tcp-socket.h b/core/net/ip/tcp-socket.h index aea678049..208bc8288 100644 --- a/core/net/ip/tcp-socket.h +++ b/core/net/ip/tcp-socket.h @@ -95,6 +95,7 @@ struct tcp_socket { uint16_t output_data_maxlen; uint16_t output_data_len; uint16_t output_data_send_nxt; + uint16_t output_data_max_seg; uint8_t flags; uint16_t listen_port; From 99513f188911b4972dc0688df03366d0bfa6e743 Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Mon, 27 Oct 2014 18:53:54 +0000 Subject: [PATCH 03/14] Fill IPv6->Next-Hdr field for outgoing RSTs --- core/net/ipv6/uip6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/net/ipv6/uip6.c b/core/net/ipv6/uip6.c index 15c2dd7d0..2debd54d7 100644 --- a/core/net/ipv6/uip6.c +++ b/core/net/ipv6/uip6.c @@ -2239,8 +2239,6 @@ uip_process(uint8_t flag) UIP_TCP_BUF->seqno[2] = uip_connr->snd_nxt[2]; UIP_TCP_BUF->seqno[3] = uip_connr->snd_nxt[3]; - UIP_IP_BUF->proto = UIP_PROTO_TCP; - UIP_TCP_BUF->srcport = uip_connr->lport; UIP_TCP_BUF->destport = uip_connr->rport; @@ -2262,6 +2260,8 @@ uip_process(uint8_t flag) } tcp_send_noconn: + UIP_IP_BUF->proto = UIP_PROTO_TCP; + UIP_IP_BUF->ttl = uip_ds6_if.cur_hop_limit; UIP_IP_BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8); UIP_IP_BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff); From 73a133373a42f74fa5822cbb9b8e9024c6b828b8 Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Mon, 8 Dec 2014 22:30:07 +0000 Subject: [PATCH 04/14] Change CC2530DK default PAN ID to 0xABCD and make it configurable by project-conf.h --- platform/cc2530dk/contiki-conf.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/cc2530dk/contiki-conf.h b/platform/cc2530dk/contiki-conf.h index 8a11ca816..ef933dc1c 100644 --- a/platform/cc2530dk/contiki-conf.h +++ b/platform/cc2530dk/contiki-conf.h @@ -193,7 +193,9 @@ #define NETSTACK_CONF_RADIO cc2530_rf_driver /* RF Config */ -#define IEEE802154_CONF_PANID 0x5449 /* TI */ +#ifndef IEEE802154_CONF_PANID +#define IEEE802154_CONF_PANID 0xABCD +#endif #ifndef CC2530_RF_CONF_CHANNEL #define CC2530_RF_CONF_CHANNEL 25 From 8fe5456588a69b5b70d8b8fb1b8902ebbab6d29a Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Mon, 8 Dec 2014 22:32:55 +0000 Subject: [PATCH 05/14] Change default PAN ID for the CC2538DK platform to 0xABCD --- platform/cc2538dk/contiki-conf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/cc2538dk/contiki-conf.h b/platform/cc2538dk/contiki-conf.h index 20cee3614..84d78d9a1 100644 --- a/platform/cc2538dk/contiki-conf.h +++ b/platform/cc2538dk/contiki-conf.h @@ -390,7 +390,7 @@ typedef uint32_t rtimer_clock_t; */ /* RF Config */ #ifndef IEEE802154_CONF_PANID -#define IEEE802154_CONF_PANID 0x5449 /**< Default PAN ID: TI */ +#define IEEE802154_CONF_PANID 0xABCD #endif #ifndef CC2538_RF_CONF_CHANNEL From ffc27061fe84c40378bfc314de846f229deea1a9 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Tue, 9 Dec 2014 08:10:03 +0100 Subject: [PATCH 06/14] Correctly set the proto field for the case when tcp_send_noconn is called without tcp_send being called --- core/net/ipv4/uip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/net/ipv4/uip.c b/core/net/ipv4/uip.c index d27287f38..f1bb7257a 100644 --- a/core/net/ipv4/uip.c +++ b/core/net/ipv4/uip.c @@ -1875,8 +1875,6 @@ uip_process(uint8_t flag) BUF->seqno[2] = uip_connr->snd_nxt[2]; BUF->seqno[3] = uip_connr->snd_nxt[3]; - BUF->proto = UIP_PROTO_TCP; - BUF->srcport = uip_connr->lport; BUF->destport = uip_connr->rport; @@ -1893,6 +1891,8 @@ uip_process(uint8_t flag) } tcp_send_noconn: + BUF->proto = UIP_PROTO_TCP; + BUF->ttl = UIP_TTL; #if NETSTACK_CONF_WITH_IPV6 /* For IPv6, the IP length field does not include the IPv6 IP header From 1bddbae297036efc57894ec548020aeccb0550cc Mon Sep 17 00:00:00 2001 From: Luis Alves Date: Tue, 9 Dec 2014 22:06:12 +0000 Subject: [PATCH 07/14] rf230bb: Fix missing ')' and indentation. --- cpu/avr/radio/rf230bb/rf230bb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpu/avr/radio/rf230bb/rf230bb.c b/cpu/avr/radio/rf230bb/rf230bb.c index e3ed931f1..e4181868c 100644 --- a/cpu/avr/radio/rf230bb/rf230bb.c +++ b/cpu/avr/radio/rf230bb/rf230bb.c @@ -1679,7 +1679,7 @@ rf230_cca(void) /* Use ED register to determine result. 77dBm is poweron csma default.*/ #ifdef RF230_CONF_CCA_THRES - if (hal_register_read(RG_PHY_ED_LEVEL)<(91+RF230_CONF_CCA_THRES) cca=0xff; + if (hal_register_read(RG_PHY_ED_LEVEL)<(91+RF230_CONF_CCA_THRES)) cca=0xff; #else if (hal_register_read(RG_PHY_ED_LEVEL)<(91-77)) cca=0xff; #endif @@ -1701,9 +1701,9 @@ rf230_cca(void) /* If already in receive mode can read the current ED register without delay */ /* CCA energy threshold = -91dB + 2*SR_CCA_ED_THRESH. Reset defaults to -77dB */ #ifdef RF230_CONF_CCA_THRES - if (hal_register_read(RG_PHY_ED_LEVEL)<(91+RF230_CONF_CCA_THRES) cca=0xff; + if (hal_register_read(RG_PHY_ED_LEVEL)<(91+RF230_CONF_CCA_THRES)) cca=0xff; #else - if (hal_register_read(RG_PHY_ED_LEVEL)<(91-77)) cca=0xff; + if (hal_register_read(RG_PHY_ED_LEVEL)<(91-77)) cca=0xff; #endif #endif From 542738192f6be404b44dbfef6b1242529cdeed35 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Wed, 10 Dec 2014 09:48:19 +0100 Subject: [PATCH 08/14] Bugfix: uip_mss() isn't set until the connection is connected, so we can't set it during socket registration --- core/net/ip/tcp-socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/net/ip/tcp-socket.c b/core/net/ip/tcp-socket.c index aa6e7656f..44010ce1c 100644 --- a/core/net/ip/tcp-socket.c +++ b/core/net/ip/tcp-socket.c @@ -148,12 +148,14 @@ appcall(void *state) s->listen_port != 0 && s->listen_port == uip_htons(uip_conn->lport)) { s->flags &= ~TCP_SOCKET_FLAGS_LISTENING; + s->output_data_max_seg = uip_mss(); tcp_markconn(uip_conn, s); call_event(s, TCP_SOCKET_CONNECTED); break; } } } else { + s->output_data_max_seg = uip_mss(); call_event(s, TCP_SOCKET_CONNECTED); } @@ -255,7 +257,6 @@ tcp_socket_register(struct tcp_socket *s, void *ptr, s->input_data_maxlen = input_databuf_len; s->output_data_ptr = output_databuf; s->output_data_maxlen = output_databuf_len; - s->output_data_max_seg = uip_mss(); s->input_callback = input_callback; s->event_callback = event_callback; list_add(socketlist, s); From 9baa378c975edde6c90e5d79bf3ba186ccadd77f Mon Sep 17 00:00:00 2001 From: Bertrand Bonnefoy-Claudet Date: Fri, 12 Dec 2014 19:17:46 +0100 Subject: [PATCH 09/14] usb/rndis: Add parentheses to an unsafe macro --- cpu/avr/dev/usb/rndis/rndis_task.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/avr/dev/usb/rndis/rndis_task.h b/cpu/avr/dev/usb/rndis/rndis_task.h index 28148f1da..b77682790 100644 --- a/cpu/avr/dev/usb/rndis/rndis_task.h +++ b/cpu/avr/dev/usb/rndis/rndis_task.h @@ -56,7 +56,7 @@ //_____ M A C R O S ________________________________________________________ -#define USB_ETH_MTU UIP_BUFSIZE+4 +#define USB_ETH_MTU (UIP_BUFSIZE + 4) /*! Hook Documentation From 3a92b0552e680110f648c3288b8a9950c84e4158 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Thu, 18 Dec 2014 21:14:47 +0100 Subject: [PATCH 10/14] Disable the ev-aducrf101mkxz compile tests as they currently break travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 386829b5d..bb3900287 100644 --- a/.travis.yml +++ b/.travis.yml @@ -115,6 +115,6 @@ env: - BUILD_TYPE='compile-8051-ports' BUILD_CATEGORY='compile' BUILD_ARCH='8051' - BUILD_TYPE='compile-arm-apcs-ports' BUILD_CATEGORY='compile' BUILD_ARCH='arm-apcs' - BUILD_TYPE='compile-6502-ports' BUILD_CATEGORY='compile' BUILD_ARCH='6502' - - BUILD_TYPE='compile-arm-ports' BUILD_CATEGORY='compile' BUILD_ARCH='arm' +# - BUILD_TYPE='compile-arm-ports' BUILD_CATEGORY='compile' BUILD_ARCH='arm' - BUILD_TYPE='slip-radio' MAKE_TARGETS='cooja' - BUILD_TYPE='llsec' MAKE_TARGETS='cooja' From b088326b5e319a76e02fde0f65ed2b89c98cabf1 Mon Sep 17 00:00:00 2001 From: Jelmer Tiete Date: Fri, 19 Dec 2014 04:14:34 -0500 Subject: [PATCH 11/14] Corrected the register offset value of ANA_REGS_IVCTRL. TI was using the address offset instead of the physical address in their header file. --- cpu/cc2538/dev/ana-regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/cc2538/dev/ana-regs.h b/cpu/cc2538/dev/ana-regs.h index 1fb8496fa..e8f84a46a 100644 --- a/cpu/cc2538/dev/ana-regs.h +++ b/cpu/cc2538/dev/ana-regs.h @@ -43,7 +43,7 @@ * \name ANA_REGS register offsets * @{ */ -#define ANA_REGS_IVCTRL 0x00000004 +#define ANA_REGS_IVCTRL 0x400D6004 /** @} */ /*---------------------------------------------------------------------------*/ /** From ccbfa388f69089989445d0959ca871745596fbe3 Mon Sep 17 00:00:00 2001 From: Laurent Deru Date: Thu, 16 Jan 2014 09:24:55 +0100 Subject: [PATCH 12/14] Add more RPL stats --- core/net/rpl/rpl-dag.c | 1 + core/net/rpl/rpl-ext-header.c | 2 ++ core/net/rpl/rpl-private.h | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/core/net/rpl/rpl-dag.c b/core/net/rpl/rpl-dag.c index 53ba956fa..eb92e2f10 100644 --- a/core/net/rpl/rpl-dag.c +++ b/core/net/rpl/rpl-dag.c @@ -332,6 +332,7 @@ rpl_repair_root(uint8_t instance_id) PRINTF("RPL: rpl_repair_root triggered but not root\n"); return 0; } + RPL_STAT(rpl_stats.root_repairs++); RPL_LOLLIPOP_INCREMENT(instance->current_dag->version); RPL_LOLLIPOP_INCREMENT(instance->dtsn_out); diff --git a/core/net/rpl/rpl-ext-header.c b/core/net/rpl/rpl-ext-header.c index 5bc03ce25..964caa96f 100644 --- a/core/net/rpl/rpl-ext-header.c +++ b/core/net/rpl/rpl-ext-header.c @@ -137,12 +137,14 @@ rpl_verify_header(int uip_ext_opt_offset) sender_rank, instance->current_dag->rank, sender_closer); if(UIP_EXT_HDR_OPT_RPL_BUF->flags & RPL_HDR_OPT_RANK_ERR) { + RPL_STAT(rpl_stats.loop_errors++); PRINTF("RPL: Rank error signalled in RPL option!\n"); /* Packet must be dropped and dio trickle timer reset, see RFC6550 - 11.2.2.2 */ rpl_reset_dio_timer(instance); return 1; } PRINTF("RPL: Single error tolerated\n"); + RPL_STAT(rpl_stats.loop_warnings++); UIP_EXT_HDR_OPT_RPL_BUF->flags |= RPL_HDR_OPT_RANK_ERR; return 0; } diff --git a/core/net/rpl/rpl-private.h b/core/net/rpl/rpl-private.h index 7b26c3730..a9ca3f375 100644 --- a/core/net/rpl/rpl-private.h +++ b/core/net/rpl/rpl-private.h @@ -242,6 +242,10 @@ struct rpl_stats { uint16_t malformed_msgs; uint16_t resets; uint16_t parent_switch; + uint16_t forward_errors; + uint16_t loop_errors; + uint16_t loop_warnings; + uint16_t root_repairs; }; typedef struct rpl_stats rpl_stats_t; From bb1e0c1cbca5f95e7603738cb9a3d88940c3a96b Mon Sep 17 00:00:00 2001 From: Laurent Deru Date: Mon, 15 Dec 2014 17:34:22 +0100 Subject: [PATCH 13/14] Add missing return values in rpl_update_header_empty() --- core/net/rpl/rpl-ext-header.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/net/rpl/rpl-ext-header.c b/core/net/rpl/rpl-ext-header.c index 5bc03ce25..5bf8de271 100644 --- a/core/net/rpl/rpl-ext-header.c +++ b/core/net/rpl/rpl-ext-header.c @@ -194,12 +194,12 @@ rpl_update_header_empty(void) if(UIP_HBHO_BUF->len != RPL_HOP_BY_HOP_LEN - 8) { PRINTF("RPL: Hop-by-hop extension header has wrong size\n"); uip_ext_len = last_uip_ext_len; - return; + return 0; } if(UIP_EXT_HDR_OPT_RPL_BUF->opt_type != UIP_EXT_HDR_OPT_RPL) { PRINTF("RPL: Non RPL Hop-by-hop option support not implemented\n"); uip_ext_len = last_uip_ext_len; - return; + return 0; } if(UIP_EXT_HDR_OPT_RPL_BUF->opt_len != RPL_HDR_OPT_LEN) { PRINTF("RPL: RPL Hop-by-hop option has wrong length\n"); From f28e9587ed21cf2fd773c010cab3f7bf415b969e Mon Sep 17 00:00:00 2001 From: Laurent Deru Date: Wed, 15 May 2013 16:05:20 +0200 Subject: [PATCH 14/14] Make RA configuration parameters user configurable --- core/net/ipv6/uip-nd6.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/net/ipv6/uip-nd6.h b/core/net/ipv6/uip-nd6.h index 4be5d1741..0ece86522 100644 --- a/core/net/ipv6/uip-nd6.h +++ b/core/net/ipv6/uip-nd6.h @@ -76,15 +76,27 @@ #else #define UIP_ND6_SEND_NA UIP_CONF_ND6_SEND_NA #endif +#ifndef UIP_CONF_ND6_MAX_RA_INTERVAL #define UIP_ND6_MAX_RA_INTERVAL 600 +#else +#define UIP_ND6_MAX_RA_INTERVAL UIP_CONF_ND6_MAX_RA_INTERVAL +#endif +#ifndef UIP_CONF_ND6_MIN_RA_INTERVAL #define UIP_ND6_MIN_RA_INTERVAL (UIP_ND6_MAX_RA_INTERVAL / 3) +#else +#define UIP_ND6_MIN_RA_INTERVAL UIP_CONF_ND6_MIN_RA_INTERVAL +#endif #define UIP_ND6_M_FLAG 0 #define UIP_ND6_O_FLAG 0 #define UIP_ND6_ROUTER_LIFETIME 3 * UIP_ND6_MAX_RA_INTERVAL #define UIP_ND6_MAX_INITIAL_RA_INTERVAL 16 /*seconds*/ #define UIP_ND6_MAX_INITIAL_RAS 3 /*transmissions*/ +#ifndef UIP_CONF_ND6_MIN_DELAY_BETWEEN_RAS #define UIP_ND6_MIN_DELAY_BETWEEN_RAS 3 /*seconds*/ +#else +#define UIP_ND6_MIN_DELAY_BETWEEN_RAS UIP_CONF_ND6_MIN_DELAY_BETWEEN_RAS +#endif //#define UIP_ND6_MAX_RA_DELAY_TIME 0.5 /*seconds*/ #define UIP_ND6_MAX_RA_DELAY_TIME_MS 500 /*milli seconds*/ /** @} */