1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 05:53:49 +01:00

Merge pull request #205 from OlegHahm/rpl_includes

fixed includes and some data types for RPL
This commit is contained in:
Oleg Hahm 2013-10-16 06:41:58 -07:00
commit e08952d8a4
19 changed files with 59 additions and 57 deletions

View File

@ -1,5 +1,7 @@
MODULE =cc110x
INCLUDES += -I$(RIOTBASE)/sys/net
include $(MAKEBASE)/Makefile.base

View File

@ -1,4 +1,4 @@
MODULE:=$(shell basename $(CURDIR))
INCLUDES = -I$(RIOTBASE) -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/net/destiny -I$(RIOTBASE)/sys/net/sixlowpan/include -I$(RIOTBASE)/sys/net/net_help/ -I$(RIOTBASE)/drivers/cc110x_ng/include
INCLUDES = -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/net/destiny -I$(RIOTBASE)/sys/net/sixlowpan/include -I$(RIOTBASE)/sys/net/net_help/ -I$(RIOTBASE)/drivers/cc110x_ng/include -I$(RIOTBASE)/drivers/cc110x
include $(RIOTBASE)/Makefile.base

View File

@ -1,4 +1,4 @@
MODULE:=$(shell basename $(CURDIR))
INCLUDES += -I$(RIOTBASE) -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/sys/net/sixlowpan/include
INCLUDES += -I$(RIOTBASE)/sys/net/destiny/ -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/sys/net/sixlowpan/include
include $(RIOTBASE)/Makefile.base

View File

@ -18,7 +18,7 @@
#include <string.h>
#include <stdint.h>
#include "sys/net/destiny/socket.h"
#include "socket.h"
#include "inet_ntop.h"

View File

@ -18,7 +18,7 @@
#include <string.h>
#include <stdint.h>
#include "sys/net/destiny/socket.h"
#include "socket.h"
#include "inet_pton.h"

View File

@ -8,7 +8,7 @@
#include <thread.h>
#include <stdio.h>
#include "msg_help.h"
#include "sys/net/destiny/tcp_timer.h"
#include "tcp_timer.h"
void block_continue_thread(void)
{

View File

@ -1,4 +1,4 @@
MODULE:=$(shell basename $(CURDIR))
INCLUDES = -I$(RIOTBASE) -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/sys/net/
INCLUDES += -I$(RIOTBASE) -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/sys/net/sixlowpan/include -I$(RIOTBASE)/sys/net/ieee802154/include
include $(RIOTBASE)/Makefile.base

View File

@ -10,12 +10,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <hwtimer.h>
#include <vtimer.h>
#include <thread.h>
#include <transceiver.h>
#include "mutex.h"
#include "hwtimer.h"
#include "vtimer.h"
#include "thread.h"
#include "transceiver.h"
#include "sixlowpan.h"
#include "sixlowpan/ip.h"
#include "ieee802154_frame.h"
//prototytpes
@ -43,7 +44,7 @@ int etx_clock_pid = 0;
* See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
*/
//Message queue for radio
msg_t msg_que[ETX_RCV_QUEUE_SIZE] = { 0 };
msg_t msg_que[ETX_RCV_QUEUE_SIZE] = { {0} };
/*
* The counter for the current 'round'. An ETX beacon is sent every ETX_INTERVAL
@ -72,7 +73,7 @@ static char reached_window = 0;
* See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
*/
//Candidate array
static etx_neighbor_t candidates[ETX_MAX_CANDIDATE_NEIGHBORS] = { 0 };
static etx_neighbor_t candidates[ETX_MAX_CANDIDATE_NEIGHBORS] = { {{{0}}} };
/*
* Each time we send a beacon packet we need to reset some values for the
@ -164,7 +165,7 @@ void etx_beacon(void)
* Please delete this information once it's fixed
* See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
*/
ieee_802154_long_t empty_addr = { 0 };
ieee_802154_long_t empty_addr = { {0} };
while (true) {
thread_sleep();
@ -183,7 +184,7 @@ void etx_beacon(void)
}
packet->length = p_length;
send_ieee802154_frame(&empty_addr, &etx_send_buf[0],
sixlowpan_mac_send_ieee802154_frame(&empty_addr, &etx_send_buf[0],
ETX_DATA_MAXLEN + ETX_PKT_HDR_LEN, 1);
DEBUG("sent beacon!\n");
etx_set_packets_received();

View File

@ -8,8 +8,8 @@
#ifndef ETX_BEACONING_H_
#define ETX_BEACONING_H_
#include "ipv6.h"
#include <stdint.h>
#include "sixlowpan.h"
//For debugging purposes
#define ENABLE_DEBUG (0)

View File

@ -12,6 +12,7 @@
* @file rpl.c
* @brief basic RPL functions
* @author Eric Engel <eric.engel@fu-berlin.de>
* @author Oliver Hahm <oliver.hahm@inria.fr>
* @}
*/
@ -28,7 +29,6 @@
#include "trickle.h"
#include "sixlowpan.h"
#include "ipv6.h"
char rpl_process_buf[RPL_PROCESS_STACKSIZE];
/* global variables */
@ -47,7 +47,7 @@ uint8_t rpl_send_buffer[BUFFER_SIZE];
msg_t msg_queue[RPL_PKT_RECV_BUF_SIZE];
/* SEND BUFFERS */
static ipv6_hdr_t *ipv6_send_buf;
static struct icmpv6_hdr_t *icmp_send_buf;
static icmpv6_hdr_t *icmp_send_buf;
static struct rpl_dio_t *rpl_send_dio_buf;
static struct rpl_dis_t *rpl_send_dis_buf;
static struct rpl_dao_t *rpl_send_dao_buf;
@ -80,39 +80,39 @@ static uint8_t *get_rpl_send_payload_buf(uint8_t ext_len)
return &(rpl_send_buffer[IPV6_HDR_LEN + ext_len]);
}
static struct icmpv6_hdr_t *get_rpl_send_icmpv6_buf(uint8_t ext_len) {
return ((struct icmpv6_hdr_t *) &(rpl_send_buffer[IPV6_HDR_LEN + ext_len]));
static icmpv6_hdr_t *get_rpl_send_icmpv6_buf(uint8_t ext_len) {
return ((icmpv6_hdr_t *) &(rpl_send_buffer[IPV6_HDR_LEN + ext_len]));
}
static struct rpl_dio_t *get_rpl_send_dio_buf(void) {
return ((struct rpl_dio_t *) &(rpl_send_buffer[IPV6HDR_ICMPV6HDR_LEN]));
return ((struct rpl_dio_t *) &(rpl_send_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN]));
}
static struct rpl_dao_t *get_rpl_send_dao_buf(void) {
return ((struct rpl_dao_t *) &(rpl_send_buffer[IPV6HDR_ICMPV6HDR_LEN]));
return ((struct rpl_dao_t *) &(rpl_send_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN]));
}
static struct rpl_dao_ack_t *get_rpl_send_dao_ack_buf(void) {
return ((struct rpl_dao_ack_t *) &(rpl_send_buffer[IPV6HDR_ICMPV6HDR_LEN]));
return ((struct rpl_dao_ack_t *) &(rpl_send_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN]));
}
static struct rpl_dis_t *get_rpl_send_dis_buf(void) {
return ((struct rpl_dis_t *) &(rpl_send_buffer[IPV6HDR_ICMPV6HDR_LEN]));
return ((struct rpl_dis_t *) &(rpl_send_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN]));
}
static rpl_opt_dodag_conf_t *get_rpl_send_opt_dodag_conf_buf(uint8_t rpl_msg_len)
{
return ((rpl_opt_dodag_conf_t *) &(rpl_send_buffer[IPV6HDR_ICMPV6HDR_LEN + rpl_msg_len]));
return ((rpl_opt_dodag_conf_t *) &(rpl_send_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN + rpl_msg_len]));
}
static rpl_opt_target_t *get_rpl_send_opt_target_buf(uint8_t rpl_msg_len)
{
return ((rpl_opt_target_t *) &(rpl_send_buffer[IPV6HDR_ICMPV6HDR_LEN + rpl_msg_len]));
return ((rpl_opt_target_t *) &(rpl_send_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN + rpl_msg_len]));
}
static rpl_opt_transit_t *get_rpl_send_opt_transit_buf(uint8_t rpl_msg_len)
{
return ((rpl_opt_transit_t *) &(rpl_send_buffer[IPV6HDR_ICMPV6HDR_LEN + rpl_msg_len]));
return ((rpl_opt_transit_t *) &(rpl_send_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN + rpl_msg_len]));
}
/* RECEIVE BUFFERS */
@ -122,44 +122,44 @@ static ipv6_hdr_t *get_rpl_ipv6_buf(void)
}
static struct rpl_dio_t *get_rpl_dio_buf(void) {
return ((struct rpl_dio_t *) &(rpl_buffer[IPV6HDR_ICMPV6HDR_LEN]));
return ((struct rpl_dio_t *) &(rpl_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN]));
}
static struct rpl_dao_t *get_rpl_dao_buf(void) {
return ((struct rpl_dao_t *) &(rpl_buffer[IPV6HDR_ICMPV6HDR_LEN]));
return ((struct rpl_dao_t *) &(rpl_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN]));
}
static struct rpl_dao_ack_t *get_rpl_dao_ack_buf(void) {
return ((struct rpl_dao_ack_t *) &(buffer[LLHDR_ICMPV6HDR_LEN]));
return ((struct rpl_dao_ack_t *) &(buffer[(LL_HDR_LEN + IPV6_HDR_LEN + ICMPV6_HDR_LEN)]));
}
static struct rpl_dis_t *get_rpl_dis_buf(void) {
return ((struct rpl_dis_t *) & (rpl_buffer[IPV6HDR_ICMPV6HDR_LEN]));
return ((struct rpl_dis_t *) & (rpl_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN]));
}
static rpl_opt_t *get_rpl_opt_buf(uint8_t rpl_msg_len)
{
return ((rpl_opt_t *) &(rpl_buffer[IPV6HDR_ICMPV6HDR_LEN + rpl_msg_len]));
return ((rpl_opt_t *) &(rpl_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN + rpl_msg_len]));
}
static rpl_opt_dodag_conf_t *get_rpl_opt_dodag_conf_buf(uint8_t rpl_msg_len)
{
return ((rpl_opt_dodag_conf_t *) &(rpl_buffer[IPV6HDR_ICMPV6HDR_LEN + rpl_msg_len]));
return ((rpl_opt_dodag_conf_t *) &(rpl_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN + rpl_msg_len]));
}
static rpl_opt_solicited_t *get_rpl_opt_solicited_buf(uint8_t rpl_msg_len)
{
return ((rpl_opt_solicited_t *) &(rpl_buffer[IPV6HDR_ICMPV6HDR_LEN + rpl_msg_len]));
return ((rpl_opt_solicited_t *) &(rpl_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN + rpl_msg_len]));
}
static rpl_opt_target_t *get_rpl_opt_target_buf(uint8_t rpl_msg_len)
{
return ((rpl_opt_target_t *) &(rpl_buffer[IPV6HDR_ICMPV6HDR_LEN + rpl_msg_len]));
return ((rpl_opt_target_t *) &(rpl_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN + rpl_msg_len]));
}
static rpl_opt_transit_t *get_rpl_opt_transit_buf(uint8_t rpl_msg_len)
{
return ((rpl_opt_transit_t *) &(rpl_buffer[IPV6HDR_ICMPV6HDR_LEN + rpl_msg_len]));
return ((rpl_opt_transit_t *) &(rpl_buffer[IPV6_HDR_LEN + ICMPV6_HDR_LEN + rpl_msg_len]));
}
/* find implemented OF via objective code point */

View File

@ -23,6 +23,7 @@
#include "ipv6.h"
#include "rpl_dodag.h"
#undef CC1100_RADIO_MODE
#define CC1100_RADIO_MODE CC1100_MODE_WOR
#define RPL_PKT_RECV_BUF_SIZE 20

View File

@ -110,7 +110,7 @@
#define RPL_MAX_INSTANCES 1
#define RPL_MAX_PARENTS 5
#define RPL_MAX_ROUTING_ENTRIES 128
#define RPL_ROOT_RANK 1
#define RPL_ROOT_RANK 256
#define RPL_DEFAULT_LIFETIME 0xff
#define RPL_LIFETIME_UNIT 2
#define RPL_GROUNDED 1
@ -121,7 +121,7 @@
#define RPL_DIS_I_MASK 0x40
#define RPL_DIS_D_MASK 0x20
#define RPL_GROUNDED_SHIFT 7
#define RPL_DEFAULT_OCP 1
#define RPL_DEFAULT_OCP 0
/* DIO Base Object (RFC 6550 Fig. 14) */
struct __attribute__((packed)) rpl_dio_t {
@ -270,7 +270,7 @@ typedef struct rpl_of_t {
void (*reset)(rpl_dodag_t *);
void (*parent_state_callback)(rpl_parent_t *, int, int);
void (*init)(void); //OF specific init function
void (*process_dio)(); //DIO processing callback (acc. to OF0 spec, chpt 5)
void (*process_dio)(void); //DIO processing callback (acc. to OF0 spec, chpt 5)
} rpl_of_t;
typedef struct {

View File

@ -22,7 +22,7 @@
#include <math.h>
#include "inttypes.h"
#include "trickle.h"
#include "rpl/rpl.h"
#include "rpl.h"
//TODO in pointer umwandeln, speicher mit malloc holen
char *timer_over_buf;

View File

@ -1,4 +1,4 @@
MODULE:=$(shell basename $(CURDIR))
INCLUDES = -I$(RIOTBASE) -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/drivers/cc110x_ng/include -I$(RIOTBASE)/cpu/arm_common/include -I$(RIOTBASE)/sys/net/sixlowpan/include/
INCLUDES += -I$(RIOTBASE) -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/drivers/cc110x_ng/include -I$(RIOTBASE)/cpu/arm_common/include -I$(RIOTBASE)/sys/net/sixlowpan/include/ -I$(RIOTBASE)/sys/net/ieee802154/include -I$(RIOTBASE)/sys/net/net_help
include $(RIOTBASE)/Makefile.base

View File

@ -35,7 +35,7 @@
#include "icmp.h"
#include "serialnumber.h"
#include "sys/net/net_help/net_help.h"
#include "net_help.h"
#define READER_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT)

View File

@ -14,6 +14,7 @@
* @author Stephan Zeisberg <zeisberg@mi.fu-berlin.de>
* @author Martin Lenders <mlenders@inf.fu-berlin.de>
* @author Oliver Gesch <oliver.gesch@googlemail.com>
* @author Oliver Hahm <oliver.hahm@inria.fr>
* @}
*/
@ -31,13 +32,12 @@
#include "icmp.h"
#include "lowpan.h"
#include "serialnumber.h"
#include "sys/net/net_help/net_help.h"
#include "net_help.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
#define LLHDR_ICMPV6HDR_LEN (LL_HDR_LEN + IPV6_HDR_LEN + ICMPV6_HDR_LEN)
#define IPV6HDR_ICMPV6HDR_LEN (IPV6_HDR_LEN + ipv6_ext_hdr_len + ICMPV6_HDR_LEN)
#define ND_HOPLIMIT (0xFF)
/* parameter problem [rfc4443] */
@ -713,7 +713,7 @@ void recv_rtr_adv(void)
mutex_lock(&lowpan_context_mutex);
/* read options */
while (packet_length > IPV6HDR_ICMPV6HDR_LEN + icmpv6_opt_hdr_len) {
while (packet_length > IPV6_HDR_LEN + ICMPV6_HDR_LEN + icmpv6_opt_hdr_len) {
opt_buf = get_opt_buf(ipv6_ext_hdr_len, icmpv6_opt_hdr_len);
switch (opt_buf->type) {
@ -943,7 +943,7 @@ void recv_nbr_sol(void)
* option condition is that a sllao option is set. thus that we don't
* know which option comes first we need to this here */
while (packet_length > IPV6HDR_ICMPV6HDR_LEN + icmpv6_opt_hdr_len) {
while (packet_length > IPV6_HDR_LEN + ICMPV6_HDR_LEN + icmpv6_opt_hdr_len) {
opt_buf = get_opt_buf(ipv6_ext_hdr_len, icmpv6_opt_hdr_len);
if (opt_buf->type == NDP_OPT_SLLAO_TYPE) {
@ -955,7 +955,7 @@ void recv_nbr_sol(void)
icmpv6_opt_hdr_len = NBR_SOL_LEN;
while (packet_length > IPV6HDR_ICMPV6HDR_LEN + icmpv6_opt_hdr_len) {
while (packet_length > IPV6_HDR_LEN + ICMPV6_HDR_LEN + icmpv6_opt_hdr_len) {
opt_buf = get_opt_buf(ipv6_ext_hdr_len, icmpv6_opt_hdr_len);
switch (opt_buf->type) {
@ -1188,7 +1188,7 @@ void recv_nbr_adv(void)
nbr_adv_buf = get_nbr_adv_buf(ipv6_ext_hdr_len);
/* check if options are present */
while (packet_length > IPV6HDR_ICMPV6HDR_LEN + icmpv6_opt_hdr_len) {
while (packet_length > IPV6_HDR_LEN + ICMPV6_HDR_LEN + icmpv6_opt_hdr_len) {
opt_buf = get_opt_buf(ipv6_ext_hdr_len, icmpv6_opt_hdr_len);
switch (opt_buf->type) {

View File

@ -31,9 +31,8 @@
#include "icmp.h"
#include "lowpan.h"
#include "sys/net/destiny/socket.h"
#include "sys/net/net_help/net_help.h"
#include "sys/net/net_help/msg_help.h"
#include "net_help.h"
#include "msg_help.h"
#define IP_PKT_RECV_BUF_SIZE (64)
#define LLHDR_IPV6HDR_LEN (LL_HDR_LEN + IPV6_HDR_LEN)

View File

@ -40,9 +40,8 @@
#include "ip.h"
#include "icmp.h"
#include "sys/net/ieee802154/ieee802154_frame.h"
#include "sys/net/destiny/in.h"
#include "sys/net/net_help/net_help.h"
#include "ieee802154_frame.h"
#include "net_help.h"
#define IP_PROCESS_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT * 6)
#define NC_STACKSIZE (KERNEL_CONF_STACKSIZE_DEFAULT)

View File

@ -36,8 +36,8 @@
#include "ip.h"
#include "icmp.h"
#include "lowpan.h"
#include "sys/net/ieee802154/ieee802154_frame.h"
#include "sys/net/net_help/net_help.h"
#include "ieee802154_frame.h"
#include "net_help.h"
#define ENABLE_DEBUG (0)
#include "debug.h"