made DIOs and OCP 09 compliant
This commit is contained in:
parent
8f1988e7fc
commit
1095997b66
2 changed files with 11 additions and 23 deletions
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: rpl-icmp6.c,v 1.19 2010/06/08 16:21:54 nvt-se Exp $
|
||||
* $Id: rpl-icmp6.c,v 1.20 2010/06/12 10:55:46 joxe Exp $
|
||||
*/
|
||||
/**
|
||||
* \file
|
||||
|
@ -271,14 +271,10 @@ dio_input(void)
|
|||
dio.dag_redund = buffer[i + 5];
|
||||
dio.dag_max_rankinc = (buffer[i + 6] << 8) | buffer[i + 7];
|
||||
dio.dag_min_hoprankinc = (buffer[i + 8] << 8) | buffer[i + 9];
|
||||
PRINTF("RPL: DIO trickle timer:dbl=%d, min=%d red=%d maxinc=%d mininc=%d\n",
|
||||
dio.dag_intdoubl,
|
||||
dio.dag_intmin, dio.dag_redund,
|
||||
dio.dag_max_rankinc, dio.dag_min_hoprankinc);
|
||||
break;
|
||||
case RPL_DIO_SUBOPT_OCP:
|
||||
dio.ocp = buffer[i + 2] << 8 | buffer[i + 3];
|
||||
PRINTF("RPL: DAG OCP Sub-opt received OCP = %u\n", dio.ocp);
|
||||
dio.ocp = (buffer[i + 10] << 8) | buffer[i + 11];
|
||||
PRINTF("RPL: DIO Conf:dbl=%d, min=%d red=%d maxinc=%d mininc=%d ocp=%d\n",
|
||||
dio.dag_intdoubl, dio.dag_intmin, dio.dag_redund,
|
||||
dio.dag_max_rankinc, dio.dag_min_hoprankinc, dio.ocp);
|
||||
break;
|
||||
case RPL_DIO_SUBOPT_PREFIX_INFO:
|
||||
if(len != 32) {
|
||||
|
@ -331,15 +327,9 @@ dio_output(rpl_dag_t *dag, uip_ipaddr_t *uc_addr)
|
|||
memcpy(buffer + pos, &dag->dag_id, sizeof(dag->dag_id));
|
||||
pos += 16;
|
||||
|
||||
/* The objective function object must appear first. */
|
||||
buffer[pos++] = RPL_DIO_SUBOPT_OCP;
|
||||
buffer[pos++] = 2;
|
||||
buffer[pos++] = dag->of->ocp >> 8;
|
||||
buffer[pos++] = dag->of->ocp & 0xff;
|
||||
|
||||
/* always add a sub-option for DAG configuration */
|
||||
buffer[pos++] = RPL_DIO_SUBOPT_DAG_CONF;
|
||||
buffer[pos++] = 8;
|
||||
buffer[pos++] = 10;
|
||||
buffer[pos++] = 0; /* PCS */
|
||||
buffer[pos++] = dag->dio_intdoubl;
|
||||
buffer[pos++] = dag->dio_intmin;
|
||||
|
@ -348,6 +338,9 @@ dio_output(rpl_dag_t *dag, uip_ipaddr_t *uc_addr)
|
|||
buffer[pos++] = dag->max_rankinc & 0xff;
|
||||
buffer[pos++] = dag->min_hoprankinc >> 8;
|
||||
buffer[pos++] = dag->min_hoprankinc & 0xff;
|
||||
/* OCP is now last in the DAG_CONF option */
|
||||
buffer[pos++] = dag->of->ocp >> 8;
|
||||
buffer[pos++] = dag->of->ocp & 0xff;
|
||||
|
||||
/* if prefix info length > 0 then we have a prefix to send! */
|
||||
if(dag->prefix_info.length > 0) {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
*
|
||||
* Author: Joakim Eriksson, Nicolas Tsiftes
|
||||
*
|
||||
* $Id: rpl.h,v 1.16 2010/06/08 21:41:02 nvt-se Exp $
|
||||
* $Id: rpl.h,v 1.17 2010/06/12 10:55:46 joxe Exp $
|
||||
*/
|
||||
|
||||
#ifndef RPL_H
|
||||
|
@ -38,11 +38,8 @@
|
|||
|
||||
/*
|
||||
* ContikiRPL - an implementation of the routing protocol for low power and
|
||||
* lossy networks. See: draft-ietf-roll-rpl-08.
|
||||
* lossy networks. See: draft-ietf-roll-rpl-09.
|
||||
*
|
||||
* Note: This version of ContikiRPL is currently moving on to RPL-08, but
|
||||
* since the type of the OCP option for DIOs is unclear we assume that it
|
||||
* will be of type 9.
|
||||
* --
|
||||
* The DIOs handle prefix information option for setting global IP addresses
|
||||
* on the nodes, but the current handling is not awaiting the join of the DAG
|
||||
|
@ -82,8 +79,6 @@
|
|||
#define RPL_DIO_SUBOPT_SOLICITED_INFO 7 /* Solicited information */
|
||||
#define RPL_DIO_SUBOPT_PREFIX_INFO 8 /* Prefix information option */
|
||||
|
||||
#define RPL_DIO_SUBOPT_OCP 9 /* 5 in the MC document... */
|
||||
|
||||
#define RPL_DAO_K_FLAG 0x80 /* DAO ACK requested */
|
||||
#define RPL_DAO_D_FLAG 0x40 /* DODAG ID Present */
|
||||
|
||||
|
|
Loading…
Reference in a new issue