diff --git a/drivers/cc110x/Makefile b/drivers/cc110x/Makefile index 85d5f0629d..e5323646d5 100644 --- a/drivers/cc110x/Makefile +++ b/drivers/cc110x/Makefile @@ -1,5 +1,7 @@ MODULE =cc110x +INCLUDES += -I$(RIOTBASE)/sys/net + include $(MAKEBASE)/Makefile.base diff --git a/sys/net/destiny/Makefile b/sys/net/destiny/Makefile index d8ff381522..e771aa3e96 100644 --- a/sys/net/destiny/Makefile +++ b/sys/net/destiny/Makefile @@ -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 diff --git a/sys/net/net_help/Makefile b/sys/net/net_help/Makefile index bb2381c4b3..158b6d764f 100644 --- a/sys/net/net_help/Makefile +++ b/sys/net/net_help/Makefile @@ -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 diff --git a/sys/net/net_help/inet_ntop.c b/sys/net/net_help/inet_ntop.c index 62627a6666..0221ae214d 100644 --- a/sys/net/net_help/inet_ntop.c +++ b/sys/net/net_help/inet_ntop.c @@ -18,7 +18,7 @@ #include #include -#include "sys/net/destiny/socket.h" +#include "socket.h" #include "inet_ntop.h" diff --git a/sys/net/net_help/inet_pton.c b/sys/net/net_help/inet_pton.c index c5cdfc858c..baf812a0da 100644 --- a/sys/net/net_help/inet_pton.c +++ b/sys/net/net_help/inet_pton.c @@ -18,7 +18,7 @@ #include #include -#include "sys/net/destiny/socket.h" +#include "socket.h" #include "inet_pton.h" diff --git a/sys/net/net_help/msg_help.c b/sys/net/net_help/msg_help.c index adcd924d6b..e12840d466 100644 --- a/sys/net/net_help/msg_help.c +++ b/sys/net/net_help/msg_help.c @@ -8,7 +8,7 @@ #include #include #include "msg_help.h" -#include "sys/net/destiny/tcp_timer.h" +#include "tcp_timer.h" void block_continue_thread(void) { diff --git a/sys/net/rpl/Makefile b/sys/net/rpl/Makefile index 7cb9f23423..84125a4221 100644 --- a/sys/net/rpl/Makefile +++ b/sys/net/rpl/Makefile @@ -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 diff --git a/sys/net/rpl/etx_beaconing.c b/sys/net/rpl/etx_beaconing.c index d2b38978f4..6087595059 100644 --- a/sys/net/rpl/etx_beaconing.c +++ b/sys/net/rpl/etx_beaconing.c @@ -10,12 +10,13 @@ #include #include -#include -#include -#include -#include +#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(); diff --git a/sys/net/rpl/etx_beaconing.h b/sys/net/rpl/etx_beaconing.h index de353bb9d3..4bfc7bd386 100644 --- a/sys/net/rpl/etx_beaconing.h +++ b/sys/net/rpl/etx_beaconing.h @@ -8,8 +8,8 @@ #ifndef ETX_BEACONING_H_ #define ETX_BEACONING_H_ - -#include "ipv6.h" +#include +#include "sixlowpan.h" //For debugging purposes #define ENABLE_DEBUG (0) diff --git a/sys/net/rpl/rpl.c b/sys/net/rpl/rpl.c index d11606205c..8d573af9bd 100644 --- a/sys/net/rpl/rpl.c +++ b/sys/net/rpl/rpl.c @@ -12,6 +12,7 @@ * @file rpl.c * @brief basic RPL functions * @author Eric Engel + * @author Oliver Hahm * @} */ @@ -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 */ diff --git a/sys/net/rpl/rpl.h b/sys/net/rpl/rpl.h index 67f14877b2..6055f496c5 100644 --- a/sys/net/rpl/rpl.h +++ b/sys/net/rpl/rpl.h @@ -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 diff --git a/sys/net/rpl/rpl_structs.h b/sys/net/rpl/rpl_structs.h index 80e374fe33..3a9d121d37 100644 --- a/sys/net/rpl/rpl_structs.h +++ b/sys/net/rpl/rpl_structs.h @@ -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 { diff --git a/sys/net/rpl/trickle.c b/sys/net/rpl/trickle.c index c090733459..baa0e1d656 100644 --- a/sys/net/rpl/trickle.c +++ b/sys/net/rpl/trickle.c @@ -22,7 +22,7 @@ #include #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; diff --git a/sys/net/sixlowpan/Makefile b/sys/net/sixlowpan/Makefile index ef6e3de4e0..964127929a 100644 --- a/sys/net/sixlowpan/Makefile +++ b/sys/net/sixlowpan/Makefile @@ -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 diff --git a/sys/net/sixlowpan/border.c b/sys/net/sixlowpan/border.c index d07201d343..bb850bd131 100644 --- a/sys/net/sixlowpan/border.c +++ b/sys/net/sixlowpan/border.c @@ -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) diff --git a/sys/net/sixlowpan/icmp.c b/sys/net/sixlowpan/icmp.c index cde702c95d..2190ae8980 100644 --- a/sys/net/sixlowpan/icmp.c +++ b/sys/net/sixlowpan/icmp.c @@ -14,6 +14,7 @@ * @author Stephan Zeisberg * @author Martin Lenders * @author Oliver Gesch + * @author Oliver Hahm * @} */ @@ -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) { diff --git a/sys/net/sixlowpan/ip.c b/sys/net/sixlowpan/ip.c index d419b8d52f..efc0648125 100644 --- a/sys/net/sixlowpan/ip.c +++ b/sys/net/sixlowpan/ip.c @@ -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) diff --git a/sys/net/sixlowpan/lowpan.c b/sys/net/sixlowpan/lowpan.c index a54d567101..81fdcd4db0 100644 --- a/sys/net/sixlowpan/lowpan.c +++ b/sys/net/sixlowpan/lowpan.c @@ -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) diff --git a/sys/net/sixlowpan/mac.c b/sys/net/sixlowpan/mac.c index d2bed0893a..63534d2a3f 100644 --- a/sys/net/sixlowpan/mac.c +++ b/sys/net/sixlowpan/mac.c @@ -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"