From 1d483a5da4ec890a2bd65e63e37684e6717201ac Mon Sep 17 00:00:00 2001 From: c_oflynn Date: Tue, 9 Mar 2010 15:18:03 +0000 Subject: [PATCH] Fix UDP compression to work per hc-06. More commits to come to fix Traffic Class stuff... --- core/net/sicslowpan.c | 16 +++++++++++++--- core/net/sicslowpan.h | 10 ++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/core/net/sicslowpan.c b/core/net/sicslowpan.c index e46681edc..32f672c1a 100644 --- a/core/net/sicslowpan.c +++ b/core/net/sicslowpan.c @@ -32,7 +32,7 @@ * * This file is part of the Contiki operating system. * - * $Id: sicslowpan.c,v 1.21 2010/02/28 08:29:42 adamdunkels Exp $ + * $Id: sicslowpan.c,v 1.22 2010/03/09 15:18:03 c_oflynn Exp $ */ /** * \file @@ -46,6 +46,17 @@ * \author Joakim Eriksson */ +/** + * FOR HC-06 COMPLIANCE TODO: + * -Add compression options to UDP, currently only supports + * both ports compressed or both ports elided + * + * -Fix traffic class/flow/ECN/DCSP processing, doesn't work + * per hc-06 + * + * -Add stateless multicast option + */ + #include #include "contiki.h" @@ -882,9 +893,8 @@ uncompress_hdr_hc06(u16_t ip_len) { /* Next header processing - continued */ if((RIME_IPHC_BUF[0] & SICSLOWPAN_IPHC_NH_C)) { - /* TODO: check if this is correct in hc-06 */ /* The next header is compressed, NHC is following */ - if((*hc06_ptr & 0xFC) == SICSLOWPAN_NHC_UDP_ID) { + if((*hc06_ptr & SICSLOWPAN_NDC_UDP_MASK) == SICSLOWPAN_NHC_UDP_ID) { SICSLOWPAN_IP_BUF->proto = UIP_PROTO_UDP; switch(*hc06_ptr) { case SICSLOWPAN_NHC_UDP_C: diff --git a/core/net/sicslowpan.h b/core/net/sicslowpan.h index 9c36d84bd..3773f0526 100644 --- a/core/net/sicslowpan.h +++ b/core/net/sicslowpan.h @@ -33,7 +33,7 @@ * * This file is part of the Contiki operating system. * - * $Id: sicslowpan.h,v 1.8 2010/02/25 15:50:58 joxe Exp $ + * $Id: sicslowpan.h,v 1.9 2010/03/09 15:18:03 c_oflynn Exp $ */ /** * \file @@ -134,13 +134,15 @@ /** @} */ +#define SICSLOWPAN_NDC_UDP_MASK 0xF8 + /** * \name LOWPAN_UDP encoding (works together with IPHC) * @{ */ -#define SICSLOWPAN_NHC_UDP_ID 0xF8 -#define SICSLOWPAN_NHC_UDP_C 0xFB -#define SICSLOWPAN_NHC_UDP_I 0xF8 +#define SICSLOWPAN_NHC_UDP_ID 0xF0 +#define SICSLOWPAN_NHC_UDP_C 0xF3 +#define SICSLOWPAN_NHC_UDP_I 0xF0 /** @} */