From b944a48da92ec1d71ac762607492ec757b881b23 Mon Sep 17 00:00:00 2001
From: Martin Lenders <mail@martin-lenders.de>
Date: Mon, 5 Aug 2013 16:10:54 +0200
Subject: [PATCH] Set up new directory structure

---
 Makefile.dep                                  |  3 ++
 sys/net/destiny/Makefile                      |  2 +-
 sys/net/destiny/socket.h                      |  2 +-
 sys/net/destiny/tcp.c                         |  2 +-
 sys/net/destiny/tcp.h                         |  2 +-
 sys/net/destiny/tcp_hc.c                      |  2 +-
 sys/net/destiny/tcp_hc.h                      |  2 +-
 sys/net/destiny/tcp_timer.c                   |  4 +--
 sys/net/destiny/udp.c                         |  4 +--
 sys/net/destiny/udp.h                         |  2 +-
 sys/net/net_help/Makefile                     |  2 +-
 sys/net/rpl/etx_beaconing.c                   |  2 +-
 sys/net/rpl/etx_beaconing.h                   |  2 +-
 sys/net/rpl/rpl.c                             |  7 ++--
 sys/net/rpl/rpl.h                             |  2 +-
 sys/net/rpl/rpl_structs.h                     |  2 +-
 sys/net/sixlowpan/Makefile                    |  2 +-
 .../sixlowpan/{sixlowborder.c => border.c}    | 10 +++---
 .../sixlowpan/{sixlowborder.h => border.h}    |  8 ++---
 sys/net/sixlowpan/bordermultiplex.c           |  8 ++---
 sys/net/sixlowpan/bordermultiplex.h           |  8 ++---
 sys/net/sixlowpan/{sixlowerror.h => error.h}  |  6 ++--
 sys/net/sixlowpan/flowcontrol.h               | 10 +++---
 sys/net/sixlowpan/{sixlownd.c => icmp.c}      | 10 +++---
 sys/net/sixlowpan/{sixlownd.h => icmp.h}      | 10 +++---
 sys/net/sixlowpan/include/ipv6.h              | 30 +++++++++++++++++
 sys/net/sixlowpan/include/sixlowpan.h         | 32 +++++++++++++++++++
 .../include/sixlowpan/borderrouter.h          | 24 ++++++++++++++
 sys/net/sixlowpan/include/sixlowpan/error.h   | 21 ++++++++++++
 sys/net/sixlowpan/include/sixlowpan/icmp.h    | 24 ++++++++++++++
 sys/net/sixlowpan/include/sixlowpan/ip.h      | 24 ++++++++++++++
 sys/net/sixlowpan/include/sixlowpan/lowpan.h  | 24 ++++++++++++++
 sys/net/sixlowpan/include/sixlowpan/mac.h     | 24 ++++++++++++++
 sys/net/sixlowpan/include/sixlowpan/ndp.h     | 24 ++++++++++++++
 sys/net/sixlowpan/include/sixlowpan/types.h   | 24 ++++++++++++++
 sys/net/sixlowpan/{sixlowip.c => ip.c}        |  8 ++---
 sys/net/sixlowpan/{sixlowip.h => ip.h}        |  6 ++--
 sys/net/sixlowpan/{sixlowpan.c => lowpan.c}   | 14 ++++----
 sys/net/sixlowpan/{sixlowpan.h => lowpan.h}   |  8 ++---
 sys/net/sixlowpan/{sixlowmac.c => mac.c}      | 12 +++----
 sys/net/sixlowpan/{sixlowmac.h => mac.h}      |  8 ++---
 sys/net/sixlowpan/semaphore.h                 |  6 ++--
 sys/net/sixlowpan/serialnumber.h              |  6 ++--
 43 files changed, 342 insertions(+), 91 deletions(-)
 rename sys/net/sixlowpan/{sixlowborder.c => border.c} (97%)
 rename sys/net/sixlowpan/{sixlowborder.h => border.h} (90%)
 rename sys/net/sixlowpan/{sixlowerror.h => error.h} (88%)
 rename sys/net/sixlowpan/{sixlownd.c => icmp.c} (99%)
 rename sys/net/sixlowpan/{sixlownd.h => icmp.h} (98%)
 create mode 100644 sys/net/sixlowpan/include/sixlowpan/borderrouter.h
 create mode 100644 sys/net/sixlowpan/include/sixlowpan/error.h
 create mode 100644 sys/net/sixlowpan/include/sixlowpan/icmp.h
 create mode 100644 sys/net/sixlowpan/include/sixlowpan/ip.h
 create mode 100644 sys/net/sixlowpan/include/sixlowpan/lowpan.h
 create mode 100644 sys/net/sixlowpan/include/sixlowpan/ndp.h
 create mode 100644 sys/net/sixlowpan/include/sixlowpan/types.h
 rename sys/net/sixlowpan/{sixlowip.c => ip.c} (99%)
 rename sys/net/sixlowpan/{sixlowip.h => ip.h} (98%)
 rename sys/net/sixlowpan/{sixlowpan.c => lowpan.c} (99%)
 rename sys/net/sixlowpan/{sixlowpan.h => lowpan.h} (97%)
 rename sys/net/sixlowpan/{sixlowmac.c => mac.c} (97%)
 rename sys/net/sixlowpan/{sixlowmac.h => mac.h} (92%)

diff --git a/Makefile.dep b/Makefile.dep
index b3f0f1ca11..601a08619d 100644
--- a/Makefile.dep
+++ b/Makefile.dep
@@ -39,4 +39,7 @@ ifneq (,$(findstring sixlowpan,$(USEMODULE)))
 	ifeq (,$(findstring ieee802154,$(USEMODULE)))
 		USEMODULE += ieee802154
 	endif
+	ifeq (,$(findstring net_help,$(USEMODULE)))
+		USEMODULE += net_help
+	endif
 endif
diff --git a/sys/net/destiny/Makefile b/sys/net/destiny/Makefile
index 7dce69248e..7827885383 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
+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/
 
 include $(RIOTBASE)/Makefile.base
diff --git a/sys/net/destiny/socket.h b/sys/net/destiny/socket.h
index 5fb61ab541..21a8595da4 100644
--- a/sys/net/destiny/socket.h
+++ b/sys/net/destiny/socket.h
@@ -23,7 +23,7 @@
 #include "tcp.h"
 #include "udp.h"
 #include "in.h"
-#include "../sixlowpan/sixlowip.h"
+#include "ipv6.h"
 
 /*
  * POSIX compatibility
diff --git a/sys/net/destiny/tcp.c b/sys/net/destiny/tcp.c
index 4145e4f1cb..ca69f8e7ba 100644
--- a/sys/net/destiny/tcp.c
+++ b/sys/net/destiny/tcp.c
@@ -30,7 +30,7 @@
 #include "socket.h"
 #include "../net_help/net_help.h"
 #include "../net_help/msg_help.h"
-#include "../sixlowpan/sixlowpan.h"
+#include "sixlowpan.h"
 
 void printTCPHeader(tcp_hdr_t *tcp_header)
 {
diff --git a/sys/net/destiny/tcp.h b/sys/net/destiny/tcp.h
index 6b58a29f72..3042ba692d 100644
--- a/sys/net/destiny/tcp.h
+++ b/sys/net/destiny/tcp.h
@@ -78,7 +78,7 @@ enum tcp_codes {
 
 #define TCP_STACK_SIZE 			1024
 
-#include "../sixlowpan/sixlowip.h"
+#include "ipv6.h"
 
 typedef struct __attribute__((packed)) tcp_mms_o_t {
     uint8_t		kind;
diff --git a/sys/net/destiny/tcp_hc.c b/sys/net/destiny/tcp_hc.c
index 707b7af549..61086c9e51 100644
--- a/sys/net/destiny/tcp_hc.c
+++ b/sys/net/destiny/tcp_hc.c
@@ -23,7 +23,7 @@
 #include "tcp_hc.h"
 #include "socket.h"
 #include "tcp.h"
-#include "../sixlowpan/sixlowip.h"
+#include "ipv6.h"
 #include "../net_help/net_help.h"
 
 #ifdef TCP_HC
diff --git a/sys/net/destiny/tcp_hc.h b/sys/net/destiny/tcp_hc.h
index 9482d3a45b..f6b1731baa 100644
--- a/sys/net/destiny/tcp_hc.h
+++ b/sys/net/destiny/tcp_hc.h
@@ -9,7 +9,7 @@
 #define TCP_HC_H_
 
 #include "tcp.h"
-#include "../sixlowpan/sixlowip.h"
+#include "sixlowpan.h"
 #include "socket.h"
 
 #ifdef TCP_HC
diff --git a/sys/net/destiny/tcp_timer.c b/sys/net/destiny/tcp_timer.c
index c3861c8c2b..098a9f09a8 100644
--- a/sys/net/destiny/tcp_timer.c
+++ b/sys/net/destiny/tcp_timer.c
@@ -26,8 +26,8 @@
 #include "thread.h"
 #include "destiny.h"
 #include "socket.h"
-#include "net_help/msg_help.h"
-#include "../sixlowpan/sixlowpan.h"
+#include "../net_help/msg_help.h"
+#include "sixlowpan.h"
 
 void handle_synchro_timeout(socket_internal_t *current_socket)
 {
diff --git a/sys/net/destiny/udp.c b/sys/net/destiny/udp.c
index f1c2618fdd..6ba5f868a2 100644
--- a/sys/net/destiny/udp.c
+++ b/sys/net/destiny/udp.c
@@ -22,8 +22,8 @@
 
 #include "udp.h"
 #include "msg.h"
-#include "../sixlowpan/sixlowip.h"
-#include "../sixlowpan/sixlowpan.h"
+#include "ipv6.h"
+#include "sixlowpan.h"
 #include "socket.h"
 #include "in.h"
 #include "../net_help/net_help.h"
diff --git a/sys/net/destiny/udp.h b/sys/net/destiny/udp.h
index 23efcade94..8767c0d667 100644
--- a/sys/net/destiny/udp.h
+++ b/sys/net/destiny/udp.h
@@ -29,7 +29,7 @@
 
 #define UDP_STACK_SIZE 				512
 
-#include "../sixlowpan/sixlowip.h"
+#include "ipv6.h"
 
 typedef struct __attribute__((packed)) udp_h_t {
     uint16_t src_port;
diff --git a/sys/net/net_help/Makefile b/sys/net/net_help/Makefile
index 93dfabd905..633d89730f 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
+INCLUDES = -I$(RIOTBASE) -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/sys/net/sixlowpan/include
 
 include $(RIOTBASE)/Makefile.base
diff --git a/sys/net/rpl/etx_beaconing.c b/sys/net/rpl/etx_beaconing.c
index b2f90f17ba..0462d58d99 100644
--- a/sys/net/rpl/etx_beaconing.c
+++ b/sys/net/rpl/etx_beaconing.c
@@ -15,7 +15,7 @@
 #include <thread.h>
 #include <transceiver.h>
 
-#include "sixlowpan/sixlowmac.h"
+#include "sixlowpan.h"
 #include "ieee802154/ieee802154_frame.h"
 
 //prototytpes
diff --git a/sys/net/rpl/etx_beaconing.h b/sys/net/rpl/etx_beaconing.h
index 4cdf762a3d..063190a5a6 100644
--- a/sys/net/rpl/etx_beaconing.h
+++ b/sys/net/rpl/etx_beaconing.h
@@ -9,7 +9,7 @@
 #ifndef ETX_BEACONING_H_
 #define ETX_BEACONING_H_
 
-#include "sys/net/sixlowpan/sixlowip.h"
+#include "ipv6.h"
 
 //For debugging purposes
 #define ENABLE_DEBUG (0)
diff --git a/sys/net/rpl/rpl.c b/sys/net/rpl/rpl.c
index d3b425e957..49f76f2674 100644
--- a/sys/net/rpl/rpl.c
+++ b/sys/net/rpl/rpl.c
@@ -26,11 +26,8 @@
 #include "of_mrhof.h"
 #include "trickle.h"
 
-#include "sys/net/sixlowpan/sixlowmac.h"
-#include "sys/net/sixlowpan/sixlowip.h"
-#include "sys/net/sixlowpan/sixlowpan.h"
-#include "sys/net/sixlowpan/sixlownd.h"
-#include "sys/net/sixlowpan/sixlowerror.h"
+#include "sixlowpan.h"
+#include "ipv6.h"
 
 char rpl_process_buf[RPL_PROCESS_STACKSIZE];
 /* global variables */
diff --git a/sys/net/rpl/rpl.h b/sys/net/rpl/rpl.h
index c38a2bf2ea..b15c35d668 100644
--- a/sys/net/rpl/rpl.h
+++ b/sys/net/rpl/rpl.h
@@ -20,7 +20,7 @@
 #include <vtimer.h>
 #include <mutex.h>
 #include <transceiver.h>
-#include "sixlowpan/sixlowip.h"
+#include "ipv6.h"
 #include "rpl_dodag.h"
 
 #define CC1100_RADIO_MODE CC1100_MODE_WOR
diff --git a/sys/net/rpl/rpl_structs.h b/sys/net/rpl/rpl_structs.h
index b03c0d2bd7..2eec2bc649 100644
--- a/sys/net/rpl/rpl_structs.h
+++ b/sys/net/rpl/rpl_structs.h
@@ -16,7 +16,7 @@
  */
 
 #include <string.h>
-#include "sixlowpan/sixlowip.h"
+#include "ipv6.h"
 
 #ifndef RPL_STRUCTS_H_INCLUDED
 #define RPL_STRUCTS_H_INCLUDED
diff --git a/sys/net/sixlowpan/Makefile b/sys/net/sixlowpan/Makefile
index c5dac39f00..4e0b8e4cc2 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)/sys/net -I$(RIOTBASE)/cpu/arm_common/include/
+INCLUDES = -I$(RIOTBASE) -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/cpu/arm_common/include -I$(RIOTBASE)/sys/net/sixlowpan/include/
 
 include $(RIOTBASE)/Makefile.base
diff --git a/sys/net/sixlowpan/sixlowborder.c b/sys/net/sixlowpan/border.c
similarity index 97%
rename from sys/net/sixlowpan/sixlowborder.c
rename to sys/net/sixlowpan/border.c
index 51d41c5ed1..67ecd75cda 100644
--- a/sys/net/sixlowpan/sixlowborder.c
+++ b/sys/net/sixlowpan/border.c
@@ -27,13 +27,13 @@
 #include <board_uart0.h>
 
 #include "bordermultiplex.h"
-#include "ieee802154/ieee802154_frame.h"
 #include "flowcontrol.h"
-#include "sixlowborder.h"
-#include "sixlowip.h"
-#include "sixlownd.h"
+#include "border.h"
+#include "ip.h"
+#include "icmp.h"
 #include "serialnumber.h"
-#include "sixlowerror.h"
+#include "error.h"
+#include "sys/net/ieee802154/ieee802154_frame.h"
 #include "sys/net/net_help/net_help.h"
 
 #define READER_STACK_SIZE   512
diff --git a/sys/net/sixlowpan/sixlowborder.h b/sys/net/sixlowpan/border.h
similarity index 90%
rename from sys/net/sixlowpan/sixlowborder.h
rename to sys/net/sixlowpan/border.h
index 4d0729e35d..c3252660f6 100644
--- a/sys/net/sixlowpan/sixlowborder.h
+++ b/sys/net/sixlowpan/border.h
@@ -18,14 +18,14 @@
 
 /* 6LoWPAN Border Router header file */
 
-#ifndef SIXLOWBORDER_H
-#define SIXLOWBORDER_H
+#ifndef _SIXLOWPAN_BORDER_H
+#define _SIXLOWPAN_BORDER_H
 
 #include <stdint.h>
 #include <mutex.h>
 #include <transceiver.h>
 
-#include "sixlowip.h"
+#include "ip.h"
 #include "semaphore.h"
 
 extern ipv6_addr_t abr_addr;
@@ -39,4 +39,4 @@ uint8_t border_initialize(transceiver_type_t trans, ipv6_addr_t *border_router_a
 void border_send_ipv6_over_lowpan(ipv6_hdr_t *packet, uint8_t aro_flag, uint8_t sixco_flag);
 void border_process_lowpan(void);
 
-#endif /* SIXLOWBORDER_H*/
+#endif /* _SIXLOWPAN_BORDER_H*/
diff --git a/sys/net/sixlowpan/bordermultiplex.c b/sys/net/sixlowpan/bordermultiplex.c
index af10ebdfb5..2dcaa1f5fe 100644
--- a/sys/net/sixlowpan/bordermultiplex.c
+++ b/sys/net/sixlowpan/bordermultiplex.c
@@ -22,10 +22,10 @@
 #include <board_uart0.h>
 
 #include "flowcontrol.h"
-#include "sixlowpan.h"
-#include "sixlownd.h"
-#include "sixlowborder.h"
-#include "sixlowerror.h"
+#include "lowpan.h"
+#include "icmp.h"
+#include "border.h"
+#include "error.h"
 
 #include "bordermultiplex.h"
 
diff --git a/sys/net/sixlowpan/bordermultiplex.h b/sys/net/sixlowpan/bordermultiplex.h
index 4d00f0c4e1..c5d5dc7068 100644
--- a/sys/net/sixlowpan/bordermultiplex.h
+++ b/sys/net/sixlowpan/bordermultiplex.h
@@ -16,13 +16,13 @@
  * @}
  */
 
-#ifndef BORDERMULTIPLEX_H
-#define BORDERMULTIPLEX_H
+#ifndef _SIXLOWPAN_BORDERMULTIPLEX_H
+#define _SIXLOWPAN_BORDERMULTIPLEX_H
 
 #include <stdint.h>
 #include <stdlib.h>
 
-#include "sixlowip.h"
+#include "ip.h"
 
 /* packet types of uart-packets */
 #define BORDER_PACKET_RAW_TYPE    0
@@ -89,4 +89,4 @@ void multiplex_send_addr_over_uart(ipv6_addr_t *addr);
 int readpacket(uint8_t *packet_buf, size_t size);
 int writepacket(uint8_t *packet_buf, size_t size);
 
-#endif /* BORDERMULTIPLEX_H*/
+#endif /* _SIXLOWPAN_BORDERMULTIPLEX_H*/
diff --git a/sys/net/sixlowpan/sixlowerror.h b/sys/net/sixlowpan/error.h
similarity index 88%
rename from sys/net/sixlowpan/sixlowerror.h
rename to sys/net/sixlowpan/error.h
index 90c2c4a5da..9159cba85a 100644
--- a/sys/net/sixlowpan/sixlowerror.h
+++ b/sys/net/sixlowpan/error.h
@@ -1,5 +1,5 @@
-#ifndef SIXLOWERROR_H
-#define SIXLOWERROR_H
+#ifndef _SIXLOWPAN_ERROR_H
+#define _SIXLOWPAN_ERROR_H
 
 #define SUCCESS                 0
 #define SIXLOWERROR_ARRAYFULL   132 // array is full
@@ -13,4 +13,4 @@
 #define SIXLOWERROR_DCI         140 // destination context not found
 #define SIXLOWERROR_CSUM        141 // wrong checksum
 
-#endif /* SIXLOWERROR_H*/
+#endif /* _SIXLOWPAN_ERROR_H*/
diff --git a/sys/net/sixlowpan/flowcontrol.h b/sys/net/sixlowpan/flowcontrol.h
index 61c1842afb..f4fb350ce3 100644
--- a/sys/net/sixlowpan/flowcontrol.h
+++ b/sys/net/sixlowpan/flowcontrol.h
@@ -16,15 +16,15 @@
  * @}
  */
 
-#ifndef FLOWCONTROL_H
-#define FLOWCONTROL_H
+#ifndef _SIXLOWPAN_FLOWCONTROL_H
+#define _SIXLOWPAN_FLOWCONTROL_H
 
 #include <stdint.h>
 #include <vtimer.h>
 
 #include "semaphore.h"
-#include "sixlowip.h"
-#include "sixlowborder.h"
+#include "ip.h"
+#include "border.h"
 #include "bordermultiplex.h"
 
 /* packet types for flowcontrol */
@@ -73,4 +73,4 @@ ipv6_addr_t flowcontrol_init(void);
 void flowcontrol_send_over_uart(border_packet_t *packet, int len);
 void flowcontrol_deliver_from_uart(border_packet_t *packet, int len);
 
-#endif /* FLOWCONTROL_H*/
+#endif /* _SIXLOWPAN_FLOWCONTROL_H*/
diff --git a/sys/net/sixlowpan/sixlownd.c b/sys/net/sixlowpan/icmp.c
similarity index 99%
rename from sys/net/sixlowpan/sixlownd.c
rename to sys/net/sixlowpan/icmp.c
index dfa97a5ee1..41447db2a5 100644
--- a/sys/net/sixlowpan/sixlownd.c
+++ b/sys/net/sixlowpan/icmp.c
@@ -20,11 +20,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "sixlowip.h"
-#include "sixlownd.h"
-#include "sixlowmac.h"
-#include "sixlowpan.h"
-#include "sixlowerror.h"
+#include "ip.h"
+#include "icmp.h"
+#include "mac.h"
+#include "lowpan.h"
+#include "error.h"
 #include "serialnumber.h"
 #include "sys/net/net_help/net_help.h"
 #include "vtimer.h"
diff --git a/sys/net/sixlowpan/sixlownd.h b/sys/net/sixlowpan/icmp.h
similarity index 98%
rename from sys/net/sixlowpan/sixlownd.h
rename to sys/net/sixlowpan/icmp.h
index 382c24db66..9d906e9a5a 100644
--- a/sys/net/sixlowpan/sixlownd.h
+++ b/sys/net/sixlowpan/icmp.h
@@ -17,13 +17,13 @@
  * @}
  */
 
-#ifndef SIXLOWND_H
-#define SIXLOWND_H
+#ifndef _SIXLOWPAN_ICMP_H
+#define _SIXLOWPAN_ICMP_H
 
 #include <stdint.h>
 #include "vtimer.h"
-#include "sixlowpan.h"
-#include "sixlowip.h"
+#include "lowpan.h"
+#include "ip.h"
 
 /* parameter problem [rfc4443] */
 #define PARA_PROB_LEN                  	(8)
@@ -282,4 +282,4 @@ void init_nbr_adv(ipv6_addr_t *src, ipv6_addr_t *dst, ipv6_addr_t *tgt,
                   uint8_t rso, uint8_t sllao, uint8_t aro, uint8_t aro_state);
 void recv_nbr_adv(void);
 void recv_nbr_sol(void);
-#endif /* SIXLOWND_H*/
+#endif /* _SIXLOWPAN_ICMP_H*/
diff --git a/sys/net/sixlowpan/include/ipv6.h b/sys/net/sixlowpan/include/ipv6.h
index e69de29bb2..0dad0d3806 100644
--- a/sys/net/sixlowpan/include/ipv6.h
+++ b/sys/net/sixlowpan/include/ipv6.h
@@ -0,0 +1,30 @@
+/*
+ * 6LoWPAN - Wraps all API types, constants and functions of 6LoWPAN in Layer 3.
+ *
+ * Copyright (C) 2013  INRIA.
+ *
+ * This file subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file LICENSE in the top level directory for more
+ * details.
+ *
+ * @ingroup sixlowpan
+ * @{
+ * @file    ipv6.h
+ * @brief   IPv6 and ICMP functions
+ * @author  Martin Lenders <mlenders@inf.fu-berlin.de>
+ * @}
+ */
+#ifndef IPV6_H
+#define IPV6_H
+
+#include "sixlowpan/error.h"
+#include "sixlowpan/types.h"
+#include "sixlowpan/ip.h"
+#include "sixlowpan/icmp.h"
+#include "sixlowpan/ndp.h"
+
+#include "../error.h"       /* TODO: remove if not needed anymore */
+#include "../ip.h"          /* TODO: remove if not needed anymore */
+#include "../icmp.h"        /* TODO: remove if not needed anymore */
+
+#endif /* IPV6_H */
diff --git a/sys/net/sixlowpan/include/sixlowpan.h b/sys/net/sixlowpan/include/sixlowpan.h
index e69de29bb2..03fa4faa55 100644
--- a/sys/net/sixlowpan/include/sixlowpan.h
+++ b/sys/net/sixlowpan/include/sixlowpan.h
@@ -0,0 +1,32 @@
+/*
+ * 6LoWPAN - Wraps all API types, constants and functions of 6LoWPAN concerning
+ * Layers under 3.
+ *
+ * Copyright (C) 2013  INRIA.
+ *
+ * This file subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file LICENSE in the top level directory for more
+ * details.
+ *
+ * @ingroup sixlowpan
+ * @{
+ * @file    sixlowpan.h
+ * @brief   6lowpan link layer and lowpan functions
+ * @author  Martin Lenders <mlenders@inf.fu-berlin.de>
+ * @}
+ */
+#ifndef SIXLOWPAN_H
+#define SIXLOWPAN_H
+
+#include "sixlowpan/error.h"
+#include "sixlowpan/types.h"
+#include "sixlowpan/borderrouter.h"
+#include "sixlowpan/lowpan.h"
+#include "sixlowpan/mac.h"
+
+#include "../error.h"       /* TODO: remove if not needed anymore */
+#include "../border.h"      /* TODO: remove if not needed anymore */
+#include "../lowpan.h"      /* TODO: remove if not needed anymore */
+#include "../mac.h"         /* TODO: remove if not needed anymore */
+
+#endif /* SIXLOWPAN_H */
diff --git a/sys/net/sixlowpan/include/sixlowpan/borderrouter.h b/sys/net/sixlowpan/include/sixlowpan/borderrouter.h
new file mode 100644
index 0000000000..2f40ee84af
--- /dev/null
+++ b/sys/net/sixlowpan/include/sixlowpan/borderrouter.h
@@ -0,0 +1,24 @@
+/**
+ * 6LoWPAN constants, data structs, and prototypes for 6LoWPAN border router
+ *
+ * Copyright (C) 2013  INRIA.
+ *
+ * This file subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file LICENSE in the top level directory for more
+ * details.
+ *
+ * @ingroup sixlowpan
+ * @{
+ * @file    sixlowpan/borderrouter.h
+ * @brief   6LoWPAN borderrouter header
+ * @author  Stephan Zeisberg <zeisberg@mi.fu-berlin.de>
+ * @author  Martin Lenders <mlenders@inf.fu-berlin.de>
+ * @author  Eric Engel <eric.engel@fu-berlin.de>
+ * @author  Oliver Gesch <oliver.gesch@googlemail.com>
+ * @}
+ */
+
+#ifndef SIXLOWPAN_BORDERROUTER_H
+#define SIXLOWPAN_BORDERROUTER_H
+
+#endif /* SIXLOWPAN_BORDERROUTER_H */
diff --git a/sys/net/sixlowpan/include/sixlowpan/error.h b/sys/net/sixlowpan/include/sixlowpan/error.h
new file mode 100644
index 0000000000..ddecf54051
--- /dev/null
+++ b/sys/net/sixlowpan/include/sixlowpan/error.h
@@ -0,0 +1,21 @@
+/**
+ * 6LoWPAN error codes
+ *
+ * Copyright (C) 2013  INRIA.
+ *
+ * This file subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file LICENSE in the top level directory for more
+ * details.
+ *
+ * @ingroup sixlowpan
+ * @{
+ * @file    sixlowpan/error.h
+ * @brief   6LoWPAN error codes
+ * @author  Martin Lenders <mlenders@inf.fu-berlin.de>
+ * @}
+ */
+
+#ifndef SIXLOWPAN_ERROR_H
+#define SIXLOWPAN_ERROR_H
+
+#endif /* SIXLOWPAN_ERROR_H */
diff --git a/sys/net/sixlowpan/include/sixlowpan/icmp.h b/sys/net/sixlowpan/include/sixlowpan/icmp.h
new file mode 100644
index 0000000000..270091a058
--- /dev/null
+++ b/sys/net/sixlowpan/include/sixlowpan/icmp.h
@@ -0,0 +1,24 @@
+/**
+ * 6LoWPAN constants, data structs, and prototypes related to ICMP
+ *
+ * Copyright (C) 2013  INRIA.
+ *
+ * This file subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file LICENSE in the top level directory for more
+ * details.
+ *
+ * @ingroup sixlowpan
+ * @{
+ * @file    sixlowpan/icmp.h
+ * @brief   6LoWPAN ICMP related header
+ * @author  Stephan Zeisberg <zeisberg@mi.fu-berlin.de>
+ * @author  Martin Lenders <mlenders@inf.fu-berlin.de>
+ * @author  Eric Engel <eric.engel@fu-berlin.de>
+ * @author  Oliver Gesch <oliver.gesch@googlemail.com>
+ * @}
+ */
+
+#ifndef SIXLOWPAN_ICMP_H
+#define SIXLOWPAN_ICMP_H
+
+#endif /* SIXLOWPAN_ICMP_H */
diff --git a/sys/net/sixlowpan/include/sixlowpan/ip.h b/sys/net/sixlowpan/include/sixlowpan/ip.h
new file mode 100644
index 0000000000..b1cfed66d0
--- /dev/null
+++ b/sys/net/sixlowpan/include/sixlowpan/ip.h
@@ -0,0 +1,24 @@
+/**
+ * 6LoWPAN constants, data structs, and prototypes for network layer
+ *
+ * Copyright (C) 2013  INRIA.
+ *
+ * This file subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file LICENSE in the top level directory for more
+ * details.
+ *
+ * @ingroup sixlowpan
+ * @{
+ * @file    sixlowpan/ip.h
+ * @brief   6LoWPAN network layer header
+ * @author  Stephan Zeisberg <zeisberg@mi.fu-berlin.de>
+ * @author  Martin Lenders <mlenders@inf.fu-berlin.de>
+ * @author  Eric Engel <eric.engel@fu-berlin.de>
+ * @author  Oliver Gesch <oliver.gesch@googlemail.com>
+ * @}
+ */
+
+#ifndef SIXLOWPAN_IP_H
+#define SIXLOWPAN_IP_H
+
+#endif /* SIXLOWPAN_IP_H */
diff --git a/sys/net/sixlowpan/include/sixlowpan/lowpan.h b/sys/net/sixlowpan/include/sixlowpan/lowpan.h
new file mode 100644
index 0000000000..4b2d70e66d
--- /dev/null
+++ b/sys/net/sixlowpan/include/sixlowpan/lowpan.h
@@ -0,0 +1,24 @@
+/**
+ * 6LoWPAN constants, data structs, and prototypes for 6LoWPAN layer
+ *
+ * Copyright (C) 2013  INRIA.
+ *
+ * This file subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file LICENSE in the top level directory for more
+ * details.
+ *
+ * @ingroup sixlowpan
+ * @{
+ * @file    sixlowpan/lowpan.h
+ * @brief   6LoWPAN LoWPAN layer header
+ * @author  Stephan Zeisberg <zeisberg@mi.fu-berlin.de>
+ * @author  Martin Lenders <mlenders@inf.fu-berlin.de>
+ * @author  Eric Engel <eric.engel@fu-berlin.de>
+ * @author  Oliver Gesch <oliver.gesch@googlemail.com>
+ * @}
+ */
+
+#ifndef SIXLOWPAN_LOWPAN_H
+#define SIXLOWPAN_LOWPAN_H
+
+#endif /* SIXLOWPAN_LOWPAN_H */
diff --git a/sys/net/sixlowpan/include/sixlowpan/mac.h b/sys/net/sixlowpan/include/sixlowpan/mac.h
index e69de29bb2..fa09dde87d 100644
--- a/sys/net/sixlowpan/include/sixlowpan/mac.h
+++ b/sys/net/sixlowpan/include/sixlowpan/mac.h
@@ -0,0 +1,24 @@
+/**
+ * 6LoWPAN constants, data structs, and prototypes for MAC layer
+ *
+ * Copyright (C) 2013  INRIA.
+ *
+ * This file subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file LICENSE in the top level directory for more
+ * details.
+ *
+ * @ingroup sixlowpan
+ * @{
+ * @file    sixlowpan/mac.h
+ * @brief   6LoWPAN MAC layer header
+ * @author  Stephan Zeisberg <zeisberg@mi.fu-berlin.de>
+ * @author  Martin Lenders <mlenders@inf.fu-berlin.de>
+ * @author  Eric Engel <eric.engel@fu-berlin.de>
+ * @author  Oliver Gesch <oliver.gesch@googlemail.com>
+ * @}
+ */
+
+#ifndef SIXLOWPAN_MAC_H
+#define SIXLOWPAN_MAC_H
+
+#endif /* SIXLOWPAN_MAC_H */
diff --git a/sys/net/sixlowpan/include/sixlowpan/ndp.h b/sys/net/sixlowpan/include/sixlowpan/ndp.h
new file mode 100644
index 0000000000..888bdfdabe
--- /dev/null
+++ b/sys/net/sixlowpan/include/sixlowpan/ndp.h
@@ -0,0 +1,24 @@
+/**
+ * 6LoWPAN constants, data structs, and prototypes related to NDP
+ *
+ * Copyright (C) 2013  INRIA.
+ *
+ * This file subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file LICENSE in the top level directory for more
+ * details.
+ *
+ * @ingroup sixlowpan
+ * @{
+ * @file    sixlowpan/ndp.h
+ * @brief   6LoWPAN NDP related header
+ * @author  Stephan Zeisberg <zeisberg@mi.fu-berlin.de>
+ * @author  Martin Lenders <mlenders@inf.fu-berlin.de>
+ * @author  Eric Engel <eric.engel@fu-berlin.de>
+ * @author  Oliver Gesch <oliver.gesch@googlemail.com>
+ * @}
+ */
+
+#ifndef SIXLOWPAN_NDP_H
+#define SIXLOWPAN_NDP_H
+
+#endif /* SIXLOWPAN_NDP_H */
diff --git a/sys/net/sixlowpan/include/sixlowpan/types.h b/sys/net/sixlowpan/include/sixlowpan/types.h
new file mode 100644
index 0000000000..3ca6a1b4cd
--- /dev/null
+++ b/sys/net/sixlowpan/include/sixlowpan/types.h
@@ -0,0 +1,24 @@
+/**
+ * 6LoWPAN data types
+ *
+ * Copyright (C) 2013  INRIA.
+ *
+ * This file subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file LICENSE in the top level directory for more
+ * details.
+ *
+ * @ingroup sixlowpan
+ * @{
+ * @file    sixlowpan/types.h
+ * @brief   6LoWPAN data types
+ * @author  Stephan Zeisberg <zeisberg@mi.fu-berlin.de>
+ * @author  Martin Lenders <mlenders@inf.fu-berlin.de>
+ * @author  Eric Engel <eric.engel@fu-berlin.de>
+ * @author  Oliver Gesch <oliver.gesch@googlemail.com>
+ * @}
+ */
+
+#ifndef SIXLOWPAN_TYPES_H
+#define SIXLOWPAN_TYPES_H
+
+#endif /* SIXLOWPAN_TYPES_H */
diff --git a/sys/net/sixlowpan/sixlowip.c b/sys/net/sixlowpan/ip.c
similarity index 99%
rename from sys/net/sixlowpan/sixlowip.c
rename to sys/net/sixlowpan/ip.c
index 8a6b58cc2d..8c70c4aa01 100644
--- a/sys/net/sixlowpan/sixlowip.c
+++ b/sys/net/sixlowpan/ip.c
@@ -23,10 +23,10 @@
 #include <vtimer.h>
 #include <mutex.h>
 #include "msg.h"
-#include "sixlowip.h"
-#include "sixlowmac.h"
-#include "sixlownd.h"
-#include "sixlowpan.h"
+#include "ip.h"
+#include "mac.h"
+#include "icmp.h"
+#include "lowpan.h"
 #include "sys/net/destiny/in.h"
 #include "sys/net/destiny/socket.h"
 #include "sys/net/net_help/net_help.h"
diff --git a/sys/net/sixlowpan/sixlowip.h b/sys/net/sixlowpan/ip.h
similarity index 98%
rename from sys/net/sixlowpan/sixlowip.h
rename to sys/net/sixlowpan/ip.h
index 88746a6cbc..355c00dde8 100644
--- a/sys/net/sixlowpan/sixlowip.h
+++ b/sys/net/sixlowpan/ip.h
@@ -20,8 +20,8 @@
 
 /* 6LoWPAN IP header file */
 
-#ifndef SIXLOWIP_H
-#define SIXLOWIP_H
+#ifndef _SIXLOWPAN_IP_H
+#define _SIXLOWPAN_IP_H
 
 #include <stdint.h>
 #include <timex.h>
@@ -185,4 +185,4 @@ uint8_t ipv6_next_hdr_unrec(uint8_t next_hdr);
 void set_tcp_packet_handler_pid(int pid);
 void set_udp_packet_handler_pid(int pid);
 void set_rpl_process_pid(int pid);
-#endif /* SIXLOWIP_H*/
+#endif /* _SIXLOWPAN_IP_H*/
diff --git a/sys/net/sixlowpan/sixlowpan.c b/sys/net/sixlowpan/lowpan.c
similarity index 99%
rename from sys/net/sixlowpan/sixlowpan.c
rename to sys/net/sixlowpan/lowpan.c
index 7c6ac128e2..8d42d950b6 100644
--- a/sys/net/sixlowpan/sixlowpan.c
+++ b/sys/net/sixlowpan/lowpan.c
@@ -18,7 +18,7 @@
  * @}
  */
 
-#include "sixlowip.h"
+#include "ip.h"
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -31,13 +31,13 @@
 #include "mutex.h"
 #include "hwtimer.h"
 #include "msg.h"
-#include "sixlowmac.h"
-#include "sixlowpan.h"
-#include "sixlowborder.h"
-#include "sixlowip.h"
-#include "sixlownd.h"
+#include "mac.h"
+#include "lowpan.h"
+#include "border.h"
+#include "ip.h"
+#include "icmp.h"
 #include "transceiver.h"
-#include "ieee802154/ieee802154_frame.h"
+#include "sys/net/ieee802154/ieee802154_frame.h"
 #include "sys/net/destiny/in.h"
 #include "sys/net/net_help/net_help.h"
 
diff --git a/sys/net/sixlowpan/sixlowpan.h b/sys/net/sixlowpan/lowpan.h
similarity index 97%
rename from sys/net/sixlowpan/sixlowpan.h
rename to sys/net/sixlowpan/lowpan.h
index 0cbe075e8a..58024ccf2d 100644
--- a/sys/net/sixlowpan/sixlowpan.h
+++ b/sys/net/sixlowpan/lowpan.h
@@ -18,8 +18,8 @@
  * @}
  */
 
-#ifndef SIXLOWPAN_H
-#define SIXLOWPAN_H
+#ifndef _SIXLOWPAN_LOWPAN_H
+#define _SIXLOWPAN_LOWPAN_H
 
 #define IP_PROCESS_STACKSIZE           	(3072)
 #define NC_STACKSIZE                   	(512)
@@ -58,7 +58,7 @@
 #define ICMP_RPL_CONTROL                (155)
 
 #include "transceiver.h"
-#include "sixlowip.h"
+#include "ip.h"
 #include "vtimer.h"
 #include "mutex.h"
 
@@ -143,4 +143,4 @@ void lowpan_ipv6_set_dispatch(uint8_t *data);
 void init_reas_bufs(lowpan_reas_buf_t *buf);
 void printReasBuffers(void);
 void printFIFOBuffers(void);
-#endif
+#endif  /* _SIXLOWPAN_LOWPAN_H */
diff --git a/sys/net/sixlowpan/sixlowmac.c b/sys/net/sixlowpan/mac.c
similarity index 97%
rename from sys/net/sixlowpan/sixlowmac.c
rename to sys/net/sixlowpan/mac.c
index 40615dfda1..507c214cc7 100644
--- a/sys/net/sixlowpan/sixlowmac.c
+++ b/sys/net/sixlowpan/mac.c
@@ -24,10 +24,10 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "sixlowmac.h"
-#include "sixlowip.h"
-#include "sixlownd.h"
-#include "sixlowpan.h"
+#include "mac.h"
+#include "ip.h"
+#include "icmp.h"
+#include "lowpan.h"
 #include <ltc4150.h>
 #include <hwtimer.h>
 #include "thread.h"
@@ -35,8 +35,8 @@
 #include "radio/radio.h"
 #include "transceiver.h"
 #include "vtimer.h"
-#include "ieee802154/ieee802154_frame.h"
-#include "net_help/net_help.h"
+#include "sys/net/ieee802154/ieee802154_frame.h"
+#include "sys/net/net_help/net_help.h"
 
 #define ENABLE_DEBUG    (0)
 #include "debug.h"
diff --git a/sys/net/sixlowpan/sixlowmac.h b/sys/net/sixlowpan/mac.h
similarity index 92%
rename from sys/net/sixlowpan/sixlowmac.h
rename to sys/net/sixlowpan/mac.h
index 553b1bab03..85f4a1fb93 100644
--- a/sys/net/sixlowpan/sixlowmac.h
+++ b/sys/net/sixlowpan/mac.h
@@ -18,12 +18,12 @@
  * @}
  */
 
-#ifndef SIXLOWMAC_H
-#define SIXLOWMAC_H
+#ifndef _SIXLOWPAN_MAC_H
+#define _SIXLOWPAN_MAC_H
 
 #include <stdio.h>
 #include <stdint.h>
-#include "sixlowip.h"
+#include "ip.h"
 #include "radio/radio.h"
 #include <transceiver.h>
 
@@ -42,4 +42,4 @@ void init_802154_short_addr(ieee_802154_short_t *saddr);
 void sixlowmac_init(transceiver_type_t type);
 ieee_802154_long_t *mac_get_eui(ipv6_addr_t *ipaddr);
 
-#endif /* SIXLOWMAC_H*/
+#endif /* _SIXLOWPAN_MAC_H*/
diff --git a/sys/net/sixlowpan/semaphore.h b/sys/net/sixlowpan/semaphore.h
index b30b0e4d03..6394e60362 100644
--- a/sys/net/sixlowpan/semaphore.h
+++ b/sys/net/sixlowpan/semaphore.h
@@ -16,8 +16,8 @@
  * @}
  */
 
-#ifndef SEMAPHORE_H
-#define SEMAPHORE_H
+#ifndef _SIXLOWPAN_SEMAPHORE_H
+#define _SIXLOWPAN_SEMAPHORE_H
 
 #include <stdint.h>
 #include <mutex.h>
@@ -32,4 +32,4 @@ void sem_init(sem_t *sem, int8_t value);
 int sem_wait(sem_t *sem);
 int sem_signal(sem_t *sem);
 
-#endif /* SEMAPHORE_H*/
+#endif /* _SIXLOWPAN_SEMAPHORE_H*/
diff --git a/sys/net/sixlowpan/serialnumber.h b/sys/net/sixlowpan/serialnumber.h
index 66cc40502f..d9bbc8ca0f 100644
--- a/sys/net/sixlowpan/serialnumber.h
+++ b/sys/net/sixlowpan/serialnumber.h
@@ -2,8 +2,8 @@
  * Header file for serial number arithmetics [RFC1982]
  */
 
-#ifndef SERIALNUMBER_H
-#define SERIALNUMBER_H
+#ifndef _SIXLOWPAN_SERIALNUMBER_H
+#define _SIXLOWPAN_SERIALNUMBER_H
 #include <stdint.h>
 
 typedef enum serial_comp_res_t {
@@ -79,4 +79,4 @@ serial_comp_res_t serial_comp16(uint16_t s1, uint16_t s2);
  **/
 serial_comp_res_t serial_comp32(uint32_t s1, uint32_t s2);
 
-#endif /* SERIALNUMBER_H*/
+#endif /* _SIXLOWPAN_SERIALNUMBER_H*/
-- 
GitLab