Rework naming and configuration of sicslowpan compression levels

This commit is contained in:
Simon Duquennoy 2017-07-05 19:48:42 +02:00
parent 3acec4a849
commit 1469268d32
13 changed files with 18 additions and 55 deletions

View File

@ -401,10 +401,6 @@ typedef uint32_t rtimer_clock_t;
#define UIP_CONF_MAX_LISTENPORTS 8
/* 6lowpan */
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#ifndef SICSLOWPAN_CONF_COMPRESSION_THRESHOLD
#define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63
#endif
#ifndef SICSLOWPAN_CONF_FRAG
#define SICSLOWPAN_CONF_FRAG 1
#endif

View File

@ -120,7 +120,6 @@
#define UIP_CONF_IPV6_CHECKS 1
#define UIP_CONF_IPV6_REASSEMBLY 0
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#ifndef SICSLOWPAN_CONF_FRAG
#define SICSLOWPAN_CONF_FRAG 1
#define SICSLOWPAN_CONF_MAXAGE 8

View File

@ -126,10 +126,6 @@
#define UIP_CONF_BUFFER_SIZE 1280
#endif
#define SICSLOWPAN_CONF_COMPRESSION_IPV6 0
#define SICSLOWPAN_CONF_COMPRESSION_HC1 1
#define SICSLOWPAN_CONF_COMPRESSION_HC01 2
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#ifndef SICSLOWPAN_CONF_FRAG
#define SICSLOWPAN_CONF_FRAG 1
#define SICSLOWPAN_CONF_MAXAGE 8

View File

@ -91,7 +91,6 @@ typedef unsigned short uip_stats_t;
#define UIP_CONF_ROUTER 1
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#ifndef SICSLOWPAN_CONF_FRAG
#define SICSLOWPAN_CONF_FRAG 1
#define SICSLOWPAN_CONF_MAXAGE 8

View File

@ -65,8 +65,6 @@
/* 6LoWPAN */
#define SICSLOWPAN_CONF_MAC_MAX_PAYLOAD 1280
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 0 /**< Always compress IPv6 packets. */
#define SICSLOWPAN_CONF_FRAG 0 /**< We don't use 6LoWPAN fragmentation as IPSP takes care of that for us.*/
#define SICSLOWPAN_FRAMER_HDRLEN 0 /**< Use fixed header len rather than framer.length() function */

View File

@ -458,10 +458,6 @@ typedef uint32_t rtimer_clock_t;
#define UIP_CONF_MAX_LISTENPORTS 8
/* 6lowpan */
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#ifndef SICSLOWPAN_CONF_COMPRESSION_THRESHOLD
#define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63
#endif
#ifndef SICSLOWPAN_CONF_FRAG
#define SICSLOWPAN_CONF_FRAG 1
#endif

View File

@ -25,12 +25,6 @@
/* Network setup for IPv6 */
#define NETSTACK_CONF_NETWORK sicslowpan_driver
/* Specify a minimum packet size for 6lowpan compression to be
enabled. This is needed for ContikiMAC, which needs packets to be
larger than a specified size, if no ContikiMAC header should be
used. */
#define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63
#ifndef QUEUEBUF_CONF_NUM
#define QUEUEBUF_CONF_NUM 8
#endif
@ -92,7 +86,6 @@
#define UIP_CONF_BUFFER_SIZE 240
#endif
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#ifndef SICSLOWPAN_CONF_FRAG
#define SICSLOWPAN_CONF_FRAG 1
#define SICSLOWPAN_CONF_MAXAGE 8

View File

@ -109,9 +109,7 @@
#define NETSTACK_RADIO_MAX_PAYLOAD_LEN 125
/* 6LoWPAN */
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63
/* 6LoWPAN */
#define SICSLOWPAN_CONF_FRAG 1
#define SICSLOWPAN_CONF_MAXAGE 8
/** @} */

View File

@ -489,10 +489,6 @@ typedef uint32_t rtimer_clock_t;
#define UIP_CONF_MAX_LISTENPORTS 8
/* 6lowpan */
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#ifndef SICSLOWPAN_CONF_COMPRESSION_THRESHOLD
#define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63
#endif
#ifndef SICSLOWPAN_CONF_FRAG
#define SICSLOWPAN_CONF_FRAG 1
#endif

View File

@ -218,18 +218,10 @@
#define SICSLOWPAN_CONF_MAC_MAX_PAYLOAD (127 - 2)
#endif /* SICSLOWPAN_CONF_MAC_MAX_PAYLOAD */
/* SICSLOWPAN_CONF_COMPRESSION_THRESHOLD sets a lower threshold for
when packets should not be compressed. This is used by ContikiMAC,
which requires packets to be larger than a given minimum size. */
#ifndef SICSLOWPAN_CONF_COMPRESSION_THRESHOLD
#define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 0
/* #define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63 */
#endif /* SICSLOWPAN_CONF_COMPRESSION_THRESHOLD */
/* SICSLOWPAN_CONF_COMPRESSION specifies what 6lowpan compression
mechanism to be used. 6lowpan hc06 is the default in Contiki. */
#ifndef SICSLOWPAN_CONF_COMPRESSION
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_IPHC
#endif /* SICSLOWPAN_CONF_COMPRESSION */
#endif /* CONTIKI_DEFAULT_CONF_H */

View File

@ -86,7 +86,7 @@
#ifdef SICSLOWPAN_CONF_COMPRESSION
#define SICSLOWPAN_COMPRESSION SICSLOWPAN_CONF_COMPRESSION
#else /* SICSLOWPAN_CONF_COMPRESSION */
#define SICSLOWPAN_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#define SICSLOWPAN_COMPRESSION SICSLOWPAN_COMPRESSION_IPHC
#endif /* SICSLOWPAN_CONF_COMPRESSION */
#define GET16(ptr,index) (((uint16_t)((ptr)[index] << 8)) | ((ptr)[(index) + 1]))
@ -502,7 +502,7 @@ set_packet_attrs(void)
#if SICSLOWPAN_COMPRESSION >= SICSLOWPAN_COMPRESSION_HC06
#if SICSLOWPAN_COMPRESSION >= SICSLOWPAN_COMPRESSION_IPHC
/** \name variables specific to HC06 and more recent versions
* @{
*/
@ -1344,9 +1344,9 @@ uncompress_hdr_iphc(uint8_t *buf, uint16_t ip_len)
}
}
/** @} */
#endif /* SICSLOWPAN_COMPRESSION >= SICSLOWPAN_COMPRESSION_HC06 */
#endif /* SICSLOWPAN_COMPRESSION >= SICSLOWPAN_COMPRESSION_IPHC */
#if SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_PAGE1
#if SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_6LORH
/*--------------------------------------------------------------------*/
/**
* \brief Adds Paging dispatch byte
@ -1367,7 +1367,7 @@ add_6lorh_hdr(void)
{
/* 6LoRH is not implemented yet */
}
#endif /* SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_PAGE1 */
#endif /* SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_6LORH */
/*--------------------------------------------------------------------*/
/**
@ -1534,17 +1534,17 @@ output(const uip_lladdr_t *localdest)
#if SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_IPV6
compress_hdr_ipv6(&dest);
#endif /* SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_IPV6 */
#if SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_PAGE1
#if SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_6LORH
/* Add 6LoRH headers before IPHC. Only needed on routed traffic
(non link-local). */
if(!uip_is_addr_linklocal(&UIP_IP_BUF->destipaddr)) {
add_paging_dispatch(1);
add_6lorh_hdr();
}
#endif /* SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_PAGE1 */
#if SICSLOWPAN_COMPRESSION >= SICSLOWPAN_COMPRESSION_HC06
#endif /* SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_6LORH */
#if SICSLOWPAN_COMPRESSION >= SICSLOWPAN_COMPRESSION_IPHC
compress_hdr_iphc(&dest);
#endif /* SICSLOWPAN_COMPRESSION >= SICSLOWPAN_COMPRESSION_HC06 */
#endif /* SICSLOWPAN_COMPRESSION >= SICSLOWPAN_COMPRESSION_IPHC */
LOG_INFO("output: header of len %d\n", packetbuf_hdr_len);
/* Calculate NETSTACK_FRAMER's header length, that will be added in the NETSTACK_MAC.
@ -1954,7 +1954,7 @@ sicslowpan_init(void)
tcpip_set_outputfunc(output);
#if SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_HC06
#if SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_IPHC
/* Preinitialize any address contexts for better header compression
* (Saves up to 13 bytes per 6lowpan packet)
* The platform contiki-conf.h file can override this using e.g.
@ -1996,7 +1996,7 @@ sicslowpan_init(void)
}
#endif /* SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS > 1 */
#endif /* SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_HC06 */
#endif /* SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_IPHC */
}
/*--------------------------------------------------------------------*/
int

View File

@ -69,10 +69,10 @@
* @{
*/
#define SICSLOWPAN_COMPRESSION_IPV6 0 /* No compression */
/* No longer supported: #define SICSLOWPAN_CONF_COMPRESSION_HC1 1*/
#define SICSLOWPAN_COMPRESSION_HC06 2 /* RFC 6282 */
#define SICSLOWPAN_COMPRESSION_PAGE1 3 /* RFC 8025 for paging dispatch,
* draft-ietf-6lo-routin-dispatch-05 for 6LoRH */
#define SICSLOWPAN_COMPRESSION_IPHC 1 /* RFC 6282 */
#define SICSLOWPAN_COMPRESSION_6LORH 2 /* RFC 8025 for paging dispatch,
* draft-ietf-6lo-routin-dispatch-05 for 6LoRH. 6LoRH is not
* implemented yet -- only support for paging dispatch. */
/** @} */
/**

View File

@ -471,7 +471,7 @@ and replace the line<BR>
\endcode
with
\code
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_IPHC
\endcode
Recompile and load Contiki for both the RAVEN ATmega1284P and RZ USB