diff --git a/makefile b/Makefile
similarity index 100%
rename from makefile
rename to Makefile
diff --git a/makefile.base b/Makefile.base
similarity index 82%
rename from makefile.base
rename to Makefile.base
index 49daf55740c76dffe795145f8f7e4cb78433dab8..9aefd1102c8f461de992e29b45ec01b7ba8a5a0b 100644
--- a/makefile.base
+++ b/Makefile.base
@@ -1,8 +1,8 @@
-  ASMSRC = $(wildcard *.s)
-  ASMOBJ = $(ASMSRC:%.s=$(BINDIR)%.o)
-  SRC = $(wildcard *.c)
-  OBJ = $(SRC:%.c=$(BINDIR)%.o)
-  DEP = $(SRC:%.c=$(BINDIR)%.d)
+ASMSRC = $(wildcard *.s)
+ASMOBJ = $(ASMSRC:%.s=$(BINDIR)%.o)
+SRC = $(wildcard *.c)
+OBJ = $(SRC:%.c=$(BINDIR)%.o)
+DEP = $(SRC:%.c=$(BINDIR)%.d)
 
 ifeq ($(CPU),lpc2387)
  INCLUDES += -I$(MAKEBASE)/cpu/arm_common/include/
@@ -28,6 +28,11 @@ ifeq ($(BOARD),msba2)
  INCLUDES += -I$(RIOTBOARD)/msba2-common/include/
  INCLUDES += -I$(RIOTBOARD)/msba2-common/drivers/include/
 endif
+ifeq ($(BOARD),msb-430)
+ INCLUDES += -I$(RIOTBOARD)/msb-430/include/
+ INCLUDES += -I$(RIOTBOARD)/msb-430-common/include/
+ INCLUDES += -I$(RIOTBOARD)/msb-430-common/drivers/include/
+endif
 ifeq ($(BOARD),msb-430h)
  INCLUDES += -I$(RIOTBOARD)/msb-430h/include/
  INCLUDES += -I$(RIOTBOARD)/msb-430-common/include/
diff --git a/makefile.dep b/Makefile.dep
similarity index 100%
rename from makefile.dep
rename to Makefile.dep
diff --git a/Makefile.include b/Makefile.include
new file mode 100644
index 0000000000000000000000000000000000000000..a5c850024bafee17e9fac918aa6b470a38c17c55
--- /dev/null
+++ b/Makefile.include
@@ -0,0 +1,45 @@
+# if you want to publish the board into the sources as an uppercase #define
+BB = $(shell echo $(BOARD)|tr 'a-z' 'A-Z')
+CFLAGS += -DBOARD=$(BB)
+export CFLAGS
+
+# mandatory include! 
+include $(RIOTBASE)/Makefile.modules 
+include $(RIOTBOARD)/$(BOARD)/Makefile.include
+
+# your binaries to link
+BASELIBS += $(RIOTBOARD)/$(BOARD)/bin/$(BOARD)_base.a
+BASELIBS += $(PROJBINDIR)/project.a
+
+PROJBINDIR =$(CURDIR)/bin
+
+## make script for your project. Build RIOT-base here!
+all: $(PROJBINDIR)/$(PROJECT).a
+	@echo "Building project $(PROJECT) for $(BOARD) w/ MCU $(CPU)."
+	$(MAKE) -C $(RIOTBOARD)
+	$(MAKE) -C $(RIOTBASE)
+	$(LINK) $(LINKFLAGS) $(UNDEF) -o $(PROJBINDIR)/$(PROJECT).elf -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group  -Wl,-Map=$(PROJBINDIR)/$(PROJECT).map
+	$(SIZE) $(PROJBINDIR)/$(PROJECT).elf
+	$(OBJCOPY) -O ihex $(PROJBINDIR)/$(PROJECT).elf $(PROJBINDIR)/$(PROJECT).hex
+
+## your make rules
+## Only basic example - modify it for larger projects!!
+$(PROJBINDIR)/$(PROJECT).a: $(PROJBINDIR)/$(PROJECT).o
+	$(AR) -rc $(PROJBINDIR)/project.a $(PROJBINDIR)/$(PROJECT).o 
+	
+$(PROJBINDIR)/$(PROJECT).o: main.c 
+	$(CC) $(CFLAGS) $(BOARDINCLUDE) $(INCLUDES) -c main.c -o $(PROJBINDIR)/$(PROJECT).o
+
+clean:
+	$(MAKE) -C $(RIOTBOARD) clean
+	$(MAKE) -C $(RIOTBASE) clean
+	rm -f $(PROJBINDIR)/*
+
+flash: all
+	$(FLASH) $(PORT) $(PROJBINDIR)/$(PROJECT).hex
+
+term:
+	$(TERM) $(PORT)
+
+doc:
+	make -BC $(RIOTBASE) doc
diff --git a/makefile.modules b/Makefile.modules
similarity index 95%
rename from makefile.modules
rename to Makefile.modules
index a2df71ea86bcbfabbe9172ebf3e470b48407da7d..d3329c2338b9c7eff92ed09cb0d2c24fda5c4a42 100644
--- a/makefile.modules
+++ b/Makefile.modules
@@ -25,6 +25,6 @@ BL=$(USEMODULE:%= $(BINDIR)%.a)
 export BASELIBS = $(shell echo $(BL)|sed 's/[^ ]*hwtimer.a//')
 CFLAGS += $(EXTDEFINES)
 
-include $(RIOTBASE)/makefile.dep
+include $(RIOTBASE)/Makefile.dep
 
 export USEMODULE
diff --git a/core/makefile b/core/Makefile
similarity index 81%
rename from core/makefile
rename to core/Makefile
index ba54604b5c1de355ed8d76615038db5a8d9e7fd0..08d75b1707649947da896f1dae05f348d9d534ae 100644
--- a/core/makefile
+++ b/core/Makefile
@@ -2,4 +2,4 @@ MODULE =core
 
 INCLUDES = -Iinclude/ -I../sys/include -I../sys/lib -I../sys/drivers/include -I../cpu/$(CPU)/include/ -I../.. -I../drivers/include/
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
diff --git a/core/include/atomic.h b/core/include/atomic.h
index c24981f9f1905f03f2d732a214bf1252c658fc64..8733e5037ec0ba195696ec41874790d9c8d0cc38 100644
--- a/core/include/atomic.h
+++ b/core/include/atomic.h
@@ -9,7 +9,7 @@
  * @ingroup	kernel
  * @{
  * @file
- * @author Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author Freie Universität Berlin, Computer Systems & Telematics
  * @author Kaspar Schleiser <kaspar.schleiser@fu-berlin.de>
  */
 
diff --git a/core/include/bitarithm.h b/core/include/bitarithm.h
index d159f33348ba3182c052a11d44e894ec78170667..022e09b396aa183893e19e96e545b1c054708389 100644
--- a/core/include/bitarithm.h
+++ b/core/include/bitarithm.h
@@ -10,7 +10,7 @@
  * @ingroup	lib
  * @{
  * @file
- * @author Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author Freie Universität Berlin, Computer Systems & Telematics
  * @author Kaspar Schleiser <kaspar.schleiser@fu-berlin.de>
  */
 
diff --git a/core/include/clist.h b/core/include/clist.h
index 2dac25f09b30b784f4e9da2748e632c420060d01..5df80db5bc47be06067ae7b0682162a735bea758 100644
--- a/core/include/clist.h
+++ b/core/include/clist.h
@@ -11,7 +11,7 @@
  * @ingroup	lib
  * @{
  * @file
- * @author Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author Freie Universität Berlin, Computer Systems & Telematics
  * @author Kaspar Schleiser <kaspar.schleiser@fu-berlin.de>
  */
 
diff --git a/core/include/debug.h b/core/include/debug.h
index d680fd5aa74252f7df892518ecd1d23fcb919b12..649171de72662ad61578506b0c800d891df057b4 100644
--- a/core/include/debug.h
+++ b/core/include/debug.h
@@ -11,7 +11,7 @@
  * @ingroup	kernel
  * @{
  * @file
- * @author Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author Freie Universität Berlin, Computer Systems & Telematics
  * @author Kaspar Schleiser <kaspar.schleiser@fu-berlin.de>
  * @}
  */
diff --git a/core/include/hwtimer.h b/core/include/hwtimer.h
index 7a2ce835d87277315c5507b536259ee4c25556d4..9dcd3fc5ebb0b69869c095414dea49b81d42202c 100644
--- a/core/include/hwtimer.h
+++ b/core/include/hwtimer.h
@@ -15,7 +15,7 @@
  * @{
  * @file
  *
- * @author Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author Freie Universität Berlin, Computer Systems & Telematics
  * @author Heiko Will
  * @author Kaspar Schleiser <kaspar@schleiser.de>
  * @author Michael Baar
diff --git a/core/include/hwtimer_arch.h b/core/include/hwtimer_arch.h
index ab7e841400889b3a5265a44cdde6f5119ebd1c5c..2c872521e6667e8c51b67577db0027381d0d73a5 100644
--- a/core/include/hwtimer_arch.h
+++ b/core/include/hwtimer_arch.h
@@ -9,7 +9,7 @@
  * @ingroup	kernel
  * @{
  * @file
- * @author Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author Freie Universität Berlin, Computer Systems & Telematics
  * @author Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author Heiko Will <hwill@inf.fu-berlin.de>
  * @author Kaspar Schleiser <kaspar.schleiser@fu-berlin.de>
@@ -41,8 +41,7 @@ void hwtimer_arch_disable_interrupt(void);
 void hwtimer_arch_set(unsigned long offset, short timer);
 
 /**
- * Set a kernel timer to raise an interrupt after ::offset kernel timer ticks
- * from now.
+ * Set a kernel timer to raise an interrupt at specified system time.
  */
 void hwtimer_arch_set_absolute(unsigned long value, short timer);
 
diff --git a/core/include/kernel.h b/core/include/kernel.h
index 49dda3664b248dda0457a2d8fddfac74d256f2f8..17bad798789c2ed4e52b8122220df4a917e8ff4a 100644
--- a/core/include/kernel.h
+++ b/core/include/kernel.h
@@ -9,7 +9,7 @@
  * @ingroup kernel
  * @{
  * @file
- * @author Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author Freie Universität Berlin, Computer Systems & Telematics
  * @author Kaspar Schleiser <kaspar.schleiser@fu-berlin.de>
  */
 
diff --git a/core/include/kernel_intern.h b/core/include/kernel_intern.h
index 95c7877eb9c28096ff321bbf3ad9c11c2ce60720..606bc6e49928f451bcce4716cb931a9a05730edf 100644
--- a/core/include/kernel_intern.h
+++ b/core/include/kernel_intern.h
@@ -2,7 +2,7 @@
  * @ingroup	kernel
  * @{
  * @file
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Kaspar Schleiser <kaspar@schleiser.de>
  */
 
diff --git a/core/include/lpm.h b/core/include/lpm.h
index 95b2d7b5be06ec4c2ef3abfcb13914229cfe5cd6..a10ded35466a7b7cc34af5f31d6d4f2aaebf17a9 100644
--- a/core/include/lpm.h
+++ b/core/include/lpm.h
@@ -11,7 +11,7 @@
  * @file
  * @brief       Power Management Interface
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @version     $Revision$
  *
  * This interface needs to be implemented for each platform.
diff --git a/core/include/msg.h b/core/include/msg.h
index fe9792caf68ddabbe21172a0f0e067ce0534f97f..d907ccf99d07413302c2a8365cd15f4c9d13c4a9 100644
--- a/core/include/msg.h
+++ b/core/include/msg.h
@@ -1,5 +1,5 @@
 /**
- *  There are two ways to use the IPC Messaging system of µkleos. The default is synchronous
+ *  There are two ways to use the IPC Messaging system of RIOT. The default is synchronous
  *  messaging. In this manner, messages are either dropped when the receiver is not waiting and the
  *  message was sent non-blocking, or will be delivered immediately when the receiver calls
  *  msg_receive(msg_t* m). To use asynchronous messaging any thread can create its own queue by
@@ -14,7 +14,7 @@
 
 /**
  * @file
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author      Kaspar Schleiser <kaspar@schleiser.de>
  */
 
diff --git a/core/include/mutex.h b/core/include/mutex.h
index 5140881ee441b35f837e031f8bf07460c3f41bd4..3613e91a4a8e6a54d4ef6800519added8155a91a 100644
--- a/core/include/mutex.h
+++ b/core/include/mutex.h
@@ -6,7 +6,7 @@
 
 /**
  * @file
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author      Kaspar Schleiser <kaspar@schleiser.de>
  */
 
diff --git a/core/include/oneway_malloc.h b/core/include/oneway_malloc.h
index 56daf2cc808ccfab9b47360a6d94a7cf96f8825c..d030dd6759ed19eb5ea7f1efbba16cd346af5b03 100644
--- a/core/include/oneway_malloc.h
+++ b/core/include/oneway_malloc.h
@@ -2,7 +2,7 @@
  * @ingroup kernel
  * @{
  * @file
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author      Kaspar Schleiser <kaspar@schleiser.de>
  */
 
diff --git a/core/include/queue.h b/core/include/queue.h
index ae377409ded7341cee866f3f62e2a24209e6878e..2e3cab39f8bcf814a73e30799c592388bc132b0b 100644
--- a/core/include/queue.h
+++ b/core/include/queue.h
@@ -2,7 +2,7 @@
  * @ingroup kernel
  * @{
  * @file
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author      Kaspar Schleiser <kaspar@schleiser.de>
  */
 
diff --git a/core/include/sched.h b/core/include/sched.h
index 5f3c3ce15c23600358b37f039b5286e795ea2780..108914d5a92d2b04d9a3020b6860e7d9b271d6e8 100644
--- a/core/include/sched.h
+++ b/core/include/sched.h
@@ -2,7 +2,7 @@
  * @ingroup kernel
  * @{
  * @file
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author      Kaspar Schleiser <kaspar@schleiser.de>
  */
 
diff --git a/core/include/tcb.h b/core/include/tcb.h
index 9d6f5f26cf24d978db3cd9cd5bc14f8b19890d99..729837d5944477de032856027186fd1332e21fe0 100644
--- a/core/include/tcb.h
+++ b/core/include/tcb.h
@@ -2,7 +2,7 @@
  * @ingroup kernel
  * @{
  * @file
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author      Kaspar Schleiser <kaspar@schleiser.de>
  */
 
diff --git a/core/include/thread.h b/core/include/thread.h
index 31fb4e80a6ad5a32e06d4d8edd00b4248c66a450..f4cb0bad5e1e5463ff32c1db1da54160ba7f745f 100644
--- a/core/include/thread.h
+++ b/core/include/thread.h
@@ -9,7 +9,7 @@
 
 /**
  * @file
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author      Kaspar Schleiser <kaspar@schleiser.de>
  */
 
diff --git a/core/kernel_init.c b/core/kernel_init.c
index 6af76399cf9f0d9c97182a2fa49d1d534c8f037c..3124ce65f5eabc324b1ea3682107a9c80c9deb68 100644
--- a/core/kernel_init.c
+++ b/core/kernel_init.c
@@ -68,7 +68,7 @@ static char idle_stack[KERNEL_CONF_STACKSIZE_IDLE];
 void kernel_init(void)
 {
     dINT();
-    printf("kernel_init(): This is ukleos!\n");
+    printf("kernel_init(): This is RIOT!\n");
     
     sched_init();
 
diff --git a/core/sched.c b/core/sched.c
index fd905db895b81d969e933f7bf3abc0d10f87d4ea..120e818156eec53ef31ae01b2fdbec2b3d92c2c5 100644
--- a/core/sched.c
+++ b/core/sched.c
@@ -1,5 +1,5 @@
 /**
- * The µkleos scheduler implementation
+ * The RIOT scheduler implementation
  *
  * Copyright (C) 2010 Freie Universität Berlin
  *
diff --git a/cpu/makefile b/cpu/Makefile
similarity index 100%
rename from cpu/makefile
rename to cpu/Makefile
diff --git a/cpu/arm_common/makefile b/cpu/arm_common/Makefile
similarity index 85%
rename from cpu/arm_common/makefile
rename to cpu/arm_common/Makefile
index 0ac2b1fe102aaea111322a2a22625fb40bc630f6..46db97e247a38837ed087cffcc839757eb5bd438 100644
--- a/cpu/arm_common/makefile
+++ b/cpu/arm_common/Makefile
@@ -1,7 +1,7 @@
 MODULE =arm_common
 INCLUDES = -Iinclude -I../$(CPU)/include -I../../sys/lib -I../../drivers/include -I../../core/include -I../../sys/include -I../../hal/include -I../../.. -I../../sys/lib/fat
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
 
 
diff --git a/cpu/arm_common/bootloader.c b/cpu/arm_common/bootloader.c
index f68a75e07b7d794be7c43745a91de3b8657edc14..56bfc39958ed8909a25ddd09261b37177352108c 100644
--- a/cpu/arm_common/bootloader.c
+++ b/cpu/arm_common/bootloader.c
@@ -4,14 +4,14 @@ Copyright 2008-2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -34,7 +34,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief       ARM bootloader
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author      Heiko Will <hwill@inf.fu-berlin.de>
  * @author      Michael Baar <michael.baar@fu-berlin.de>
  * @version     $Revision$
diff --git a/cpu/arm_common/hwtimer_cpu.c b/cpu/arm_common/hwtimer_cpu.c
index a959429c8bbe26a6ee00bd3c8d6ed586a7fde935..beadde7607133e8cdab940a405906ea17c0117e6 100644
--- a/cpu/arm_common/hwtimer_cpu.c
+++ b/cpu/arm_common/hwtimer_cpu.c
@@ -4,7 +4,7 @@
  * @internal
  * @brief       ARM kernel timer CPU dependent functions implementation
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author      Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author      Heiko Will <hwill@inf.fu-berlin.de>
  *
diff --git a/cpu/arm_common/include/arm_common.h b/cpu/arm_common/include/arm_common.h
index b4fa4994925b3c71b517f2daf28fa401392fb2dc..2fdc7d200ec489d751a14a795dec5776914385cc 100644
--- a/cpu/arm_common/include/arm_common.h
+++ b/cpu/arm_common/include/arm_common.h
@@ -4,14 +4,14 @@ Copyright 2008-2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -37,7 +37,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		ARM CPU common declarations
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @version     $Revision$
  *
  * @note		$Id$
diff --git a/cpu/arm_common/syscalls.c b/cpu/arm_common/syscalls.c
index 14dcda90a12e9e438ae018f25743052d2aca83e4..b9103ff59218351d8ad69b829f305c5c3c0ab45b 100644
--- a/cpu/arm_common/syscalls.c
+++ b/cpu/arm_common/syscalls.c
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -29,7 +29,7 @@ and the mailinglist (subscription via web site)
  * @ingroup		lpc2387
  * @brief		LPC2387 NewLib system calls implementation
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Michael Baar <michael.baar@fu-berlin.de>
  * @version     $Revision$
  *
diff --git a/cpu/cc430/makefile b/cpu/cc430/Makefile
similarity index 90%
rename from cpu/cc430/makefile
rename to cpu/cc430/Makefile
index 734a4056a655e1dd6c3cb5e1bf6ab706e84f58ea..05b082a94bb32685f3a420011c93324c07da1e77 100644
--- a/cpu/cc430/makefile
+++ b/cpu/cc430/Makefile
@@ -6,7 +6,7 @@ DIRS =
 all: $(BINDIR)$(MODULE).a
 	@for i in $(DIRS) ; do $(MAKE) -C $$i ; done ;
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
 clean::
 	@for i in $(DIRS) ; do $(MAKE) -C $$i clean ; done ;
diff --git a/cpu/cc430/cc430-gpioint.c b/cpu/cc430/cc430-gpioint.c
index 56cdbf1511851a56ecedfc0fd222a8f3260a091c..6775b81f9e3e26903eb580ddabbc7d5b46367300 100644
--- a/cpu/cc430/cc430-gpioint.c
+++ b/cpu/cc430/cc430-gpioint.c
@@ -4,14 +4,14 @@ Copyright 2010, Freie Universität Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of µkleos.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/cpu/cc430/cc430-rtc.c b/cpu/cc430/cc430-rtc.c
index 8d2b43fcb75d21965643201194b368fed66c7e8b..f37de3732855d2b242722b3a0e492c14660f47bf 100644
--- a/cpu/cc430/cc430-rtc.c
+++ b/cpu/cc430/cc430-rtc.c
@@ -4,14 +4,14 @@ Copyright 2010, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of µkleos.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/cpu/cc430/include/cc430-rtc.h b/cpu/cc430/include/cc430-rtc.h
index 15e27bdb40cd2ff3afda92c42f3f053042b4dc2f..b3b7d5596c95da246a5f3067aeb8fd671509d1b5 100644
--- a/cpu/cc430/include/cc430-rtc.h
+++ b/cpu/cc430/include/cc430-rtc.h
@@ -4,14 +4,14 @@ Copyright 2010, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of µkleos.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -38,7 +38,7 @@ and the mailinglist (subscription via web site)
  * @file    cc430-rtc.h
  * @brief   CC430 Real Time Clock
  *
- * @author  Freie Universität Berlin, Computer Systems & Telematics, µkleos
+ * @author  Freie Universität Berlin, Computer Systems & Telematics, RIOT
  * @version $Revision $
  */
 
diff --git a/cpu/lpc214x/makefile b/cpu/lpc214x/Makefile
similarity index 100%
rename from cpu/lpc214x/makefile
rename to cpu/lpc214x/Makefile
diff --git a/cpu/lpc214x/include/cpu.h b/cpu/lpc214x/include/cpu.h
index e439e61fd1a7d791cb58575d101babef59f3a54f..0a8dcdad4799f8fc6bcb401407f53057dfcc8ae3 100644
--- a/cpu/lpc214x/include/cpu.h
+++ b/cpu/lpc214x/include/cpu.h
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/cpu/lpc2387/makefile b/cpu/lpc2387/Makefile
similarity index 93%
rename from cpu/lpc2387/makefile
rename to cpu/lpc2387/Makefile
index a85865698aca4fd9bbaa2a59bfb0a24993e3c753..963571e2ae958e8ab351843b86bf10ffff5f1577 100644
--- a/cpu/lpc2387/makefile
+++ b/cpu/lpc2387/Makefile
@@ -15,7 +15,7 @@ endif
 all: $(BINDIR)$(MODULE).a
 	@for i in $(DIRS) ; do $(MAKE) -C $$i ; done ;
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
 clean::
 	@for i in $(DIRS) ; do $(MAKE) -C $$i clean ; done ;
diff --git a/cpu/lpc2387/cpu.c b/cpu/lpc2387/cpu.c
index c68bb6d6b9acabee6b80a62ccebd4419a77f836b..07ed4856c68e91a006b9250bae23c96445262fac 100644
--- a/cpu/lpc2387/cpu.c
+++ b/cpu/lpc2387/cpu.c
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/cpu/lpc2387/gpioint/makefile b/cpu/lpc2387/gpioint/Makefile
similarity index 84%
rename from cpu/lpc2387/gpioint/makefile
rename to cpu/lpc2387/gpioint/Makefile
index cf2b29f89140018d50ba9f538bfe982be38c73ba..758cd9f320d2ca2d1a79dc3544028ec1359ff3b9 100644
--- a/cpu/lpc2387/gpioint/makefile
+++ b/cpu/lpc2387/gpioint/Makefile
@@ -2,5 +2,5 @@ INCLUDES = -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/include -I../../net -
 
 MODULE =gpioint
 
-include $(MAKEBASE)/makefile.base
+include $(MAKEBASE)/Makefile.base
 
diff --git a/cpu/lpc2387/gpioint/lpc2387-gpioint.c b/cpu/lpc2387/gpioint/lpc2387-gpioint.c
index 49417274547f8c27b3e671c3a465906e117ffefe..30706da9d400c34173eaee74d4806eea2df86543 100644
--- a/cpu/lpc2387/gpioint/lpc2387-gpioint.c
+++ b/cpu/lpc2387/gpioint/lpc2387-gpioint.c
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -34,7 +34,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		LPC2387 GPIO Interrupt Multiplexer implementation
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Michael Baar <michael.baar@fu-berlin.de>
  * @version     $Revision: 1508 $
  *
diff --git a/cpu/lpc2387/include/cpu-conf.h b/cpu/lpc2387/include/cpu-conf.h
index 9e6a2dde94e49b10bf018d038ddfdbbe4243af68..5f7c2860b45a3ba76fc618b14e9d633414c12b1d 100644
--- a/cpu/lpc2387/include/cpu-conf.h
+++ b/cpu/lpc2387/include/cpu-conf.h
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -38,7 +38,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		LPC2387 CPUconfiguration
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		baar
  * @version     $Revision$
  *
diff --git a/cpu/lpc2387/include/cpu.h b/cpu/lpc2387/include/cpu.h
index 70e2bc7e3075b3207690d3c95aa95619ffb376d7..659ba8c84c1896e9d447e4475304027afd37bf2c 100644
--- a/cpu/lpc2387/include/cpu.h
+++ b/cpu/lpc2387/include/cpu.h
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/cpu/lpc2387/include/lpc2387-adc.h b/cpu/lpc2387/include/lpc2387-adc.h
index 9f832a5ae605600b12480a904048382ac224cf4a..b273c27ce86127ef222dfbea295e4015f07f1335 100644
--- a/cpu/lpc2387/include/lpc2387-adc.h
+++ b/cpu/lpc2387/include/lpc2387-adc.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -38,7 +38,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		LPC2387 ADC
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @version     $Revision: 3249 $
  *
diff --git a/cpu/lpc2387/include/lpc2387-rtc.h b/cpu/lpc2387/include/lpc2387-rtc.h
index 080a330cfc28295ebe217d3f0d88fc61c5a31bc3..600554cc02eb661602195ccfb188ac384a579949 100644
--- a/cpu/lpc2387/include/lpc2387-rtc.h
+++ b/cpu/lpc2387/include/lpc2387-rtc.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -42,7 +42,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		LPC2387 Real-Time-Clock
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @version     $Revision: 1998 $
  *
  * @note    	$Id: lpc2387-rtc.h 1998 2010-03-16 13:05:41Z baar $
diff --git a/cpu/lpc2387/linkerscript.x b/cpu/lpc2387/linkerscript.x
index efa60aaa2995083efcfee249923792600da35642..79ca56a93bc42cef93c84801674135f1b1367c73 100644
--- a/cpu/lpc2387/linkerscript.x
+++ b/cpu/lpc2387/linkerscript.x
@@ -4,14 +4,14 @@ Copyright 2008-2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/cpu/lpc2387/lpc2387-adc.c b/cpu/lpc2387/lpc2387-adc.c
index f3348a3d185d12ea3365aebc4e5f3e1a54779e7d..274876fbe4e40e99a4c603a2e6761eabbcfd43a5 100644
--- a/cpu/lpc2387/lpc2387-adc.c
+++ b/cpu/lpc2387/lpc2387-adc.c
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -29,7 +29,7 @@ and the mailinglist (subscription via web site)
  * @ingroup		lpc2387_adc
  * @brief		LPC2387 ADC
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @version     $Revision: 3250 $
  *
diff --git a/cpu/lpc2387/lpc2387-lpm.c b/cpu/lpc2387/lpc2387-lpm.c
index e14cd9a30ddbe7e08af570cd7c6e05ef9f9719aa..8261873d405443daee93ef208f466dd04ddf4de0 100644
--- a/cpu/lpc2387/lpc2387-lpm.c
+++ b/cpu/lpc2387/lpc2387-lpm.c
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -34,7 +34,7 @@ and the mailinglist (subscription via web site)
  * @brief		LPC2387 Low-Power management
  * @ingroup		lpc2387
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author 		Heiko Will
  * @version     $Revision$
  *
diff --git a/cpu/lpc2387/mci/makefile b/cpu/lpc2387/mci/Makefile
similarity index 84%
rename from cpu/lpc2387/mci/makefile
rename to cpu/lpc2387/mci/Makefile
index cdffdd035de4fcdcf7f3ab85f326f8eacab1babd..9034267a5b25440a529e316c79f895784b947656 100644
--- a/cpu/lpc2387/mci/makefile
+++ b/cpu/lpc2387/mci/Makefile
@@ -2,5 +2,5 @@ INCLUDES = -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/include -I../../net -
 
 MODULE =mci
 
-include $(MAKEBASE)/makefile.base
+include $(MAKEBASE)/Makefile.base
 
diff --git a/cpu/lpc2387/rtc/makefile b/cpu/lpc2387/rtc/Makefile
similarity index 70%
rename from cpu/lpc2387/rtc/makefile
rename to cpu/lpc2387/rtc/Makefile
index b3b66a79c80cfb25331337535410b820218d4d7e..8cd5c1e0af1de5ade99fbd0d4920ad59a722a852 100644
--- a/cpu/lpc2387/rtc/makefile
+++ b/cpu/lpc2387/rtc/Makefile
@@ -2,5 +2,5 @@ INCLUDES = -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/core/include
 
 MODULE =rtc
 
-include $(MAKEBASE)/makefile.base
+include $(MAKEBASE)/Makefile.base
 
diff --git a/cpu/lpc2387/rtc/lpc2387-rtc.c b/cpu/lpc2387/rtc/lpc2387-rtc.c
index 4642042a6b2c9164f5839119528b2363dd6978b3..0364fb77935be0e8520a7674b639e778c0cfda82 100644
--- a/cpu/lpc2387/rtc/lpc2387-rtc.c
+++ b/cpu/lpc2387/rtc/lpc2387-rtc.c
@@ -4,14 +4,14 @@ Copyright 2008-2010, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -29,7 +29,7 @@ and the mailinglist (subscription via web site)
  * @ingroup		lpc2387_rtc
  * @brief		LPC2387 Real-Time-Clock
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Michael Baar <michael.baar@fu-berlin.de>
  * @version     $Revision: 2005 $
  *
diff --git a/cpu/msp430-common/makefile b/cpu/msp430-common/Makefile
similarity index 87%
rename from cpu/msp430-common/makefile
rename to cpu/msp430-common/Makefile
index c08dbbb89ed80a2ef926be692acac789a651547d..fd8276dbbaffe75b499f45975fb3412cc9011127 100644
--- a/cpu/msp430-common/makefile
+++ b/cpu/msp430-common/Makefile
@@ -6,7 +6,7 @@ DIRS =
 all: $(BINDIR)$(MODULE).a
 	@for i in $(DIRS) ; do $(MAKE) -C $$i ; done ;
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
 clean::
 	@for i in $(DIRS) ; do $(MAKE) -C $$i clean ; done ;
diff --git a/cpu/msp430-common/cpu.c b/cpu/msp430-common/cpu.c
index a297ec08d43dbaa4b5bf7996b544be210fd07f66..c7288cb94a185bd15314f4b317dde3edb3b92104 100644
--- a/cpu/msp430-common/cpu.c
+++ b/cpu/msp430-common/cpu.c
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/cpu/msp430-common/flashrom.c b/cpu/msp430-common/flashrom.c
index 94d2e023f88196681a24ef0883161e1f9ce7e17f..3419fcfc70f25ca910d925c70c9942e9cd2d64db 100644
--- a/cpu/msp430-common/flashrom.c
+++ b/cpu/msp430-common/flashrom.c
@@ -1,7 +1,6 @@
 #include <stddef.h>
 #include <stdint.h>
 #include  <msp430x16x.h>
-#include <msp430/flash.h>
 #include <irq.h>
 
 uint8_t ie1, ie2;
diff --git a/cpu/msp430-common/hwtimer_cpu.c b/cpu/msp430-common/hwtimer_cpu.c
index 0427e32a3f1b0e73623282fa1ff6feafe3cfc6b6..41024ac3418a1e676a7418fa405afc9123a79898 100644
--- a/cpu/msp430-common/hwtimer_cpu.c
+++ b/cpu/msp430-common/hwtimer_cpu.c
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/cpu/msp430-common/include/cpu-conf.h b/cpu/msp430-common/include/cpu-conf.h
index a79e422f54f5c55b27790d0954582066f7e1b3c9..a7cca6aa22aac543a5037205c049812c650655b6 100644
--- a/cpu/msp430-common/include/cpu-conf.h
+++ b/cpu/msp430-common/include/cpu-conf.h
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/cpu/msp430-common/include/cpu.h b/cpu/msp430-common/include/cpu.h
index 99d49f11312051c6cc36f9e5d0c9aaab00fe8326..a3e0a1df8c854471898398456da7a2131b2e4e05 100644
--- a/cpu/msp430-common/include/cpu.h
+++ b/cpu/msp430-common/include/cpu.h
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/cpu/msp430-common/include/hwtimer_cpu.h b/cpu/msp430-common/include/hwtimer_cpu.h
index 315153921891ac1c397cb080762f6b42ed7abb6d..a60012b02ea791ea58008f724d0a0b27ced97698 100644
--- a/cpu/msp430-common/include/hwtimer_cpu.h
+++ b/cpu/msp430-common/include/hwtimer_cpu.h
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/cpu/msp430-common/msp430-main.c b/cpu/msp430-common/msp430-main.c
index c5363076f298d117729713e97cd2c7776e2f6885..a77f81759784e09dad84de8536087b003f429946 100644
--- a/cpu/msp430-common/msp430-main.c
+++ b/cpu/msp430-common/msp430-main.c
@@ -32,7 +32,6 @@
  *
  * Modified by Kaspar Schleiser
  */
-#include <sys/unistd.h>
 
 #include "cpu.h"
 #include <msp430x16x.h>
diff --git a/cpu/msp430-common/startup.c b/cpu/msp430-common/startup.c
index 230a0fd8004437ae0e0eeaeb709a1f6f7b3d8955..bad3bb95ccc42a7dc6a6d321334111ce776987a0 100644
--- a/cpu/msp430-common/startup.c
+++ b/cpu/msp430-common/startup.c
@@ -9,7 +9,7 @@ __attribute__ ((constructor)) static void startup(void) {
 
     board_init();
 
-    puts("ukleos MSP430 hardware initialization complete.\n");
+    puts("RIOT MSP430 hardware initialization complete.\n");
 
     kernel_init();
 }
diff --git a/cpu/msp430x16x/makefile b/cpu/msp430x16x/Makefile
similarity index 86%
rename from cpu/msp430x16x/makefile
rename to cpu/msp430x16x/Makefile
index 07f55710d9fe6eb1a6bc4e230ea61c5d31bb1f40..bfc3c1924fb164f514b08dfb97ab74461d67b3dc 100644
--- a/cpu/msp430x16x/makefile
+++ b/cpu/msp430x16x/Makefile
@@ -6,7 +6,7 @@ DIRS =
 all: $(BINDIR)$(MODULE).a
 	@for i in $(DIRS) ; do $(MAKE) -C $$i ; done ;
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
 clean::
 	@for i in $(DIRS) ; do $(MAKE) -C $$i clean ; done ;
diff --git a/dist/Makefile b/dist/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..0ff3694e5fc66cf7fafcb57a4fd03b1ecb612348
--- /dev/null
+++ b/dist/Makefile
@@ -0,0 +1,31 @@
+####
+#### Sample Makefile for building apps with the RIOT OS
+####
+#### The Sample Filesystem Layout is:
+#### /this makefile
+#### ../../RIOT 
+#### ../../boards   for board definitions (if you have one or more)
+####/.. 
+
+# name of your project
+export PROJECT =foobar
+
+# for easy switching of boards
+export BOARD = msb-430
+
+# this has to be the absolute path of the RIOT-base dir
+export RIOTBASE =$(CURDIR)/../../RIOT
+export RIOTBOARD =$(CURDIR)/../../boards
+
+## Modules to include. 
+
+#USEMODULE += shell
+#USEMODULE += vtimer
+#USEMODULE += sht11
+#USEMODULE += ltc4150
+#USEMODULE += cc110x
+#USEMODULE += fat
+
+export INCLUDES = -I$(RIOTBOARD)/$(BOARD)/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/cpu/$(CPU)/include -I$(RIOTBASE)/cpu/arm_common/include -I$(RIOTBASE)/sys/lib -I$(RIOTBASE)/sys/include/ -I$(RIOTBASE)/drivers/include/
+
+include $(RIOTBASE)/Makefile.include
diff --git a/dist/makefile b/dist/makefile
deleted file mode 100644
index 97a69a87c0c83bd9241aa91cbc96884c23ea354b..0000000000000000000000000000000000000000
--- a/dist/makefile
+++ /dev/null
@@ -1,122 +0,0 @@
-####
-#### Sample Makefile for building apps with the RIOT OS
-####
-#### The Sample Filesystem Layout is:
-#### /this makefile
-#### ../RIOT 
-#### ../RIOT/board   for board definitions (if you have one or more)
-#### 
-
-#### Mandatory vars!
-
-# this has to be the absolute path of the RIOT-base dir
-export RIOTBASE =$(CURDIR)/../RIOT
-export RIOTBOARD =$(CURDIR)/../RIOT/board
-
-# the cpu to build for
-export CPU = lpc2387
-
-# toolchain config
-export PREFIX = @arm-elf-
-export CC = @$(PREFIX)gcc
-export AR = @$(PREFIX)ar
-export CFLAGS = -std=gnu99 -O2 -Wall -Wstrict-prototypes -mcpu=arm7tdmi-s -gdwarf-2
-export ASFLAGS = -gdwarf-2 -mcpu=arm7tdmi-s
-export AS = $(PREFIX)as
-export LINK = $(PREFIX)gcc
-export SIZE = $(PREFIX)size
-export OBJCOPY = $(PREFIX)objcopy
-FLASH = lpc2k_pgm
-TERM = pyterm.py
-LINKFLAGS = -gdwarf-2 -mcpu=arm7tdmi-s -static -lgcc -nostartfiles -T$(RIOTBASE)/cpu/$(CPU)/linkerscript.x
-
-PROJBINDIR = bin
-
-ifeq ($(strip $(PORT)),)
-	PORT = /dev/ttyUSB0
-endif
-
-## Modules to include. 
-
-#USEMODULE += nanopan5375_proprietary
-#USEMODULE += sys
-#USEMODULE += cmdd
-#USEMODULE += logd
-#USEMODULE += mprint
-#USEMODULE += mqueue
-#USEMODULE += sync_read
-#USEMODULE += sysmon
-#USEMODULE += syslog
-#USEMODULE += tracelog
-#USEMODULE += shell
-#USEMODULE += utimer
-#USEMODULE += sht11
-#USEMODULE += powermon
-#USEMODULE += ltc4150
-#USEMODULE += sys_config
-#USEMODULE += cc110x
-#USEMODULE += cmdengine
-#USEMODULE += ezxml
-#USEMODULE += fat
-#USEMODULE += gps
-#USEMODULE += geo
-#USEMODULE += gps_conversion
-#USEMODULE += gps_ublox
-#USEMODULE += net_kernel
-#USEMODULE += net_mm
-
-#### Project Config 
-
-# name of your project
-PROJECT = hello-world
-
-# for easy switching of boards
-export BOARD = msba2
-
-# mandatory include! 
-include $(RIOTBASE)/makefile.modules 
-
-# if you want to publish the board into the sources as an uppercase #define
-BB = $(shell echo $(BOARD)|tr 'a-z' 'A-Z')
-CFLAGS += -DBOARD_$(BB)
-export CFLAGS
-
-# your binaries to link
-BASELIBS += $(RIOTBOARD)/$(BOARD)/bin/$(BOARD)_base.a
-BASELIBS += $(PROJBINDIR)/project.a
-
-INCLUDES = -I$(RIOTBOARD)/$(BOARD)/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/cpu/$(CPU)/include -I$(RIOTBASE)/cpu/arm_common/include -I$(RIOTBASE)/sys/lib -I$(RIOTBASE)/sys/include/ -I$(RIOTBASE)/drivers/include/
-
-export INCLUDES
-
-## make script for your project. Build RIOT-base here!
-all: $(PROJBINDIR)/$(PROJECT).a
-	@echo "Building project $(PROJECT) for $(BOARD) w/ MCU $(CPU)."
-	$(MAKE) -C $(RIOTBOARD)
-	$(MAKE) -C $(RIOTBASE)
-	$(LINK) $(LINKFLAGS) $(UNDEF) -o $(PROJBINDIR)/$(PROJECT).elf -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group  -Wl,-Map=$(PROJBINDIR)/$(PROJECT).map
-	$(SIZE) $(PROJBINDIR)/$(PROJECT).elf
-	$(OBJCOPY) -O ihex $(PROJBINDIR)/$(PROJECT).elf $(PROJBINDIR)/$(PROJECT).hex
-
-## your make rules
-## Only basic example - modify it for larger projects!!
-
-$(PROJBINDIR)/$(PROJECT).a: $(PROJBINDIR)/$(PROJECT).o
-	$(AR) -rc $(PROJBINDIR)/project.a $(PROJBINDIR)/$(PROJECT).o 
-	
-$(PROJBINDIR)/$(PROJECT).o: main.c 
-	$(CC) $(CFLAGS) $(BOARDINCLUDE) $(INCLUDES) -c main.c -o $(PROJBINDIR)/$(PROJECT).o
-
-clean:
-	$(MAKE) -C $(RIOTBOARD) clean
-	$(MAKE) -C $(RIOTBASE) clean
-	rm -f $(PROJBINDIR)/*
-
-flash: all
-	$(FLASH) $(PORT) $(PROJBINDIR)/$(PROJECT).hex
-
-term:
-	$(TERM) $(PORT)
-
-doc:
-	make -BC $(RIOTBASE) doc
diff --git a/dist/tools/testsuite/generate_html.sh b/dist/tools/testsuite/generate_html.sh
index 2d4b475f74b326a1614b42836aac67a573de444f..8944bf8f5c3ffa904b579c0569407494532d7658 100755
--- a/dist/tools/testsuite/generate_html.sh
+++ b/dist/tools/testsuite/generate_html.sh
@@ -6,7 +6,7 @@ HTMLDIR=${TOOLROOT}/tools/testsuite/html
 
 test -f ~/.buildbot && . ~/.buildbot
 
-OUTFILE=${HTMLFILE:-${HOME}/firekernel.html}
+OUTFILE=${HTMLFILE:-${HOME}/riot.html}
 LOGDIR=${BUILDLOGS:-${HOME}/buildlogs}
 
 {
diff --git a/dist/tools/testsuite/svn_test_revision.sh b/dist/tools/testsuite/svn_test_revision.sh
deleted file mode 100755
index 239ab4b1997a3b8fcfa461f8589d54e19a0e9a34..0000000000000000000000000000000000000000
--- a/dist/tools/testsuite/svn_test_revision.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-
-. ~/.buildbot
-
-REPO=${REPO:-https://svn.mi.fu-berlin.de/msb/FeuerWare/trunk}
-LOGDIR=${LOGDIR:-${HOME}/buildlogs}
-
-REVISION=${1:-HEAD}
-
-LOGBASE="`date +%F-%Hh-%Mm-%Ss`-r${REVISION}-test.log"
-
-LOGFILE="${LOGDIR}/${LOGBASE}"
-TMPDIR=`mktemp -d /dev/shm/svn_test_repo.XXXXXXXXXX`
-
-TOOLROOT=${TOOLROOT:-.}
-
-if [ ! -d ${TMPDIR} ]; then exit 1; fi
-
-touch ${LOGFILE}.lock
-
-{
-    echo "${0} runnning checkout/build/test cycle."
-    echo "Repo: ${REPO}"
-    echo "Revision: ${REVISION}" 
-    echo "Temporary directory: ${TMPDIR}..."
-    echo "Logfilename: ${LOGBASE}"
-
-    cd ${TMPDIR} &&
-
-    echo "Checking out..." &&
-    svn co -q -r ${REVISION} ${REPO} &&
-    echo "Done." &&
-
-    cd ${TMPDIR}/trunk/board/msba2/tools && make &&
-    cd ${TMPDIR}/trunk &&
-    bash ${TOOLROOT}/tools/testsuite/run_tests.sh
-
-    echo
-    echo "Test run completed."
-} 2>&1 | tee ${LOGFILE}
-
-rm -f ${LOGFILE}.lock
-rm -f ${LOGFILE}.parsed
-
-rm -rf ${TMPDIR}
-
diff --git a/doc/doxygen/makefile b/doc/doxygen/Makefile
similarity index 100%
rename from doc/doxygen/makefile
rename to doc/doxygen/Makefile
diff --git a/doc/doxygen/riot.doxyfile b/doc/doxygen/riot.doxyfile
index 490fd04f2120fafc623598a640dee19cc6860977..a05ba6d5f433de2eea7e449d49feba293f3fb250 100644
--- a/doc/doxygen/riot.doxyfile
+++ b/doc/doxygen/riot.doxyfile
@@ -4,7 +4,7 @@
 # Project related configuration options
 #---------------------------------------------------------------------------
 DOXYFILE_ENCODING      = UTF-8
-PROJECT_NAME           = µkleos 
+PROJECT_NAME           = RIOT 
 PROJECT_NUMBER         = 
 OUTPUT_DIRECTORY       = 
 CREATE_SUBDIRS         = NO
@@ -85,9 +85,9 @@ WARN_LOGFILE           =
 #---------------------------------------------------------------------------
 # configuration options related to the input files
 #---------------------------------------------------------------------------
-INPUT                  = ../../core ../../cpu ../../board ../../sys ../manual ../../drivers
+INPUT                  = ../../core ../../cpu ../../board ../../sys src/ ../../drivers
 INPUT_ENCODING         = UTF-8
-FILE_PATTERNS          = *.doc *.c *.h 
+FILE_PATTERNS          = *.txt *.c *.h 
 RECURSIVE              = YES
 EXCLUDE                = 
 EXCLUDE_SYMLINKS       = NO
@@ -123,9 +123,9 @@ IGNORE_PREFIX          =
 GENERATE_HTML          = YES
 HTML_OUTPUT            = html
 HTML_FILE_EXTENSION    = .html
-HTML_HEADER            = src/ukleos-header.html 
-HTML_FOOTER            = src/ukleos-footer.html
-HTML_STYLESHEET        = 
+HTML_HEADER            = src/riot-header.html 
+HTML_FOOTER            = src/riot-footer.html
+HTML_STYLESHEET        = src/riot.css
 HTML_ALIGN_MEMBERS     = YES
 HTML_DYNAMIC_SECTIONS  = YES
 GENERATE_DOCSET        = NO
@@ -148,7 +148,7 @@ QHP_SECT_FILTER_ATTRS  =
 QHG_LOCATION           = 
 DISABLE_INDEX          = NO
 ENUM_VALUES_PER_LINE   = 4
-GENERATE_TREEVIEW      = NO 
+GENERATE_TREEVIEW      = YES 
 TREEVIEW_WIDTH         = 250
 FORMULA_FONTSIZE       = 10
 #---------------------------------------------------------------------------
diff --git a/doc/doxygen/src/mainpage.txt b/doc/doxygen/src/mainpage.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c48b2771c7bfd860056d7111eda55533f1f9ebbf
--- /dev/null
+++ b/doc/doxygen/src/mainpage.txt
@@ -0,0 +1,40 @@
+/*! \mainpage RIOT Documentation
+ *
+ * RIOT is an operating system for the Internet of Things based on a microkernel architecture. 
+ *
+ * \section first_sec First steps
+ *
+ * \subsection getting_sec Getting RIOT
+ *
+ * You can obtain the latest RIOT code from our [Github](https://github.com/) account. There are three repositories:
+ *   - [RIOT](https://github.com/RIOT-OS/RIOT)\n
+ *     This contains the kernel, support for different CPUs, device drivers, and system libraries.\n
+ *     It also provides you with additional tools like a terminal program and scripts to setup a toolchain.\n
+ *     This is the only repository you need to develop applications with RIOT.
+ *   - [boards](https://github.com/RIOT-OS/boards)
+ *     This repository contains configuration files and hardware initialization code for various supported hardware platforms.\n
+ *     You need this code only if you want to use RIOT on one of these boards:
+ *     -# [MSB-A2](http://www.mi.fu-berlin.de/inf/groups/ag-tech/projects/Z_Finished_Projects/ScatterWeb/modules/mod_MSB-A2.html)
+ *     -# PTTU
+ *     -# [MSB-430(H)](http://www.mi.fu-berlin.de/inf/groups/ag-tech/projects/Z_Finished_Projects/ScatterWeb/modules/mod_MSB-430H.html)
+ *     -# [EZ430-Chronos](http://processors.wiki.ti.com/index.php/EZ430-Chronos)\n
+ *     You will also need this code to run RIOT as a program on your development system.
+ *   - [projects](https://github.com/RIOT-OS/projects)\n
+ *     Contains some exemplary applications.\n
+ *
+ * \subsection compile_sec Compiling RIOT
+ *
+ * Depending on the hardware you want to use, you need to first install a corresponding toolchain. Instructions for the installation of the toolchain for an ARM7 based plaform in Ubuntu or Debian can be found at our [Wiki](https://github.com/RIOT-OS/boards/wiki/For-MSB-A2).\n
+ * Once you have set up the toolchain, you can create your own project. Apart from the C file(s) containing your source code you need a Makefile. A template Makefile is available in the `dist` folder of the [RIOT repository](https://github.com/RIOT-OS/RIOT).\n
+ * Within your project's Makefile, you can define the target hardware as well as the modules you want to use.\n
+ * Unless specified otherwise, make will create an elf-file as well as an Intel hex file in the `bin` folder of your project directory.
+ *
+ * \subsection native_sec Native RIOT - Run RIOT on your PC!
+ *
+ * As a special platform, you will find a CPU and board called `native` in the repository. This target allows you to run RIOT as a process on Linux on most supported hardware platforms. Just set CPU and BOARD to `native` in your project's Makefile, call `make`, and execute the resulting elf-file.
+ *
+ * \section info_sec Community
+ *
+ * Whether you are looking for help with writing an application for RIOT, want to learn more about it, or just stay in the loop you are invited to join the RIOT-users mailing list. For developers who want to participate and contribute to the kernel development or integrate new MCU and platform support the [RIOT-devel mailing list](http://lists.riot-os.org/mailman/listinfo/devel) is the right place.
+ *  
+ */
diff --git a/doc/doxygen/src/ukleos-footer.html b/doc/doxygen/src/riot-footer.html
similarity index 100%
rename from doc/doxygen/src/ukleos-footer.html
rename to doc/doxygen/src/riot-footer.html
diff --git a/doc/doxygen/src/ukleos-header.html b/doc/doxygen/src/riot-header.html
similarity index 82%
rename from doc/doxygen/src/ukleos-header.html
rename to doc/doxygen/src/riot-header.html
index 0f98f639d4aec8cb745e035a9fd3c7bc98601b4e..f54fa45185cd2f011e5dcfe7a67e9266f922652b 100644
--- a/doc/doxygen/src/ukleos-header.html
+++ b/doc/doxygen/src/riot-header.html
@@ -4,7 +4,7 @@
         <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
         <meta name="date" content="$datetime">
         <title>$title</title>
-        <link href="ukleos.css" rel="stylesheet" type="text/css">
+        <link href="riot.css" rel="stylesheet" type="text/css">
         <link href="tabs.css" rel="stylesheet" type="text/css">
     </head>
     <body>
diff --git a/doc/doxygen/src/ukleos.css b/doc/doxygen/src/riot.css
similarity index 98%
rename from doc/doxygen/src/ukleos.css
rename to doc/doxygen/src/riot.css
index 8d82f8bbb65c7ad642753a71b9bce8d28b6e625c..54dfc81a24b4383282bc1e3609ea8d0368c3a761 100644
--- a/doc/doxygen/src/ukleos.css
+++ b/doc/doxygen/src/riot.css
@@ -7,9 +7,8 @@ BODY,TD {
 h1 { /* titel */
 	text-align: left;
     font-size: 140%;
-	background-color: #aabbbd; /*#f4f4f4; */
-	padding: 0.3em 0.3 0em 0.3em;
-	height: 80px;
+	background-color: #d4d4d4;
+	padding: 0.3em 0.3 0.3em 0.3em;
 	margin-top: 0;
 }
 h1,
@@ -27,6 +26,9 @@ td h2 { /* member table captions */
 h3 { /* subsection */
     font-size: 100%;
 }
+div.title {
+    font-size: 200%;
+}
 div.agtlogo {
 	float: left;
 	position: relative;
diff --git a/doc/manual/manual.doc b/doc/manual/manual.doc
deleted file mode 100644
index 35d966b41d540e3d012cf21272713de7a963e4b0..0000000000000000000000000000000000000000
--- a/doc/manual/manual.doc
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
-
-\defgroup cpu Architecture Support
-
-\defgroup arm_common ARMv7
-\ingroup cpu
-
-\defgroup system Base System
-\brief The base system includes all extra functionality not necessarily ported to all supported platforms.
-
-\defgroup lib Library Code
-
-\defgroup net Network Stack
-
-\mainpage
-Welcome to the µkleos documentation.<p>
-
-*/
diff --git a/drivers/makefile b/drivers/Makefile
similarity index 94%
rename from drivers/makefile
rename to drivers/Makefile
index 763f2544be61a5c0400346f614fb3b670067d8dd..273d1e00279171c6e9acf8a378ddd5728d083d05 100644
--- a/drivers/makefile
+++ b/drivers/Makefile
@@ -24,7 +24,7 @@ endif
 all:
 	@for i in $(DIRS) ; do $(MAKE) -C $$i ; done ;
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
 # remove compilation products
 clean::
diff --git a/drivers/cc110x/makefile b/drivers/cc110x/Makefile
similarity index 82%
rename from drivers/cc110x/makefile
rename to drivers/cc110x/Makefile
index b3519713c795f95e232711f16d6bd5d66ee3e264..b90bdac55d1f1a18098822980dc57da9c994234e 100644
--- a/drivers/cc110x/makefile
+++ b/drivers/cc110x/Makefile
@@ -2,6 +2,6 @@ INCLUDES = -I$(RIOTBASE)/sys/include -I../../net -I../include -I../../lib -I../.
 
 MODULE =cc110x_ng
 
-include $(MAKEBASE)/makefile.base
+include $(MAKEBASE)/Makefile.base
 
 
diff --git a/drivers/cc110x/arch_cc1100.h b/drivers/cc110x/arch_cc1100.h
index 7c8b018a5079ee51025dcf7ec90de7a9b734471b..7d42ed3279e006654261fac3223376014869206b 100644
--- a/drivers/cc110x/arch_cc1100.h
+++ b/drivers/cc110x/arch_cc1100.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -29,7 +29,7 @@ and the mailinglist (subscription via web site)
  * @ingroup		LPC2387
  * @brief		CC1100 LPC2387 dependend functions
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 1775 $
  *
diff --git a/drivers/cc110x/cc1100-csmaca-mac.c b/drivers/cc110x/cc1100-csmaca-mac.c
index efa875631a02a7f53dd2e83d18ba8a94b84c7977..2eaa401b94a16849397ccb4111ea602fa561cc95 100644
--- a/drivers/cc110x/cc1100-csmaca-mac.c
+++ b/drivers/cc110x/cc1100-csmaca-mac.c
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -29,7 +29,7 @@ and the mailinglist (subscription via web site)
  * @ingroup		dev_cc110x
  * @brief		ScatterWeb MSB-A2 mac-layer
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 2128 $
diff --git a/drivers/cc110x/cc1100-csmaca-mac.h b/drivers/cc110x/cc1100-csmaca-mac.h
index ecfeedc39d4c805b91aeaca01760daea2006217d..5d0e2b2f2a073bcb37b67fe50b1d3016294d9ae9 100644
--- a/drivers/cc110x/cc1100-csmaca-mac.h
+++ b/drivers/cc110x/cc1100-csmaca-mac.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -29,7 +29,7 @@ and the mailinglist (subscription via web site)
  * @ingroup		dev_cc110x
  * @brief		ScatterWeb MSB-A2 mac-layer
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 1999 $
diff --git a/drivers/cc110x/cc1100-defaultSettings.c b/drivers/cc110x/cc1100-defaultSettings.c
index e4561ff5897822e34eb0baf1f3001e5725484a05..008e9d9393fc29dc5c1b6b52f41221097248e75a 100644
--- a/drivers/cc110x/cc1100-defaultSettings.c
+++ b/drivers/cc110x/cc1100-defaultSettings.c
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -33,7 +33,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		TI Chipcon CC110x default settings
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 2058 $
diff --git a/drivers/cc110x/cc1100-defaultSettings.h b/drivers/cc110x/cc1100-defaultSettings.h
index a43ebe42cf79094b5320a9eb09ef5227b552499b..2d8fa8408757df0baeb87fe94e6976cee1162d38 100644
--- a/drivers/cc110x/cc1100-defaultSettings.h
+++ b/drivers/cc110x/cc1100-defaultSettings.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -36,7 +36,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		TI Chipcon CC110x default settings
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 2139 $
diff --git a/drivers/cc110x/cc1100-interface.h b/drivers/cc110x/cc1100-interface.h
index ff9a0f2d5e879b86d9b6932ec5626432b259d399..cc54f0cc5631d5a1c644dc01624a7198ef230257 100644
--- a/drivers/cc110x/cc1100-interface.h
+++ b/drivers/cc110x/cc1100-interface.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -34,7 +34,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		TI Chipcon CC110x public interface
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @version     $Revision: 2283 $
  *
diff --git a/drivers/cc110x/cc1100-internal.h b/drivers/cc110x/cc1100-internal.h
index 54ddabde70386ca51a6eb40c7c2f1a143aec84e4..6f9e13acfe2de3fc2268bffcc18f3e4ebde24b5a 100644
--- a/drivers/cc110x/cc1100-internal.h
+++ b/drivers/cc110x/cc1100-internal.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -37,7 +37,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief		TI Chipcon CC110x internal hardware constants
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 1231 $
diff --git a/drivers/cc110x/cc1100.c b/drivers/cc110x/cc1100.c
index 49e73d27b7fb4350c16b3d104887d3c74cc5f09c..987b3568b0ed0fc2ab1149f82d1217c55dd8e313 100644
--- a/drivers/cc110x/cc1100.c
+++ b/drivers/cc110x/cc1100.c
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -34,7 +34,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief		TI Chipcon CC110x Radio driver
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 2283 $
diff --git a/drivers/cc110x/cc1100.h b/drivers/cc110x/cc1100.h
index 2143e853a6003ca7200c36b3aea88ed6a3f3e970..6eefb5d1ec27e007bc658f9f5730e998cab1835d 100644
--- a/drivers/cc110x/cc1100.h
+++ b/drivers/cc110x/cc1100.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -39,7 +39,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		TI Chipcon CC110x radio driver
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 2128 $
diff --git a/drivers/cc110x/cc1100_phy.c b/drivers/cc110x/cc1100_phy.c
index 8241605806701005884610fa799002e2b8ea1517..01c49e58697a3b3eb0b1c3d082dfdd7d6ed80f94 100644
--- a/drivers/cc110x/cc1100_phy.c
+++ b/drivers/cc110x/cc1100_phy.c
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -34,7 +34,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief		TI Chipcon CC110x physical radio driver
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 2130 $
diff --git a/drivers/cc110x/cc1100_phy.h b/drivers/cc110x/cc1100_phy.h
index eb4c3530ff30a25601d9ef3e181d806b68ab2ee1..8459783add957221e8a91c21e2c3832af3da133e 100644
--- a/drivers/cc110x/cc1100_phy.h
+++ b/drivers/cc110x/cc1100_phy.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -34,7 +34,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief		TI Chipcon CC110x physical radio driver
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 1285 $
diff --git a/drivers/cc110x/cc1100_spi.c b/drivers/cc110x/cc1100_spi.c
index 2614caf20ab4e447c19f3f4ba25be85f4ef2effe..04aa21d29b63a28ded3f53a9c4197e00ee71461a 100644
--- a/drivers/cc110x/cc1100_spi.c
+++ b/drivers/cc110x/cc1100_spi.c
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -34,7 +34,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief		TI Chipcon CC1100 SPI driver
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 1775 $
diff --git a/drivers/cc110x/cc1100_spi.h b/drivers/cc110x/cc1100_spi.h
index e76deb8b27ae57b6c0be55c07fff0e5cc4809a6e..c5c53c2e22eec83e5653c99eee951f443e7439d5 100644
--- a/drivers/cc110x/cc1100_spi.h
+++ b/drivers/cc110x/cc1100_spi.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -33,7 +33,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief		TI Chipcon CC1100 SPI driver
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 1775 $
diff --git a/drivers/cc110x_ng/makefile b/drivers/cc110x_ng/Makefile
similarity index 92%
rename from drivers/cc110x_ng/makefile
rename to drivers/cc110x_ng/Makefile
index 1a28fd0870462e654e19f6afa70c8e92ac5d5a04..6fadf78ad4f9a774be107059bd59897e6305a3e6 100644
--- a/drivers/cc110x_ng/makefile
+++ b/drivers/cc110x_ng/Makefile
@@ -12,7 +12,7 @@ endif
 all: $(BINDIR)$(MODULE).a
 	@for i in $(DIRS) ; do $(MAKE) -C $$i ; done ;
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
 clean::
 	@for i in $(DIRS) ; do $(MAKE) -C $$i clean ; done ;
diff --git a/drivers/cc110x_ng/cc110x-defaultSettings.c b/drivers/cc110x_ng/cc110x-defaultSettings.c
index dc15fbd2329d14d29e5122a83400411557794837..844dcb575827a349f5d77673fddbeea3a896ece9 100644
--- a/drivers/cc110x_ng/cc110x-defaultSettings.c
+++ b/drivers/cc110x_ng/cc110x-defaultSettings.c
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -33,7 +33,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		TI Chipcon CC110x default settings
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 2058 $
diff --git a/drivers/cc110x_ng/include/cc110x-arch.h b/drivers/cc110x_ng/include/cc110x-arch.h
index 3a990b1ba5995ffcd9f9f1092715c3bc532f235e..fb05fef5d53db721bb3b7f990a29b09a2d0982b1 100644
--- a/drivers/cc110x_ng/include/cc110x-arch.h
+++ b/drivers/cc110x_ng/include/cc110x-arch.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -29,7 +29,7 @@ and the mailinglist (subscription via web site)
  * @ingroup		LPC2387
  * @brief		CC1100 LPC2387 dependend functions
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 1775 $
  *
diff --git a/drivers/cc110x_ng/include/cc110x-defaultSettings.h b/drivers/cc110x_ng/include/cc110x-defaultSettings.h
index d15a45cd55ef41aea14c809395ac6d7e960dd846..76eb00d441bb9d0f731dece6e14ccdde55eb2da6 100644
--- a/drivers/cc110x_ng/include/cc110x-defaultSettings.h
+++ b/drivers/cc110x_ng/include/cc110x-defaultSettings.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -36,7 +36,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		TI Chipcon CC110x default settings
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 2139 $
diff --git a/drivers/cc110x_ng/include/cc110x-internal.h b/drivers/cc110x_ng/include/cc110x-internal.h
index 409c3b9885fa1a7fa0812f93d6c0a24304f1f49e..77ff43fbce2e7a4d89227ae2db64c1fecbc7fa21 100644
--- a/drivers/cc110x_ng/include/cc110x-internal.h
+++ b/drivers/cc110x_ng/include/cc110x-internal.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -37,7 +37,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief		TI Chipcon CC110x internal hardware constants
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 1231 $
diff --git a/drivers/cc110x_ng/include/cc110x-reg.h b/drivers/cc110x_ng/include/cc110x-reg.h
index 02756ca5f634e84873e0cabdcfabe79203c2acc0..49943585f39b8f9c6f93bc02177c1c3f960757aa 100644
--- a/drivers/cc110x_ng/include/cc110x-reg.h
+++ b/drivers/cc110x_ng/include/cc110x-reg.h
@@ -3,7 +3,7 @@
  * @ingroup dev_cc110x_ng
  * @brief   Access to CC110X registers
  *
- * @author  Freie Uniersität Berlin, Computer Systems & Telematics, µkleos
+ * @author  Freie Uniersität Berlin, Computer Systems & Telematics, RIOT
  * @author  Oliver Hahm <oliver.hahm@fu-berlin.de
  * version  $Revision$
  *
diff --git a/drivers/cc110x_ng/include/cc110x_spi.h b/drivers/cc110x_ng/include/cc110x_spi.h
index 274f544124041e8c411e29f56ec895702af906a4..51d8c0393bcbf6ffb436a662b4f3300da43899d1 100644
--- a/drivers/cc110x_ng/include/cc110x_spi.h
+++ b/drivers/cc110x_ng/include/cc110x_spi.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -33,7 +33,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief		TI Chipcon CC1100 SPI driver
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 1775 $
diff --git a/drivers/cc110x_ng/spi/makefile b/drivers/cc110x_ng/spi/Makefile
similarity index 83%
rename from drivers/cc110x_ng/spi/makefile
rename to drivers/cc110x_ng/spi/Makefile
index 1d02bec101cb2ebcdc0746f4f3d8018f2d4ee267..644fb0062e4d2ebc3d3a234e6fcea6bbefbb5094 100644
--- a/drivers/cc110x_ng/spi/makefile
+++ b/drivers/cc110x_ng/spi/Makefile
@@ -2,5 +2,5 @@ INCLUDES = -I$(RIOTBASE)/sys/include -I../../net -I../include -I../../lib -I../.
 
 MODULE =cc110x_spi
 
-include $(MAKEBASE)/makefile.base
+include $(MAKEBASE)/Makefile.base
 
diff --git a/drivers/cc110x_ng/spi/cc110x_spi.c b/drivers/cc110x_ng/spi/cc110x_spi.c
index cd573038627d9ac1931a113675c5a85cd6492bc3..867f93111ff4388d57970b638003d85a21c26f08 100644
--- a/drivers/cc110x_ng/spi/cc110x_spi.c
+++ b/drivers/cc110x_ng/spi/cc110x_spi.c
@@ -4,14 +4,14 @@ Copyright 2010, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of µkleos.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -34,7 +34,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief		TI Chipcon CC1100 SPI driver
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @version     $Revision: 1775 $
diff --git a/drivers/include/gpioint.h b/drivers/include/gpioint.h
index 8d5d30f1e4456322a2ba597142ae700059587539..8f4ecd260af9673c148634873b62060e17ea7562 100644
--- a/drivers/include/gpioint.h
+++ b/drivers/include/gpioint.h
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universität Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -50,7 +50,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		GPIO IRQ Multiplexer interface
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Michael Baar <michael.baar@fu-berlin.de>
  * @version     $Revision: 1508 $
  *
diff --git a/drivers/include/ltc4150_arch.h b/drivers/include/ltc4150_arch.h
index 51c76ca5943fbbca62e21ab974b555f70ba0a3ce..84a5c6810253f208611b473ceebad53cff2544c1 100644
--- a/drivers/include/ltc4150_arch.h
+++ b/drivers/include/ltc4150_arch.h
@@ -4,14 +4,14 @@ Copyright 2008-2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -37,7 +37,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief       LTC4150 Coulomb Counter
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author      Heiko Will
  * @version     $Revision: 1203 $
  *
diff --git a/drivers/include/rtc.h b/drivers/include/rtc.h
index b40b72b5037f80ebfe7c742150b4ca750597eea4..25b0d8759b04a028745ddb39b8dcdf665fc922d5 100644
--- a/drivers/include/rtc.h
+++ b/drivers/include/rtc.h
@@ -4,14 +4,14 @@ Copyright 2010, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of µkleos.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/drivers/include/sht11.h b/drivers/include/sht11.h
index 227569f5e1cdbe4085806afaf60ddfb1880b8bc1..00f00e0bd16478de15ea30785f98839a011e4f40 100644
--- a/drivers/include/sht11.h
+++ b/drivers/include/sht11.h
@@ -9,7 +9,7 @@ the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -35,7 +35,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		SHT11 Device Driver
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @version     $Revision: 667 $
  *
  * @note		$Id: sht11.h 667 2009-02-19 15:06:38Z baar $
diff --git a/drivers/ltc4150/makefile b/drivers/ltc4150/Makefile
similarity index 67%
rename from drivers/ltc4150/makefile
rename to drivers/ltc4150/Makefile
index b1ca863065f78813ee58f3165e6b3615e9504a69..1365fbf9261ae2cbaf730313af34868d12ad25d4 100644
--- a/drivers/ltc4150/makefile
+++ b/drivers/ltc4150/Makefile
@@ -1,5 +1,5 @@
 INCLUDES = -I$(RIOTBASE)/core/include -I../include/
 MODULE =ltc4150
-include $(MAKEBASE)/makefile.base
+include $(MAKEBASE)/Makefile.base
 
 
diff --git a/drivers/ltc4150/ltc4150.c b/drivers/ltc4150/ltc4150.c
index 70c4a4ac11d075c0e2481f4539ad2fac31b30f5a..2175c37b082ce0b17c3e5c2f2b6d57c313f01c98 100644
--- a/drivers/ltc4150/ltc4150.c
+++ b/drivers/ltc4150/ltc4150.c
@@ -4,14 +4,14 @@ Copyright 2008-2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -33,7 +33,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief       LTC4150 Coulomb Counter
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author      Heiko Will
  * @author      Kaspar Schleiser <kaspar.schleiser@fu-berlin.de>
  */
diff --git a/drivers/sht11/makefile b/drivers/sht11/Makefile
similarity index 73%
rename from drivers/sht11/makefile
rename to drivers/sht11/Makefile
index cd43db5ef3095e0d9751374aa370e80fc200827f..51acccc9827fc8ac4eb445d9a5cfd8a0019a6a68 100644
--- a/drivers/sht11/makefile
+++ b/drivers/sht11/Makefile
@@ -1,5 +1,5 @@
 INCLUDES += -I$(RIOTBASE)/core/include -I../include -I$(RIOTBOARD)/$(BOARD)
 MODULE =sht11
-include $(MAKEBASE)/makefile.base
+include $(MAKEBASE)/Makefile.base
 
 
diff --git a/drivers/sht11/sht11.c b/drivers/sht11/sht11.c
index c81cfc56b137df7751615a6a7619969463e15a6e..872888a06728cb18a1ea149b6ff134364dd4fbf5 100644
--- a/drivers/sht11/sht11.c
+++ b/drivers/sht11/sht11.c
@@ -9,7 +9,7 @@ the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/sys/makefile b/sys/Makefile
similarity index 98%
rename from sys/makefile
rename to sys/Makefile
index 0e05f67125dd49f69c4fafa04d03071b833cb663..6af74be0536ed2c5f820272d74525aa6aa362f56 100644
--- a/sys/makefile
+++ b/sys/Makefile
@@ -72,7 +72,7 @@ endif
 all: $(BINDIR)$(MODULE).a 
 	@for i in $(DIRS) ; do $(MAKE) -C $$i ; done ;
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
 # remove compilation products
 clean::
diff --git a/sys/auto_init/makefile b/sys/auto_init/Makefile
similarity index 75%
rename from sys/auto_init/makefile
rename to sys/auto_init/Makefile
index ffa6c4d6c658d79a75bd96e8567b2446b8cac7e0..cf0cb48c74e3157ba5b3937ab14f64c0df0e2fe9 100644
--- a/sys/auto_init/makefile
+++ b/sys/auto_init/Makefile
@@ -1,5 +1,5 @@
 INCLUDES = -I../include -I$(RIOTBASE)/core/include/ -I$(RIOTBASE)/drivers/include
 MODULE =auto_init
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
diff --git a/sys/config/makefile b/sys/config/Makefile
similarity index 66%
rename from sys/config/makefile
rename to sys/config/Makefile
index ea4db12a31b3f069c05d09de635fc143dcfa7dca..a3329789976d1d6a328f564fe03d1fbef8a5bd59 100644
--- a/sys/config/makefile
+++ b/sys/config/Makefile
@@ -1,5 +1,5 @@
 INCLUDES = -I../include -I$(RIOTBASE)/core/include
 MODULE =config
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
diff --git a/sys/include/radio/radio.h b/sys/include/radio/radio.h
index 747b9c86d019bb48da963a0768e0e29a2f807228..c45431ce594faf645ba678fdaa19efadc6c2189d 100644
--- a/sys/include/radio/radio.h
+++ b/sys/include/radio/radio.h
@@ -4,14 +4,14 @@ Copyright 2008-2009 , Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -40,7 +40,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		baar
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @version     $Revision: 1961 $
diff --git a/sys/include/radio/types.h b/sys/include/radio/types.h
index c84a12e0972032946c9c41e6cb3c9ef982bb9bb0..a0d6b4c27de4d2f0ca861f782c61d89bc97af440 100644
--- a/sys/include/radio/types.h
+++ b/sys/include/radio/types.h
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -31,7 +31,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		Common network stack types (of all layers).
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @version     $Revision: 2061 $
  *
diff --git a/sys/include/shell.h b/sys/include/shell.h
index d5ca165890c57778e5d9c8bc64508f70d051f73a..00f34148b186e7ebc72fb064bc942f6f9952bcba 100644
--- a/sys/include/shell.h
+++ b/sys/include/shell.h
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/sys/lib/makefile b/sys/lib/Makefile
similarity index 84%
rename from sys/lib/makefile
rename to sys/lib/Makefile
index 39621155ee702e47579481dbcda827780996d27b..18996f3c34a3d714ccb6c70529cfaa73092e199c 100644
--- a/sys/lib/makefile
+++ b/sys/lib/Makefile
@@ -1,5 +1,5 @@
 INCLUDES = -I../include -I../drivers/include -I../lib -I../../cpu/$(CPU)/include -I../../cpu/ -I../lib/cmdengine -I../net -I../../hal/include -I../../core/include -I../config
 MODULE =lib
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
diff --git a/sys/logd/makefile b/sys/logd/Makefile
similarity index 84%
rename from sys/logd/makefile
rename to sys/logd/Makefile
index 92bc22a69461e8bdba50e9f2492c6d3e1ae4369f..af6415cf276ede6b75b28234dad59561dc1985c2 100644
--- a/sys/logd/makefile
+++ b/sys/logd/Makefile
@@ -2,6 +2,6 @@ INCLUDES = -I../include -I../drivers/include -I../lib -I../../cpu/$(CPU)/include
 
 MODULE =logd
 
-include $(MAKEBASE)/makefile.base
+include $(MAKEBASE)/Makefile.base
 
 
diff --git a/sys/logd/logd.c b/sys/logd/logd.c
index 2dcfa1196d93e38fd3e8898f343527cf61a8c37e..2552e7a78d1cff82ab3cb3c4c099fb7f229abc73 100644
--- a/sys/logd/logd.c
+++ b/sys/logd/logd.c
@@ -4,14 +4,14 @@ Copyright 2009-2010, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -28,7 +28,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		Simple logging demon implementation
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @version     $Revision: 3854 $
  *
diff --git a/sys/net/destiny/socket.c b/sys/net/destiny/socket.c
index d7c4fc60060a960a51cde4287c68bc409c281688..a0982c2610801254e29b60e9760956770b68d245 100644
--- a/sys/net/destiny/socket.c
+++ b/sys/net/destiny/socket.c
@@ -1,1242 +1,1242 @@
-/*
- * socket.c
- *
- *  Created on: 16.09.2011
- *      Author: Oliver
- */
-#include <thread.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <math.h>
-#include "udp.h"
-#include "tcp.h"
-#include "socket.h"
-#include "vtimer.h"
-#include "hwtimer.h"
-#include "tcp_timer.h"
-#include "tcp_hc.h"
-#include "sys/net/net_help/net_help.h"
-#include "sys/net/net_help/msg_help.h"
-
-socket_internal_t sockets[MAX_SOCKETS];
-
-void printf_tcp_context(tcp_hc_context_t *current_tcp_context)
-	{
-	printf("Context: %u\n", current_tcp_context->context_id);
-	printf("Rcv Seq: %lu Rcv Ack: %lu, Rcv Wnd: %u\n", current_tcp_context->seq_rcv, current_tcp_context->ack_rcv, current_tcp_context->wnd_rcv);
-	printf("Snd Seq: %lu Snd Ack: %lu, Snd Wnd: %u\n", current_tcp_context->seq_snd, current_tcp_context->ack_snd, current_tcp_context->wnd_snd);
-	}
-
-void print_tcp_flags (tcp_hdr_t *tcp_header)
-	{
-	printf("FLAGS: ");
-	switch(tcp_header->reserved_flags)
-		{
-		case TCP_ACK:
-			{
-			printf("ACK ");
-			break;
-			}
-		case TCP_RST:
-			{
-			printf("RST ");
-			break;
-			}
-		case TCP_SYN:
-			{
-			printf("SYN ");
-			break;
-			}
-		case TCP_FIN:
-			{
-			printf("FIN ");
-			break;
-			}
-		case TCP_URG_PSH:
-			{
-			printf("URG PSH ");
-			break;
-			}
-		case TCP_SYN_ACK:
-			{
-			printf("SYN ACK ");
-			break;
-			}
-		case TCP_FIN_ACK:
-			{
-			printf("FIN ACK ");
-			break;
-			}
-		}
-	printf("\n");
-	}
-
-void print_tcp_cb(tcp_cb_t *cb)
-	{
-	printf("Send_ISS: %lu\nSend_UNA: %lu\nSend_NXT: %lu\nSend_WND: %u\n", cb->send_iss, cb->send_una, cb->send_nxt, cb->send_wnd);
-	printf("Rcv_IRS: %lu\nRcv_NXT: %lu\nRcv_WND: %u\n", cb->rcv_irs, cb->rcv_nxt, cb->rcv_wnd);
-	printf("Time difference: %lu, No_of_retries: %u, State: %u\n\n", timex_sub(vtimer_now(), cb->last_packet_time).microseconds, cb->no_of_retries, cb->state);
-	}
-
-void print_tcp_status(int in_or_out, ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header, socket_t *tcp_socket)
-	{
-	printf("--- %s TCP packet: ---\n", (in_or_out == INC_PACKET ? "Incoming" : "Outgoing"));
-	printf("IPv6 Source:");
-	ipv6_print_addr(&ipv6_header->srcaddr);
-	printf("IPv6 Dest:");
-	ipv6_print_addr(&ipv6_header->destaddr);
-	printf("TCP Length: %x\n", ipv6_header->length-TCP_HDR_LEN);
-	printf("Source Port: %x, Dest. Port: %x\n", NTOHS(tcp_header->src_port), NTOHS(tcp_header->dst_port));
-	printf("Source Port: %u, Dest. Port: %u\n", NTOHS(tcp_header->src_port), NTOHS(tcp_header->dst_port));
-	printf("ACK: %lx, SEQ: %lx, Window: %x\n", tcp_header->ack_nr, tcp_header->seq_nr, tcp_header->window);
-	printf("ACK: %lu, SEQ: %lu, Window: %u\n", tcp_header->ack_nr, tcp_header->seq_nr, tcp_header->window);
-	print_tcp_flags(tcp_header);
-	print_tcp_cb(&tcp_socket->tcp_control);
-#ifdef TCP_HC
-	printf_tcp_context(&tcp_socket->tcp_control.tcp_context);
-#endif
-	}
-
-void print_socket(socket_t *current_socket)
-	{
-	printf("Domain: %i, Type: %i, Protocol: %i \n",
-			current_socket->domain,
-			current_socket->type,
-			current_socket->protocol);
-	ipv6_print_addr(&current_socket->local_address.sin6_addr);
-	ipv6_print_addr(&current_socket->foreign_address.sin6_addr);
-	printf("Local Port: %u, Foreign Port: %u\n", NTOHS(current_socket->local_address.sin6_port),
-			NTOHS(current_socket->foreign_address.sin6_port));
-	}
-
-void print_internal_socket(socket_internal_t *current_socket_internal)
-	{
-	socket_t *current_socket = &current_socket_internal->socket_values;
-	printf("\n--------------------------\n");
-	printf("ID: %i, RECV PID: %i SEND PID: %i\n",	current_socket_internal->socket_id,	current_socket_internal->recv_pid, current_socket_internal->send_pid);
-	print_socket(current_socket);
-	printf("\n--------------------------\n");
-	}
-
-socket_internal_t *getSocket(uint8_t s)
-	{
-	if (exists_socket(s))
-		{
-		return &(sockets[s-1]);
-		}
-	else
-		{
-		return NULL;
-		}
-	}
-
-void print_sockets(void)
-	{
-	int i;
-	printf("\n---   Socket list:   ---\n");
-	for (i = 1; i < MAX_SOCKETS+1; i++)
-		{
-		if(getSocket(i) != NULL)
-			{
-			print_internal_socket(getSocket(i));
-			}
-		}
-	}
-
-bool exists_socket(uint8_t socket)
-	{
-	if (sockets[socket-1].socket_id == 0)
-		{
-		return false;
-		}
-	else
-		{
-		return true;
-		}
-	}
-
-void close_socket(socket_internal_t *current_socket)
-	{
-	memset(current_socket, 0, sizeof(socket_internal_t));
-	}
-
-bool isUDPSocket(uint8_t s)
-	{
-	if (	(exists_socket(s)) &&
-			(getSocket(s)->socket_values.domain == PF_INET6) &&
-			(getSocket(s)->socket_values.type == SOCK_DGRAM) &&
-			((getSocket(s)->socket_values.protocol == IPPROTO_UDP) ||
-			(getSocket(s)->socket_values.protocol == 0)))
-		return true;
-	else
-		return false;
-	}
-
-bool isTCPSocket(uint8_t s)
-	{
-	if (	(exists_socket(s)) &&
-			(getSocket(s)->socket_values.domain == PF_INET6) &&
-			(getSocket(s)->socket_values.type == SOCK_STREAM) &&
-			((getSocket(s)->socket_values.protocol == IPPROTO_TCP) ||
-			(getSocket(s)->socket_values.protocol == 0)))
-		return true;
-	else
-		return false;
-	}
-
-int bind_udp_socket(int s, sockaddr6_t *name, int namelen, uint8_t pid)
-	{
-	int i;
-	if (!exists_socket(s))
-		{
-		return -1;
-		}
-	for (i = 1; i < MAX_SOCKETS+1; i++)
-		{
-		if (isUDPSocket(i) && (getSocket(i)->socket_values.local_address.sin6_port == name->sin6_port))
-			{
-			return -1;
-			}
-		}
-	memcpy(&getSocket(s)->socket_values.local_address, name, namelen);
-	getSocket(s)->recv_pid = pid;
-	return 1;
-	}
-
-int bind_tcp_socket(int s, sockaddr6_t *name, int namelen, uint8_t pid)
-	{
-	int i;
-	if (!exists_socket(s))
-		{
-		return -1;
-		}
-	for (i = 1; i < MAX_SOCKETS+1; i++)
-		{
-		if (isTCPSocket(i) && (getSocket(i)->socket_values.local_address.sin6_port == name->sin6_port))
-			{
-			return -1;
-			}
-		}
-	memcpy(&getSocket(s)->socket_values.local_address, name, namelen);
-	getSocket(s)->recv_pid = pid;
-	getSocket(s)->socket_values.tcp_control.rto = TCP_INITIAL_ACK_TIMEOUT;
-	return 1;
-	}
-
-int socket(int domain, int type, int protocol)
-	{
-	int i = 1;
-	while (getSocket(i) != NULL)
-		{
-		i++;
-		}
-	if (i > MAX_SOCKETS+1)
-		{
-		return -1;
-		}
-	else
-		{
-		socket_t *current_socket = &sockets[i-1].socket_values;
-		sockets[i-1].socket_id = i;
-		current_socket->domain = domain;
-		current_socket->type = type;
-		current_socket->protocol = protocol;
-		current_socket->tcp_control.state = CLOSED;
-		return sockets[i-1].socket_id;
-		}
-	}
-
-socket_internal_t *get_udp_socket(ipv6_hdr_t *ipv6_header, udp_hdr_t *udp_header)
-	{
-	uint8_t i = 1;
-	while (i < MAX_SOCKETS+1)
-		{
-		if ( isUDPSocket(i) &&
-			(getSocket(i)->socket_values.local_address.sin6_port == udp_header->dst_port))
-			{
-			return getSocket(i);
-			}
-		i++;
-		}
-	return NULL;
-	}
-
-bool is_four_touple (socket_internal_t *current_socket, ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header)
-	{
-	return ((ipv6_get_addr_match(&current_socket->socket_values.local_address.sin6_addr, &ipv6_header->destaddr) == 128) &&
-			(current_socket->socket_values.local_address.sin6_port == tcp_header->dst_port) &&
-			(ipv6_get_addr_match(&current_socket->socket_values.foreign_address.sin6_addr, &ipv6_header->srcaddr) == 128) &&
-			(current_socket->socket_values.foreign_address.sin6_port == tcp_header->src_port));
-	}
-
-socket_internal_t *get_tcp_socket(ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header)
-	{
-	uint8_t i = 1;
-	socket_internal_t *current_socket = NULL;
-	socket_internal_t *listening_socket = NULL;
-	uint8_t compare[16];
-	memset(compare, 0, 16);
-
-	while (i < MAX_SOCKETS+1)
-		{
-		current_socket = getSocket(i);
-		// Check for matching 4 touple, ESTABLISHED connection
-		if( isTCPSocket(i) && is_four_touple(current_socket, ipv6_header, tcp_header))
-			{
-			return current_socket;
-			}
-		// Sockets in LISTEN and SYN_RCVD state should only be tested on local TCP values
-		else if ( isTCPSocket(i) &&
-				((current_socket->socket_values.tcp_control.state == LISTEN) || (current_socket->socket_values.tcp_control.state == SYN_RCVD)) &&
-				(current_socket->socket_values.local_address.sin6_addr.uint8[15] == ipv6_header->destaddr.uint8[15]) &&
-				(current_socket->socket_values.local_address.sin6_port == tcp_header->dst_port) &&
-				(current_socket->socket_values.foreign_address.sin6_addr.uint8[15] == 0x00) &&
-				(current_socket->socket_values.foreign_address.sin6_port == 0))
-			{
-			listening_socket = current_socket;
-			}
-		i++;
-		}
-	// Return either NULL if nothing was matched or the listening 2 touple socket
-	return listening_socket;
-	}
-
-uint16_t get_free_source_port(uint8_t protocol)
-	{
-	int i;
-	uint16_t biggest_port = EPHEMERAL_PORTS-1;
-	// Remember biggest ephemeral port number used so far and add 1
-	for (i = 0; i < MAX_SOCKETS; i++)
-		{
-		if ((sockets[i].socket_values.protocol == protocol) && (sockets[i].socket_values.local_address.sin6_port > biggest_port))
-			{
-			biggest_port = sockets[i].socket_values.local_address.sin6_port;
-			}
-		}
-	return biggest_port + 1;
-	}
-
-void set_socket_address(sockaddr6_t *sockaddr, uint8_t sin6_family, uint16_t sin6_port, uint32_t sin6_flowinfo, ipv6_addr_t *sin6_addr)
-	{
-	sockaddr->sin6_family 	= sin6_family;
-	sockaddr->sin6_port 	= sin6_port;
-	sockaddr->sin6_flowinfo	= sin6_flowinfo;
-	memcpy(&sockaddr->sin6_addr, sin6_addr, 16);
-	}
-
-void set_tcp_packet(tcp_hdr_t *tcp_hdr, uint16_t src_port, uint16_t dst_port, uint32_t seq_nr, uint32_t ack_nr,
-		uint8_t dataOffset_reserved, uint8_t reserved_flags, uint16_t window, uint16_t checksum, uint16_t urg_pointer)
-	{
-	tcp_hdr->ack_nr					= ack_nr;
-	tcp_hdr->checksum				= checksum;
-	tcp_hdr->dataOffset_reserved	= dataOffset_reserved;
-	tcp_hdr->dst_port				= dst_port;
-	tcp_hdr->reserved_flags			= reserved_flags;
-	tcp_hdr->seq_nr					= seq_nr;
-	tcp_hdr->src_port				= src_port;
-	tcp_hdr->urg_pointer			= urg_pointer;
-	tcp_hdr->window					= window;
-	}
-
-// Check for consistent ACK and SEQ number
-int check_tcp_consistency(socket_t *current_tcp_socket, tcp_hdr_t *tcp_header)
-	{
-	if (IS_TCP_ACK(tcp_header->reserved_flags))
-		{
-		if(tcp_header->ack_nr > (current_tcp_socket->tcp_control.send_nxt))
-			{
-			// ACK of not yet sent byte, discard
-			return ACK_NO_TOO_BIG;
-			}
-		else if (tcp_header->ack_nr <= (current_tcp_socket->tcp_control.send_una))
-			{
-			// ACK of previous segments, maybe dropped?
-			return ACK_NO_TOO_SMALL;
-			}
-		}
-	else if ((current_tcp_socket->tcp_control.rcv_nxt > 0) && (tcp_header->seq_nr < current_tcp_socket->tcp_control.rcv_nxt))
-		{
-		// segment repetition, maybe ACK got lost?
-		return SEQ_NO_TOO_SMALL;
-		}
-	return PACKET_OK;
-	}
-
-void switch_tcp_packet_byte_order(tcp_hdr_t *current_tcp_packet)
-	{
-	if (current_tcp_packet->dataOffset_reserved*4 > TCP_HDR_LEN)
-		{
-		if (*(((uint8_t*)current_tcp_packet)+TCP_HDR_LEN) == TCP_MSS_OPTION)
-			{
-			uint8_t *packet_pointer = (uint8_t *)current_tcp_packet;
-			packet_pointer += (TCP_HDR_LEN+2);
-			uint8_t mss1 = *packet_pointer;
-			uint8_t mss2 = *(packet_pointer+1);
-			*packet_pointer = mss2;
-			*(packet_pointer+1) = mss1;
-			}
-		if (*(((uint8_t*)current_tcp_packet)+TCP_HDR_LEN) == TCP_TS_OPTION)
-			{
-			// TODO: Timestamp option not implemented
-			}
-		}
-
-	current_tcp_packet->seq_nr = HTONL(current_tcp_packet->seq_nr);
-	current_tcp_packet->ack_nr = HTONL(current_tcp_packet->ack_nr);
-	current_tcp_packet->window = HTONS(current_tcp_packet->window);
-	current_tcp_packet->urg_pointer = HTONS(current_tcp_packet->urg_pointer);
-	}
-
-int send_tcp(socket_internal_t *current_socket, tcp_hdr_t *current_tcp_packet, ipv6_hdr_t *temp_ipv6_header, uint8_t flags, uint8_t payload_length)
-	{
-	socket_t *current_tcp_socket = &current_socket->socket_values;
-	uint8_t header_length = TCP_HDR_LEN/4;
-	if (IS_TCP_SYN(flags) || IS_TCP_SYN_ACK(flags))
-		{
-		tcp_mss_option_t current_mss_option;
-		header_length += sizeof(tcp_mss_option_t)/4;
-
-		current_mss_option.kind 	= TCP_MSS_OPTION;
-		current_mss_option.len 		= sizeof(tcp_mss_option_t);
-		current_mss_option.mss		= STATIC_MSS;
-		memcpy(((uint8_t*)current_tcp_packet)+TCP_HDR_LEN, &current_mss_option, sizeof(tcp_mss_option_t));
-		}
-
-	set_tcp_packet(current_tcp_packet, current_tcp_socket->local_address.sin6_port, current_tcp_socket->foreign_address.sin6_port,
-						(flags == TCP_ACK ? current_tcp_socket->tcp_control.send_una-1 : current_tcp_socket->tcp_control.send_una),
-						current_tcp_socket->tcp_control.rcv_nxt, header_length, flags, current_tcp_socket->tcp_control.rcv_wnd, 0, 0);
-
-	// Fill IPv6 Header
-	memcpy(&(temp_ipv6_header->destaddr), &current_tcp_socket->foreign_address.sin6_addr, 16);
-	memcpy(&(temp_ipv6_header->srcaddr), &current_tcp_socket->local_address.sin6_addr, 16);
-	temp_ipv6_header->length = header_length*4 + payload_length;
-
-	current_tcp_packet->checksum = ~tcp_csum(temp_ipv6_header, current_tcp_packet);
-
-#ifdef TCP_HC
-	uint16_t compressed_size;
-
-	compressed_size = compress_tcp_packet(current_socket, (uint8_t *) current_tcp_packet, temp_ipv6_header, flags, payload_length);
-
-	if (compressed_size == 0)
-		{
-		// Error in compressing tcp packet header
-		return -1;
-		}
-	sixlowpan_send(&current_tcp_socket->foreign_address.sin6_addr, (uint8_t*)(current_tcp_packet), compressed_size, IPPROTO_TCP);
-	return 1;
-#else
-//	print_tcp_status(OUT_PACKET, temp_ipv6_header, current_tcp_packet, current_tcp_socket);
-	switch_tcp_packet_byte_order(current_tcp_packet);
-	sixlowpan_send(&current_tcp_socket->foreign_address.sin6_addr, (uint8_t*)(current_tcp_packet), header_length*4+payload_length, IPPROTO_TCP);
-	return 1;
-#endif
-	}
-
-void set_tcp_cb(tcp_cb_t *tcp_control, uint32_t rcv_nxt, uint16_t rcv_wnd, uint32_t send_nxt, uint32_t send_una, uint16_t send_wnd)
-	{
-	tcp_control->rcv_nxt = rcv_nxt;
-	tcp_control->rcv_wnd = rcv_wnd;
-	tcp_control->send_nxt = send_nxt;
-	tcp_control->send_una = send_una;
-	tcp_control->send_wnd = send_wnd;
-	}
-
-int connect(int socket, sockaddr6_t *addr, uint32_t addrlen)
-	{
-	// Variables
-	ipv6_addr_t src_addr;
-	socket_internal_t *current_int_tcp_socket;
-	socket_t *current_tcp_socket;
-	msg_t msg_from_server;
-	uint8_t send_buffer[BUFFER_SIZE];
-	ipv6_hdr_t *temp_ipv6_header = ((ipv6_hdr_t*)(&send_buffer));
-	tcp_hdr_t *current_tcp_packet = ((tcp_hdr_t*)(&send_buffer[IPV6_HDR_LEN]));
-
-	// Check if socket exists
-	current_int_tcp_socket = getSocket(socket);
-	if (current_int_tcp_socket == NULL)
-		{
-		return -1;
-		}
-
-	current_tcp_socket = &current_int_tcp_socket->socket_values;
-
-	current_int_tcp_socket->recv_pid = thread_getpid();
-
-	// Local address information
-	ipv6_get_saddr(&src_addr, &addr->sin6_addr);
-	set_socket_address(&current_tcp_socket->local_address, PF_INET6, HTONS(get_free_source_port(IPPROTO_TCP)), 0, &src_addr);
-
-	// Foreign address information
-	set_socket_address(&current_tcp_socket->foreign_address, addr->sin6_family, addr->sin6_port, addr->sin6_flowinfo, &addr->sin6_addr);
-
-	// Fill lcoal TCP socket information
-	srand(addr->sin6_port);
-
-	current_tcp_socket->tcp_control.rcv_irs 	= 0;
-	mutex_lock(&global_sequence_clunter_mutex);
-	current_tcp_socket->tcp_control.send_iss 	= global_sequence_counter;
-	mutex_unlock(&global_sequence_clunter_mutex, 0);
-	current_tcp_socket->tcp_control.state 		= SYN_SENT;
-
-#ifdef TCP_HC
-	// Choosing random number Context ID
-	mutex_lock(&global_context_counter_mutex);
-	current_tcp_socket->tcp_control.tcp_context.context_id = global_context_counter;
-	mutex_unlock(&global_context_counter_mutex, 0);
-
-	current_tcp_socket->tcp_control.tcp_context.hc_type = FULL_HEADER;
-
-	// Remember TCP Context for possible TCP_RETRY
-	tcp_hc_context_t saved_tcp_context;
-	memcpy(&saved_tcp_context, &current_tcp_socket->tcp_control.tcp_context, sizeof(tcp_hc_context_t));
-#endif
-
-	set_tcp_cb(&current_tcp_socket->tcp_control, 0, STATIC_WINDOW, current_tcp_socket->tcp_control.send_iss, current_tcp_socket->tcp_control.send_iss, 0);
-
-	// Remember current time
-	current_tcp_socket->tcp_control.last_packet_time = vtimer_now();
-	current_tcp_socket->tcp_control.no_of_retries = 0;
-
-	msg_from_server.type = TCP_RETRY;
-
-	while (msg_from_server.type == TCP_RETRY)
-		{
-		// Send packet
-		send_tcp(current_int_tcp_socket, current_tcp_packet, temp_ipv6_header, TCP_SYN, 0);
-
-		// wait for SYN ACK or RETRY
-		msg_receive(&msg_from_server);
-		if (msg_from_server.type == TCP_TIMEOUT)
-			{
-#ifdef TCP_HC
-			// We did not send anything successful so restore last context
-			memcpy(&current_tcp_socket->tcp_control.tcp_context, &saved_tcp_context, sizeof(tcp_hc_context_t));
-#endif
-			return -1;
-			}
-#ifdef TCP_HC
-		else if (msg_from_server.type == TCP_RETRY)
-			{
-			// We retry sending a packet so set everything to last values again
-			memcpy(&current_tcp_socket->tcp_control.tcp_context, &saved_tcp_context, sizeof(tcp_hc_context_t));
-			}
-#endif
-		}
-
-	// Read packet content
-	tcp_hdr_t *tcp_header = ((tcp_hdr_t*)(msg_from_server.content.ptr));
-
-	// Check for consistency
-	if (tcp_header->ack_nr != current_tcp_socket->tcp_control.send_nxt+1)
-		{
-		printf("TCP packets not consistent!\n");
-		}
-
-	// Got SYN ACK from Server
-	// Refresh foreign TCP socket information
-	if ((tcp_header->dataOffset_reserved*4 > TCP_HDR_LEN) && (*(((uint8_t*)tcp_header)+TCP_HDR_LEN) == TCP_MSS_OPTION))
-		{
-		current_tcp_socket->tcp_control.mss = *((uint16_t*)(((uint8_t*)tcp_header)+TCP_HDR_LEN+2));
-		}
-	else
-		{
-		current_tcp_socket->tcp_control.mss = STATIC_MSS;
-		}
-	current_tcp_socket->tcp_control.rcv_irs = tcp_header->seq_nr;
-	set_tcp_cb(&current_tcp_socket->tcp_control, tcp_header->seq_nr+1, current_tcp_socket->tcp_control.rcv_wnd,
-			current_tcp_socket->tcp_control.send_una, current_tcp_socket->tcp_control.send_una, tcp_header->window);
-	current_tcp_socket->tcp_control.send_una++;
-	current_tcp_socket->tcp_control.send_nxt++;
-
-	msg_from_server.type = UNDEFINED;
-
-	// Remember current time
-	current_tcp_socket->tcp_control.last_packet_time = vtimer_now();
-	current_tcp_socket->tcp_control.no_of_retries = 0;
-
-#ifdef TCP_HC
-	current_tcp_socket->tcp_control.tcp_context.hc_type = FULL_HEADER;
-	// Remember TCP Context for possible TCP_RETRY
-	memcpy(&saved_tcp_context, &current_tcp_socket->tcp_control.tcp_context, sizeof(tcp_hc_context_t));
-#endif
-
-	while (msg_from_server.type != TCP_RETRY)
-		{
-		// Send packet
-		send_tcp(current_int_tcp_socket, current_tcp_packet, temp_ipv6_header, TCP_ACK, 0);
-
-		msg_receive(&msg_from_server);
-#ifdef TCP_HC
-		if (msg_from_server.type == TCP_SYN_ACK)
-			{
-			// TCP_SYN_ACK from server arrived again, copy old context and send TCP_ACK again
-			memcpy(&current_tcp_socket->tcp_control.tcp_context, &saved_tcp_context, sizeof(tcp_hc_context_t));
-			}
-		else if (msg_from_server.type == TCP_RETRY)
-			{
-			// We waited for RTT, no TCP_SYN_ACK received, so we assume the TCP_ACK packet arrived safely
-			}
-#endif
-		}
-
-	current_tcp_socket->tcp_control.state = ESTABLISHED;
-
-	current_int_tcp_socket->recv_pid = 255;
-
-	print_sockets();
-	return 0;
-	}
-
-void calculate_rto(tcp_cb_t *tcp_control, long current_time)
-	{
-	double rtt = current_time - tcp_control->last_packet_time.microseconds;
-	double srtt = tcp_control->srtt;
-	double rttvar = tcp_control->rttvar;
-	double rto = tcp_control->rto;
-
-	if ((srtt == 0) && (rttvar == 0) && (rto == TCP_INITIAL_ACK_TIMEOUT))
-		{
-		// First calculation
-		srtt = rtt;
-		rttvar = 0.5*rtt;
-		rto = rtt + (((4*rttvar) < TCP_TIMER_RESOLUTION) ? (TCP_TIMER_RESOLUTION) : (4*rttvar));
-		}
-	else
-		{
-		// every other calculation
-		srtt = (1-TCP_ALPHA)*srtt+TCP_ALPHA*rtt;
-		rttvar = (1-TCP_BETA)*rttvar+TCP_BETA*abs(srtt-rtt);
-		rto = srtt + (((4*rttvar) < TCP_TIMER_RESOLUTION) ? (TCP_TIMER_RESOLUTION) : (4*rttvar));
-		}
-	if (rto < SECOND)
-		{
-		rto = SECOND;
-		}
-	tcp_control->srtt = srtt;
-	tcp_control->rttvar = rttvar;
-	tcp_control->rto = rto;
-	}
-
-int32_t send(int s, void *msg, uint32_t len, int flags)
-	{
-	// Variables
-	msg_t recv_msg;
-	int32_t sent_bytes = 0, total_sent_bytes = 0;
-	socket_internal_t *current_int_tcp_socket;
-	socket_t *current_tcp_socket;
-	uint8_t send_buffer[BUFFER_SIZE];
-	memset(send_buffer, 0, BUFFER_SIZE);
-	ipv6_hdr_t *temp_ipv6_header = ((ipv6_hdr_t*)(&send_buffer));
-	tcp_hdr_t *current_tcp_packet = ((tcp_hdr_t*)(&send_buffer[IPV6_HDR_LEN]));
-
-
-	// Check if socket exists and is TCP socket
-	if (!isTCPSocket(s))
-		{
-		return -1;
-		}
-
-	current_int_tcp_socket = getSocket(s);
-	current_tcp_socket = &current_int_tcp_socket->socket_values;
-
-	// Check for ESTABLISHED STATE
-	if (current_tcp_socket->tcp_control.state != ESTABLISHED)
-		{
-		return -1;
-		}
-
-	// Add thread PID
-	current_int_tcp_socket->send_pid = thread_getpid();
-
-	recv_msg.type = UNDEFINED;
-
-	while (1)
-		{
-		current_tcp_socket->tcp_control.no_of_retries = 0;
-
-#ifdef TCP_HC
-		current_tcp_socket->tcp_control.tcp_context.hc_type = COMPRESSED_HEADER;
-		// Remember TCP Context for possible TCP_RETRY
-		tcp_hc_context_t saved_tcp_context;
-		memcpy(&saved_tcp_context, &current_tcp_socket->tcp_control.tcp_context, sizeof(tcp_hc_context_t)-1);
-#endif
-
-		while (recv_msg.type != TCP_ACK)
-			{
-			// Add packet data
-			if (current_tcp_socket->tcp_control.send_wnd > current_tcp_socket->tcp_control.mss)
-				{
-				// Window size > Maximum Segment Size
-				if ((len-total_sent_bytes) > current_tcp_socket->tcp_control.mss)
-					{
-					memcpy(&send_buffer[IPV6_HDR_LEN+TCP_HDR_LEN], msg, current_tcp_socket->tcp_control.mss);
-					sent_bytes = current_tcp_socket->tcp_control.mss;
-					total_sent_bytes += sent_bytes;
-					}
-				else
-					{
-					memcpy(&send_buffer[IPV6_HDR_LEN+TCP_HDR_LEN], msg+total_sent_bytes, len-total_sent_bytes);
-					sent_bytes = len-total_sent_bytes;
-					total_sent_bytes = len;
-					}
-				}
-			else
-				{
-				// Window size <= Maximum Segment Size
-				if ((len-total_sent_bytes) > current_tcp_socket->tcp_control.send_wnd)
-					{
-					memcpy(&send_buffer[IPV6_HDR_LEN+TCP_HDR_LEN], msg, current_tcp_socket->tcp_control.send_wnd);
-					sent_bytes = current_tcp_socket->tcp_control.send_wnd;
-					total_sent_bytes += sent_bytes;
-					}
-				else
-					{
-					memcpy(&send_buffer[IPV6_HDR_LEN+TCP_HDR_LEN], msg+total_sent_bytes, len-total_sent_bytes);
-					sent_bytes = len-total_sent_bytes;
-					total_sent_bytes = len;
-					}
-				}
-
-			current_tcp_socket->tcp_control.send_nxt += sent_bytes;
-			current_tcp_socket->tcp_control.send_wnd -= sent_bytes;
-
-			if (send_tcp(current_int_tcp_socket, current_tcp_packet, temp_ipv6_header, 0, sent_bytes) != 1)
-				{
-				// Error while sending tcp data
-				current_tcp_socket->tcp_control.send_nxt -= sent_bytes;
-				current_tcp_socket->tcp_control.send_wnd += sent_bytes;
-#ifdef TCP_HC
-				memcpy(&current_tcp_socket->tcp_control.tcp_context, &saved_tcp_context, sizeof(tcp_hc_context_t));
-				current_tcp_socket->tcp_control.tcp_context.hc_type = COMPRESSED_HEADER;
-#endif
-				printf("Error while sending, returning to application thread!\n");
-				return -1;
-				}
-
-			// Remember current time
-			current_tcp_socket->tcp_control.last_packet_time.microseconds = hwtimer_now();
-			net_msg_receive(&recv_msg);
-			switch (recv_msg.type)
-				{
-				case TCP_ACK:
-					{
-					if (current_tcp_socket->tcp_control.no_of_retries == 0)
-						{
-						calculate_rto(&current_tcp_socket->tcp_control, hwtimer_now());
-						}
-					tcp_hdr_t *tcp_header = ((tcp_hdr_t*)(recv_msg.content.ptr));
-					if ((current_tcp_socket->tcp_control.send_nxt == tcp_header->ack_nr) && (total_sent_bytes == len))
-						{
-						current_tcp_socket->tcp_control.send_una = tcp_header->ack_nr;
-						current_tcp_socket->tcp_control.send_nxt = tcp_header->ack_nr;
-						current_tcp_socket->tcp_control.send_wnd = tcp_header->window;
-						// Got ACK for every sent byte
-#ifdef TCP_HC
-						current_tcp_socket->tcp_control.tcp_context.hc_type = COMPRESSED_HEADER;
-#endif
-						return sent_bytes;
-						}
-					else if ((current_tcp_socket->tcp_control.send_nxt == tcp_header->ack_nr) && (total_sent_bytes != len))
-						{
-						current_tcp_socket->tcp_control.send_una = tcp_header->ack_nr;
-						current_tcp_socket->tcp_control.send_nxt = tcp_header->ack_nr;
-						current_tcp_socket->tcp_control.send_wnd = tcp_header->window;
-						// Got ACK for every sent byte
-#ifdef TCP_HC
-						current_tcp_socket->tcp_control.tcp_context.hc_type = COMPRESSED_HEADER;
-#endif
-						break;
-						}
-//					else
-//						{
-//						// TODO: If window size > MSS, ACK was valid only for a few segments, handle retransmit of missing segments
-//						break;
-//						}
-					break;
-					}
-				case TCP_RETRY:
-					{
-					current_tcp_socket->tcp_control.send_nxt -= sent_bytes;
-					current_tcp_socket->tcp_control.send_wnd += sent_bytes;
-					total_sent_bytes -= sent_bytes;
-#ifdef TCP_HC
-					memcpy(&current_tcp_socket->tcp_control.tcp_context, &saved_tcp_context, sizeof(tcp_hc_context_t));
-					current_tcp_socket->tcp_control.tcp_context.hc_type = MOSTLY_COMPRESSED_HEADER;
-#endif
-					break;
-					}
-				case TCP_TIMEOUT:
-					{
-					current_tcp_socket->tcp_control.send_nxt -= sent_bytes;
-					current_tcp_socket->tcp_control.send_wnd += sent_bytes;
-#ifdef TCP_HC
-					memcpy(&current_tcp_socket->tcp_control.tcp_context, &saved_tcp_context, sizeof(tcp_hc_context_t));
-					current_tcp_socket->tcp_control.tcp_context.hc_type = COMPRESSED_HEADER;
-#endif
-					return -1;
-					break;
-					}
-				}
-			}
-		}
-	return sent_bytes;
-	}
-
-uint8_t read_from_socket(socket_internal_t *current_int_tcp_socket, void *buf, int len)
-	{
-	if (len >= current_int_tcp_socket->tcp_input_buffer_end)
-		{
-		mutex_lock(&current_int_tcp_socket->tcp_buffer_mutex);
-		uint8_t read_bytes = current_int_tcp_socket->tcp_input_buffer_end;
-		memcpy(buf, current_int_tcp_socket->tcp_input_buffer, current_int_tcp_socket->tcp_input_buffer_end);
-		current_int_tcp_socket->tcp_input_buffer_end = 0;
-		current_int_tcp_socket->socket_values.tcp_control.rcv_wnd += read_bytes;
-		mutex_unlock(&current_int_tcp_socket->tcp_buffer_mutex, 0);
-		return read_bytes;
-		}
-	else
-		{
-		mutex_lock(&current_int_tcp_socket->tcp_buffer_mutex);
-		memcpy(buf, current_int_tcp_socket->tcp_input_buffer, len);
-		memmove(current_int_tcp_socket->tcp_input_buffer, (current_int_tcp_socket->tcp_input_buffer+len), current_int_tcp_socket->tcp_input_buffer_end-len);
-		current_int_tcp_socket->tcp_input_buffer_end = current_int_tcp_socket->tcp_input_buffer_end-len;
-		current_int_tcp_socket->socket_values.tcp_control.rcv_wnd += len;
-		mutex_unlock(&current_int_tcp_socket->tcp_buffer_mutex, 0);
-		return len;
-		}
-	}
-
-int recv(int s, void *buf, uint32_t len, int flags)
-	{
-	// Variables
-	uint8_t read_bytes;
-	msg_t m_recv, m_send;
-	socket_internal_t *current_int_tcp_socket;
-	// Check if socket exists
-	if (!isTCPSocket(s))
-		{
-		printf("INFO: NO TCP SOCKET!\n");
-		return -1;
-		}
-
-	current_int_tcp_socket = getSocket(s);
-
-	// Setting Thread PID
-	current_int_tcp_socket->recv_pid = thread_getpid();
-	if (current_int_tcp_socket->tcp_input_buffer_end > 0)
-		{
-		return read_from_socket(current_int_tcp_socket, buf, len);
-		}
-	msg_receive(&m_recv);
-	if ((exists_socket(s)) && (current_int_tcp_socket->tcp_input_buffer_end > 0))
-		{
-		read_bytes = read_from_socket(current_int_tcp_socket, buf, len);
-		net_msg_reply(&m_recv, &m_send, UNDEFINED);
-		return read_bytes;
-		}
-
-	// Received FIN
-	if (m_recv.type == CLOSE_CONN)
-		{
-		// Sent FIN_ACK, wait for ACK
-		msg_receive(&m_recv);
-		// Received ACK, return with closed socket!
-		return -1;
-		}
-	// Received Last ACK (connection closed) or no data to read yet
-	return -1;
-	}
-
-int32_t recvfrom(int s, void *buf, uint32_t len, int flags, sockaddr6_t *from, uint32_t *fromlen)
-	{
-	if (isUDPSocket(s))
-		{
-		msg_t m_recv, m_send;
-		ipv6_hdr_t *ipv6_header;
-		udp_hdr_t *udp_header;
-		uint8_t *payload;
-		getSocket(s)->recv_pid = thread_getpid();
-
-		msg_receive(&m_recv);
-
-		ipv6_header = ((ipv6_hdr_t*)m_recv.content.ptr);
-		udp_header = ((udp_hdr_t*)(m_recv.content.ptr + IPV6_HDR_LEN));
-		payload = (uint8_t*)(m_recv.content.ptr + IPV6_HDR_LEN+UDP_HDR_LEN);
-
-		memset(buf, 0, len);
-		memcpy(buf, payload, udp_header->length-UDP_HDR_LEN);
-		memcpy(&from->sin6_addr, &ipv6_header->srcaddr, 16);
-		from->sin6_family = AF_INET6;
-		from->sin6_flowinfo = 0;
-		from->sin6_port = udp_header->src_port;
-		*fromlen = sizeof(sockaddr6_t);
-
-		msg_reply(&m_recv, &m_send);
-		return udp_header->length-UDP_HDR_LEN;
-		}
-	else if (isTCPSocket(s))
-		{
-		return recv(s, buf, len, flags);
-		}
-	else
-		{
-		printf("Socket Type not supported!\n");
-		return -1;
-		}
-	}
-
-int32_t sendto(int s, void *msg, uint32_t len, int flags, sockaddr6_t *to, uint32_t tolen)
-	{
-	if (isUDPSocket(s) && (getSocket(s)->socket_values.foreign_address.sin6_port == 0))
-		{
-		uint8_t send_buffer[BUFFER_SIZE];
-
-		ipv6_hdr_t *temp_ipv6_header = ((ipv6_hdr_t*)(&send_buffer));
-		udp_hdr_t *current_udp_packet = ((udp_hdr_t*)(&send_buffer[IPV6_HDR_LEN]));
-		uint8_t *payload = &send_buffer[IPV6_HDR_LEN+UDP_HDR_LEN];
-
-		memcpy(&(temp_ipv6_header->destaddr), &to->sin6_addr, 16);
-		ipv6_get_saddr(&(temp_ipv6_header->srcaddr), &(temp_ipv6_header->destaddr));
-
-		current_udp_packet->src_port = get_free_source_port(IPPROTO_UDP);
-		current_udp_packet->dst_port = to->sin6_port;
-		current_udp_packet->checksum = 0;
-
-		memcpy(payload, msg, len);
-		current_udp_packet->length = UDP_HDR_LEN + len;
-		temp_ipv6_header->length = UDP_HDR_LEN + len;
-
-		current_udp_packet->checksum = ~udp_csum(temp_ipv6_header, current_udp_packet);
-
-		sixlowpan_send(&to->sin6_addr, (uint8_t*)(current_udp_packet), current_udp_packet->length, IPPROTO_UDP);
-		return current_udp_packet->length;
-		}
-	else
-		{
-		return -1;
-		}
-	}
-
-int close(int s)
-	{
-	socket_internal_t *current_socket = getSocket(s);
-	if (current_socket != NULL)
-		{
-		if (isTCPSocket(s))
-			{
-			// Variables
-			msg_t m_recv;
-			uint8_t send_buffer[BUFFER_SIZE];
-			ipv6_hdr_t *temp_ipv6_header = ((ipv6_hdr_t*)(&send_buffer));
-			tcp_hdr_t *current_tcp_packet = ((tcp_hdr_t*)(&send_buffer[IPV6_HDR_LEN]));
-
-			// Check if socket exists and is TCP socket
-			if (!isTCPSocket(s))
-				{
-				return -1;
-				}
-
-			// Check for ESTABLISHED STATE
-			if (current_socket->socket_values.tcp_control.state != ESTABLISHED)
-				{
-				close_socket(current_socket);
-				return 1;
-				}
-
-			current_socket->send_pid = thread_getpid();
-
-			// Refresh local TCP socket information
-			current_socket->socket_values.tcp_control.send_una++;
-			current_socket->socket_values.tcp_control.state = FIN_WAIT_1;
-#ifdef TCP_HC
-			current_socket->socket_values.tcp_control.tcp_context.hc_type = COMPRESSED_HEADER;
-#endif
-
-			send_tcp(current_socket, current_tcp_packet, temp_ipv6_header, TCP_FIN, 0);
-			msg_receive(&m_recv);
-			close_socket(current_socket);
-			return 1;
-			}
-		else if(isUDPSocket(s))
-			{
-			close_socket(current_socket);
-			return 1;
-			}
-		return -1;
-		}
-	else
-		{
-		return -1;
-		}
-	}
-
-int bind(int s, sockaddr6_t *name, int namelen)
-	{
-	if (exists_socket(s))
-		{
-		socket_t *current_socket = &getSocket(s)->socket_values;
-		switch (current_socket->domain)
-			{
-			case (PF_INET):
-				{
-				// Not provided
-				return -1;
-				break;
-				}
-			case (PF_INET6):
-				{
-				switch (current_socket->type)
-					{
-					// TCP
-					case (SOCK_STREAM):
-						{
-						if ((current_socket->protocol == 0) || (current_socket->protocol == IPPROTO_TCP))
-							{
-							return bind_tcp_socket(s, name, namelen, thread_getpid());
-							break;
-							}
-						else
-							{
-							return -1;
-							break;
-							}
-						break;
-						}
-					// UDP
-					case (SOCK_DGRAM):
-						{
-						if ((current_socket->protocol == 0) || (current_socket->protocol == IPPROTO_UDP))
-							{
-							return bind_udp_socket(s, name, namelen, thread_getpid());
-							break;
-							}
-						else
-							{
-							return -1;
-							break;
-							}
-						break;
-						}
-					case (SOCK_SEQPACKET):
-						{
-						// not provided
-						return -1;
-						break;
-						}
-					case (SOCK_RAW):
-						{
-						// not provided
-						return -1;
-						break;
-						}
-					default:
-						{
-						return -1;
-						break;
-						}
-					}
-				break;
-				}
-			case (PF_UNIX):
-				{
-				// Not provided
-				return -1;
-				break;
-				}
-			}
-		}
-	else
-		{
-		printf("SOCKET DOES NOT EXIST!\n");
-		return -1;
-		}
-	return -1;
-	}
-
-int listen(int s, int backlog)
-	{
-	if (isTCPSocket(s) && getSocket(s)->socket_values.tcp_control.state == CLOSED)
-		{
-		socket_internal_t *current_socket = getSocket(s);
-		current_socket->socket_values.tcp_control.state = LISTEN;
-		return 0;
-		}
-	else
-		{
-		return -1;
-		}
-	}
-
-socket_internal_t *getWaitingConnectionSocket(int socket, ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header)
-	{
-	int i;
-	socket_internal_t *current_socket, *listening_socket = getSocket(socket);
-	for (i = 1; i < MAX_SOCKETS+1; i++)
-		{
-		current_socket = getSocket(i);
-		// Connection establishment ACK, Check for 4 touple and state
-		if ((ipv6_header != NULL) && (tcp_header != NULL))
-			{
-			if (is_four_touple(current_socket, ipv6_header, tcp_header) && (current_socket->socket_values.tcp_control.state == SYN_RCVD))
-				{
-				return current_socket;
-				}
-			}
-		// Connection establishment SYN ACK, check only for port and state
-		else
-			{
-			if ((current_socket->socket_values.tcp_control.state == SYN_RCVD) &&
-				(current_socket->socket_values.local_address.sin6_port == listening_socket->socket_values.local_address.sin6_port))
-				{
-				return current_socket;
-				}
-			}
-		}
-	return NULL;
-	}
-
-int handle_new_tcp_connection(socket_internal_t *current_queued_int_socket, socket_internal_t *server_socket, uint8_t pid)
-	{
-	msg_t msg_recv_client_ack, msg_send_client_ack;
-	socket_t *current_queued_socket = &current_queued_int_socket->socket_values;
-	uint8_t send_buffer[BUFFER_SIZE];
-	ipv6_hdr_t *temp_ipv6_header = ((ipv6_hdr_t*)(&send_buffer));
-	tcp_hdr_t *syn_ack_packet = ((tcp_hdr_t*)(&send_buffer[IPV6_HDR_LEN]));
-
-	current_queued_int_socket->recv_pid = thread_getpid();
-#ifdef TCP_HC
-	current_queued_int_socket->socket_values.tcp_control.tcp_context.hc_type = FULL_HEADER;
-	memcpy(&current_queued_int_socket->socket_values.tcp_control.tcp_context.context_id,
-			&server_socket->socket_values.tcp_control.tcp_context.context_id, sizeof(server_socket->socket_values.tcp_control.tcp_context.context_id));
-#endif
-	// Remember current time
-	current_queued_int_socket->socket_values.tcp_control.last_packet_time = vtimer_now();
-
-	current_queued_int_socket->socket_values.tcp_control.no_of_retries = 0;
-
-	// Set message type to Retry for while loop
-	msg_recv_client_ack.type = TCP_RETRY;
-
-	while (msg_recv_client_ack.type == TCP_RETRY)
-		{
-		// Send packet
-		send_tcp(current_queued_int_socket, syn_ack_packet, temp_ipv6_header, TCP_SYN_ACK, 0);
-
-		// wait for ACK from Client
-		msg_receive(&msg_recv_client_ack);
-		if (msg_recv_client_ack.type == TCP_TIMEOUT)
-			{
-			// Set status of internal socket back to LISTEN
-			server_socket->socket_values.tcp_control.state = LISTEN;
-
-			close_socket(current_queued_int_socket);
-			return -1;
-			}
-		}
-
-	tcp_hdr_t *tcp_header;
-
-	tcp_header = ((tcp_hdr_t*)(msg_recv_client_ack.content.ptr));
-
-	// Check for consistency
-	if (tcp_header->ack_nr != current_queued_socket->tcp_control.send_nxt+1)
-		{
-		printf("TCP packets not consistent!\n");
-		}
-
-	// Got ack, connection established, refresh local and foreign tcp socket status
-	set_tcp_cb(&current_queued_socket->tcp_control, tcp_header->seq_nr+1, current_queued_socket->tcp_control.rcv_wnd, tcp_header->ack_nr,
-			tcp_header->ack_nr, tcp_header->window);
-
-#ifdef TCP_HC
-	// Copy TCP context information into new socket
-	memset(&server_socket->socket_values.tcp_control.tcp_context, 0, sizeof(tcp_hc_context_t));
-#endif
-
-	// Update connection status information
-	current_queued_socket->tcp_control.state = ESTABLISHED;
-
-	// Set status of internal socket back to LISTEN
-	server_socket->socket_values.tcp_control.state = LISTEN;
-
-	// send a reply to the TCP handler after processing every information from the TCP ACK packet
-	msg_reply(&msg_recv_client_ack, &msg_send_client_ack);
-
-	// Reset PID to an unlikely value
-	current_queued_int_socket->recv_pid = 255;
-
-	// Waiting for Clients ACK waiting period to time out
-	vtimer_usleep(TCP_SYN_INITIAL_TIMEOUT/2);
-
-	print_sockets();
-
-	return current_queued_int_socket->socket_id;
-	}
-
-int accept(int s, sockaddr6_t *addr, uint32_t addrlen)
-	{
-	socket_internal_t *server_socket = getSocket(s);
-	if (isTCPSocket(s) && (server_socket->socket_values.tcp_control.state == LISTEN))
-		{
-		socket_internal_t *current_queued_socket = getWaitingConnectionSocket(s, NULL, NULL);
-		if (current_queued_socket != NULL)
-			{
-			return handle_new_tcp_connection(current_queued_socket, server_socket, thread_getpid());
-			}
-		else
-			{
-			// No waiting connections, waiting for message from TCP Layer
-			msg_t msg_recv_client_syn;
-			msg_recv_client_syn.type = UNDEFINED;
-			while (msg_recv_client_syn.type != TCP_SYN)
-				{
-				msg_receive(&msg_recv_client_syn);
-				}
-
-			current_queued_socket = getWaitingConnectionSocket(s, NULL, NULL);
-
-			return handle_new_tcp_connection(current_queued_socket, server_socket, thread_getpid());
-			}
-		}
-	else
-		{
-		return -1;
-		}
-	}
-
-socket_internal_t *new_tcp_queued_socket(ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header)
-	{
-	int queued_socket_id;
-
-	queued_socket_id = socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP);
-	socket_internal_t *current_queued_socket = getSocket(queued_socket_id);
-
-	// Foreign address
-	set_socket_address(&current_queued_socket->socket_values.foreign_address, AF_INET6, tcp_header->src_port, ipv6_header->flowlabel, &ipv6_header->srcaddr);
-
-	// Local address
-	set_socket_address(&current_queued_socket->socket_values.local_address, AF_INET6, tcp_header->dst_port, 0, &ipv6_header->destaddr);
-
-	// Foreign TCP information
-	if ((tcp_header->dataOffset_reserved*4 > TCP_HDR_LEN) && (*(((uint8_t*)tcp_header)+TCP_HDR_LEN) == TCP_MSS_OPTION))
-		{
-		current_queued_socket->socket_values.tcp_control.mss = *((uint16_t*)(((uint8_t*)tcp_header)+TCP_HDR_LEN+2));
-		}
-	else
-		{
-		current_queued_socket->socket_values.tcp_control.mss = STATIC_MSS;
-		}
-	current_queued_socket->socket_values.tcp_control.rcv_irs 	= tcp_header->seq_nr;
-	mutex_lock(&global_sequence_clunter_mutex);
-	current_queued_socket->socket_values.tcp_control.send_iss 	= global_sequence_counter;
-	mutex_unlock(&global_sequence_clunter_mutex, 0);
-	current_queued_socket->socket_values.tcp_control.state 		= SYN_RCVD;
-	set_tcp_cb(&current_queued_socket->socket_values.tcp_control, tcp_header->seq_nr+1, STATIC_WINDOW,
-			current_queued_socket->socket_values.tcp_control.send_iss,
-			current_queued_socket->socket_values.tcp_control.send_iss, tcp_header->window);
-
-	return current_queued_socket;
-	}
+/*
+ * socket.c
+ *
+ *  Created on: 16.09.2011
+ *      Author: Oliver
+ */
+#include <thread.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <math.h>
+#include "udp.h"
+#include "tcp.h"
+#include "socket.h"
+#include "vtimer.h"
+#include "hwtimer.h"
+#include "tcp_timer.h"
+#include "tcp_hc.h"
+#include "sys/net/net_help/net_help.h"
+#include "sys/net/net_help/msg_help.h"
+
+socket_internal_t sockets[MAX_SOCKETS];
+
+void printf_tcp_context(tcp_hc_context_t *current_tcp_context)
+	{
+	printf("Context: %u\n", current_tcp_context->context_id);
+	printf("Rcv Seq: %lu Rcv Ack: %lu, Rcv Wnd: %u\n", current_tcp_context->seq_rcv, current_tcp_context->ack_rcv, current_tcp_context->wnd_rcv);
+	printf("Snd Seq: %lu Snd Ack: %lu, Snd Wnd: %u\n", current_tcp_context->seq_snd, current_tcp_context->ack_snd, current_tcp_context->wnd_snd);
+	}
+
+void print_tcp_flags (tcp_hdr_t *tcp_header)
+	{
+	printf("FLAGS: ");
+	switch(tcp_header->reserved_flags)
+		{
+		case TCP_ACK:
+			{
+			printf("ACK ");
+			break;
+			}
+		case TCP_RST:
+			{
+			printf("RST ");
+			break;
+			}
+		case TCP_SYN:
+			{
+			printf("SYN ");
+			break;
+			}
+		case TCP_FIN:
+			{
+			printf("FIN ");
+			break;
+			}
+		case TCP_URG_PSH:
+			{
+			printf("URG PSH ");
+			break;
+			}
+		case TCP_SYN_ACK:
+			{
+			printf("SYN ACK ");
+			break;
+			}
+		case TCP_FIN_ACK:
+			{
+			printf("FIN ACK ");
+			break;
+			}
+		}
+	printf("\n");
+	}
+
+void print_tcp_cb(tcp_cb_t *cb)
+	{
+	printf("Send_ISS: %lu\nSend_UNA: %lu\nSend_NXT: %lu\nSend_WND: %u\n", cb->send_iss, cb->send_una, cb->send_nxt, cb->send_wnd);
+	printf("Rcv_IRS: %lu\nRcv_NXT: %lu\nRcv_WND: %u\n", cb->rcv_irs, cb->rcv_nxt, cb->rcv_wnd);
+	printf("Time difference: %lu, No_of_retries: %u, State: %u\n\n", timex_sub(vtimer_now(), cb->last_packet_time).microseconds, cb->no_of_retries, cb->state);
+	}
+
+void print_tcp_status(int in_or_out, ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header, socket_t *tcp_socket)
+	{
+	printf("--- %s TCP packet: ---\n", (in_or_out == INC_PACKET ? "Incoming" : "Outgoing"));
+	printf("IPv6 Source:");
+	ipv6_print_addr(&ipv6_header->srcaddr);
+	printf("IPv6 Dest:");
+	ipv6_print_addr(&ipv6_header->destaddr);
+	printf("TCP Length: %x\n", ipv6_header->length-TCP_HDR_LEN);
+	printf("Source Port: %x, Dest. Port: %x\n", NTOHS(tcp_header->src_port), NTOHS(tcp_header->dst_port));
+	printf("Source Port: %u, Dest. Port: %u\n", NTOHS(tcp_header->src_port), NTOHS(tcp_header->dst_port));
+	printf("ACK: %lx, SEQ: %lx, Window: %x\n", tcp_header->ack_nr, tcp_header->seq_nr, tcp_header->window);
+	printf("ACK: %lu, SEQ: %lu, Window: %u\n", tcp_header->ack_nr, tcp_header->seq_nr, tcp_header->window);
+	print_tcp_flags(tcp_header);
+	print_tcp_cb(&tcp_socket->tcp_control);
+#ifdef TCP_HC
+	printf_tcp_context(&tcp_socket->tcp_control.tcp_context);
+#endif
+	}
+
+void print_socket(socket_t *current_socket)
+	{
+	printf("Domain: %i, Type: %i, Protocol: %i \n",
+			current_socket->domain,
+			current_socket->type,
+			current_socket->protocol);
+	ipv6_print_addr(&current_socket->local_address.sin6_addr);
+	ipv6_print_addr(&current_socket->foreign_address.sin6_addr);
+	printf("Local Port: %u, Foreign Port: %u\n", NTOHS(current_socket->local_address.sin6_port),
+			NTOHS(current_socket->foreign_address.sin6_port));
+	}
+
+void print_internal_socket(socket_internal_t *current_socket_internal)
+	{
+	socket_t *current_socket = &current_socket_internal->socket_values;
+	printf("\n--------------------------\n");
+	printf("ID: %i, RECV PID: %i SEND PID: %i\n",	current_socket_internal->socket_id,	current_socket_internal->recv_pid, current_socket_internal->send_pid);
+	print_socket(current_socket);
+	printf("\n--------------------------\n");
+	}
+
+socket_internal_t *getSocket(uint8_t s)
+	{
+	if (exists_socket(s))
+		{
+		return &(sockets[s-1]);
+		}
+	else
+		{
+		return NULL;
+		}
+	}
+
+void print_sockets(void)
+	{
+	int i;
+	printf("\n---   Socket list:   ---\n");
+	for (i = 1; i < MAX_SOCKETS+1; i++)
+		{
+		if(getSocket(i) != NULL)
+			{
+			print_internal_socket(getSocket(i));
+			}
+		}
+	}
+
+bool exists_socket(uint8_t socket)
+	{
+	if (sockets[socket-1].socket_id == 0)
+		{
+		return false;
+		}
+	else
+		{
+		return true;
+		}
+	}
+
+void close_socket(socket_internal_t *current_socket)
+	{
+	memset(current_socket, 0, sizeof(socket_internal_t));
+	}
+
+bool isUDPSocket(uint8_t s)
+	{
+	if (	(exists_socket(s)) &&
+			(getSocket(s)->socket_values.domain == PF_INET6) &&
+			(getSocket(s)->socket_values.type == SOCK_DGRAM) &&
+			((getSocket(s)->socket_values.protocol == IPPROTO_UDP) ||
+			(getSocket(s)->socket_values.protocol == 0)))
+		return true;
+	else
+		return false;
+	}
+
+bool isTCPSocket(uint8_t s)
+	{
+	if (	(exists_socket(s)) &&
+			(getSocket(s)->socket_values.domain == PF_INET6) &&
+			(getSocket(s)->socket_values.type == SOCK_STREAM) &&
+			((getSocket(s)->socket_values.protocol == IPPROTO_TCP) ||
+			(getSocket(s)->socket_values.protocol == 0)))
+		return true;
+	else
+		return false;
+	}
+
+int bind_udp_socket(int s, sockaddr6_t *name, int namelen, uint8_t pid)
+	{
+	int i;
+	if (!exists_socket(s))
+		{
+		return -1;
+		}
+	for (i = 1; i < MAX_SOCKETS+1; i++)
+		{
+		if (isUDPSocket(i) && (getSocket(i)->socket_values.local_address.sin6_port == name->sin6_port))
+			{
+			return -1;
+			}
+		}
+	memcpy(&getSocket(s)->socket_values.local_address, name, namelen);
+	getSocket(s)->recv_pid = pid;
+	return 1;
+	}
+
+int bind_tcp_socket(int s, sockaddr6_t *name, int namelen, uint8_t pid)
+	{
+	int i;
+	if (!exists_socket(s))
+		{
+		return -1;
+		}
+	for (i = 1; i < MAX_SOCKETS+1; i++)
+		{
+		if (isTCPSocket(i) && (getSocket(i)->socket_values.local_address.sin6_port == name->sin6_port))
+			{
+			return -1;
+			}
+		}
+	memcpy(&getSocket(s)->socket_values.local_address, name, namelen);
+	getSocket(s)->recv_pid = pid;
+	getSocket(s)->socket_values.tcp_control.rto = TCP_INITIAL_ACK_TIMEOUT;
+	return 1;
+	}
+
+int socket(int domain, int type, int protocol)
+	{
+	int i = 1;
+	while (getSocket(i) != NULL)
+		{
+		i++;
+		}
+	if (i > MAX_SOCKETS+1)
+		{
+		return -1;
+		}
+	else
+		{
+		socket_t *current_socket = &sockets[i-1].socket_values;
+		sockets[i-1].socket_id = i;
+		current_socket->domain = domain;
+		current_socket->type = type;
+		current_socket->protocol = protocol;
+		current_socket->tcp_control.state = CLOSED;
+		return sockets[i-1].socket_id;
+		}
+	}
+
+socket_internal_t *get_udp_socket(ipv6_hdr_t *ipv6_header, udp_hdr_t *udp_header)
+	{
+	uint8_t i = 1;
+	while (i < MAX_SOCKETS+1)
+		{
+		if ( isUDPSocket(i) &&
+			(getSocket(i)->socket_values.local_address.sin6_port == udp_header->dst_port))
+			{
+			return getSocket(i);
+			}
+		i++;
+		}
+	return NULL;
+	}
+
+bool is_four_touple (socket_internal_t *current_socket, ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header)
+	{
+	return ((ipv6_get_addr_match(&current_socket->socket_values.local_address.sin6_addr, &ipv6_header->destaddr) == 128) &&
+			(current_socket->socket_values.local_address.sin6_port == tcp_header->dst_port) &&
+			(ipv6_get_addr_match(&current_socket->socket_values.foreign_address.sin6_addr, &ipv6_header->srcaddr) == 128) &&
+			(current_socket->socket_values.foreign_address.sin6_port == tcp_header->src_port));
+	}
+
+socket_internal_t *get_tcp_socket(ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header)
+	{
+	uint8_t i = 1;
+	socket_internal_t *current_socket = NULL;
+	socket_internal_t *listening_socket = NULL;
+	uint8_t compare[16];
+	memset(compare, 0, 16);
+
+	while (i < MAX_SOCKETS+1)
+		{
+		current_socket = getSocket(i);
+		// Check for matching 4 touple, ESTABLISHED connection
+		if( isTCPSocket(i) && is_four_touple(current_socket, ipv6_header, tcp_header))
+			{
+			return current_socket;
+			}
+		// Sockets in LISTEN and SYN_RCVD state should only be tested on local TCP values
+		else if ( isTCPSocket(i) &&
+				((current_socket->socket_values.tcp_control.state == LISTEN) || (current_socket->socket_values.tcp_control.state == SYN_RCVD)) &&
+				(current_socket->socket_values.local_address.sin6_addr.uint8[15] == ipv6_header->destaddr.uint8[15]) &&
+				(current_socket->socket_values.local_address.sin6_port == tcp_header->dst_port) &&
+				(current_socket->socket_values.foreign_address.sin6_addr.uint8[15] == 0x00) &&
+				(current_socket->socket_values.foreign_address.sin6_port == 0))
+			{
+			listening_socket = current_socket;
+			}
+		i++;
+		}
+	// Return either NULL if nothing was matched or the listening 2 touple socket
+	return listening_socket;
+	}
+
+uint16_t get_free_source_port(uint8_t protocol)
+	{
+	int i;
+	uint16_t biggest_port = EPHEMERAL_PORTS-1;
+	// Remember biggest ephemeral port number used so far and add 1
+	for (i = 0; i < MAX_SOCKETS; i++)
+		{
+		if ((sockets[i].socket_values.protocol == protocol) && (sockets[i].socket_values.local_address.sin6_port > biggest_port))
+			{
+			biggest_port = sockets[i].socket_values.local_address.sin6_port;
+			}
+		}
+	return biggest_port + 1;
+	}
+
+void set_socket_address(sockaddr6_t *sockaddr, uint8_t sin6_family, uint16_t sin6_port, uint32_t sin6_flowinfo, ipv6_addr_t *sin6_addr)
+	{
+	sockaddr->sin6_family 	= sin6_family;
+	sockaddr->sin6_port 	= sin6_port;
+	sockaddr->sin6_flowinfo	= sin6_flowinfo;
+	memcpy(&sockaddr->sin6_addr, sin6_addr, 16);
+	}
+
+void set_tcp_packet(tcp_hdr_t *tcp_hdr, uint16_t src_port, uint16_t dst_port, uint32_t seq_nr, uint32_t ack_nr,
+		uint8_t dataOffset_reserved, uint8_t reserved_flags, uint16_t window, uint16_t checksum, uint16_t urg_pointer)
+	{
+	tcp_hdr->ack_nr					= ack_nr;
+	tcp_hdr->checksum				= checksum;
+	tcp_hdr->dataOffset_reserved	= dataOffset_reserved;
+	tcp_hdr->dst_port				= dst_port;
+	tcp_hdr->reserved_flags			= reserved_flags;
+	tcp_hdr->seq_nr					= seq_nr;
+	tcp_hdr->src_port				= src_port;
+	tcp_hdr->urg_pointer			= urg_pointer;
+	tcp_hdr->window					= window;
+	}
+
+// Check for consistent ACK and SEQ number
+int check_tcp_consistency(socket_t *current_tcp_socket, tcp_hdr_t *tcp_header)
+	{
+	if (IS_TCP_ACK(tcp_header->reserved_flags))
+		{
+		if(tcp_header->ack_nr > (current_tcp_socket->tcp_control.send_nxt))
+			{
+			// ACK of not yet sent byte, discard
+			return ACK_NO_TOO_BIG;
+			}
+		else if (tcp_header->ack_nr <= (current_tcp_socket->tcp_control.send_una))
+			{
+			// ACK of previous segments, maybe dropped?
+			return ACK_NO_TOO_SMALL;
+			}
+		}
+	else if ((current_tcp_socket->tcp_control.rcv_nxt > 0) && (tcp_header->seq_nr < current_tcp_socket->tcp_control.rcv_nxt))
+		{
+		// segment repetition, maybe ACK got lost?
+		return SEQ_NO_TOO_SMALL;
+		}
+	return PACKET_OK;
+	}
+
+void switch_tcp_packet_byte_order(tcp_hdr_t *current_tcp_packet)
+	{
+	if (current_tcp_packet->dataOffset_reserved*4 > TCP_HDR_LEN)
+		{
+		if (*(((uint8_t*)current_tcp_packet)+TCP_HDR_LEN) == TCP_MSS_OPTION)
+			{
+			uint8_t *packet_pointer = (uint8_t *)current_tcp_packet;
+			packet_pointer += (TCP_HDR_LEN+2);
+			uint8_t mss1 = *packet_pointer;
+			uint8_t mss2 = *(packet_pointer+1);
+			*packet_pointer = mss2;
+			*(packet_pointer+1) = mss1;
+			}
+		if (*(((uint8_t*)current_tcp_packet)+TCP_HDR_LEN) == TCP_TS_OPTION)
+			{
+			// TODO: Timestamp option not implemented
+			}
+		}
+
+	current_tcp_packet->seq_nr = HTONL(current_tcp_packet->seq_nr);
+	current_tcp_packet->ack_nr = HTONL(current_tcp_packet->ack_nr);
+	current_tcp_packet->window = HTONS(current_tcp_packet->window);
+	current_tcp_packet->urg_pointer = HTONS(current_tcp_packet->urg_pointer);
+	}
+
+int send_tcp(socket_internal_t *current_socket, tcp_hdr_t *current_tcp_packet, ipv6_hdr_t *temp_ipv6_header, uint8_t flags, uint8_t payload_length)
+	{
+	socket_t *current_tcp_socket = &current_socket->socket_values;
+	uint8_t header_length = TCP_HDR_LEN/4;
+	if (IS_TCP_SYN(flags) || IS_TCP_SYN_ACK(flags))
+		{
+		tcp_mss_option_t current_mss_option;
+		header_length += sizeof(tcp_mss_option_t)/4;
+
+		current_mss_option.kind 	= TCP_MSS_OPTION;
+		current_mss_option.len 		= sizeof(tcp_mss_option_t);
+		current_mss_option.mss		= STATIC_MSS;
+		memcpy(((uint8_t*)current_tcp_packet)+TCP_HDR_LEN, &current_mss_option, sizeof(tcp_mss_option_t));
+		}
+
+	set_tcp_packet(current_tcp_packet, current_tcp_socket->local_address.sin6_port, current_tcp_socket->foreign_address.sin6_port,
+						(flags == TCP_ACK ? current_tcp_socket->tcp_control.send_una-1 : current_tcp_socket->tcp_control.send_una),
+						current_tcp_socket->tcp_control.rcv_nxt, header_length, flags, current_tcp_socket->tcp_control.rcv_wnd, 0, 0);
+
+	// Fill IPv6 Header
+	memcpy(&(temp_ipv6_header->destaddr), &current_tcp_socket->foreign_address.sin6_addr, 16);
+	memcpy(&(temp_ipv6_header->srcaddr), &current_tcp_socket->local_address.sin6_addr, 16);
+	temp_ipv6_header->length = header_length*4 + payload_length;
+
+	current_tcp_packet->checksum = ~tcp_csum(temp_ipv6_header, current_tcp_packet);
+
+#ifdef TCP_HC
+	uint16_t compressed_size;
+
+	compressed_size = compress_tcp_packet(current_socket, (uint8_t *) current_tcp_packet, temp_ipv6_header, flags, payload_length);
+
+	if (compressed_size == 0)
+		{
+		// Error in compressing tcp packet header
+		return -1;
+		}
+	sixlowpan_send(&current_tcp_socket->foreign_address.sin6_addr, (uint8_t*)(current_tcp_packet), compressed_size, IPPROTO_TCP);
+	return 1;
+#else
+//	print_tcp_status(OUT_PACKET, temp_ipv6_header, current_tcp_packet, current_tcp_socket);
+	switch_tcp_packet_byte_order(current_tcp_packet);
+	sixlowpan_send(&current_tcp_socket->foreign_address.sin6_addr, (uint8_t*)(current_tcp_packet), header_length*4+payload_length, IPPROTO_TCP);
+	return 1;
+#endif
+	}
+
+void set_tcp_cb(tcp_cb_t *tcp_control, uint32_t rcv_nxt, uint16_t rcv_wnd, uint32_t send_nxt, uint32_t send_una, uint16_t send_wnd)
+	{
+	tcp_control->rcv_nxt = rcv_nxt;
+	tcp_control->rcv_wnd = rcv_wnd;
+	tcp_control->send_nxt = send_nxt;
+	tcp_control->send_una = send_una;
+	tcp_control->send_wnd = send_wnd;
+	}
+
+int connect(int socket, sockaddr6_t *addr, uint32_t addrlen)
+	{
+	// Variables
+	ipv6_addr_t src_addr;
+	socket_internal_t *current_int_tcp_socket;
+	socket_t *current_tcp_socket;
+	msg_t msg_from_server;
+	uint8_t send_buffer[BUFFER_SIZE];
+	ipv6_hdr_t *temp_ipv6_header = ((ipv6_hdr_t*)(&send_buffer));
+	tcp_hdr_t *current_tcp_packet = ((tcp_hdr_t*)(&send_buffer[IPV6_HDR_LEN]));
+
+	// Check if socket exists
+	current_int_tcp_socket = getSocket(socket);
+	if (current_int_tcp_socket == NULL)
+		{
+		return -1;
+		}
+
+	current_tcp_socket = &current_int_tcp_socket->socket_values;
+
+	current_int_tcp_socket->recv_pid = thread_getpid();
+
+	// Local address information
+	ipv6_get_saddr(&src_addr, &addr->sin6_addr);
+	set_socket_address(&current_tcp_socket->local_address, PF_INET6, HTONS(get_free_source_port(IPPROTO_TCP)), 0, &src_addr);
+
+	// Foreign address information
+	set_socket_address(&current_tcp_socket->foreign_address, addr->sin6_family, addr->sin6_port, addr->sin6_flowinfo, &addr->sin6_addr);
+
+	// Fill lcoal TCP socket information
+	srand(addr->sin6_port);
+
+	current_tcp_socket->tcp_control.rcv_irs 	= 0;
+	mutex_lock(&global_sequence_clunter_mutex);
+	current_tcp_socket->tcp_control.send_iss 	= global_sequence_counter;
+	mutex_unlock(&global_sequence_clunter_mutex, 0);
+	current_tcp_socket->tcp_control.state 		= SYN_SENT;
+
+#ifdef TCP_HC
+	// Choosing random number Context ID
+	mutex_lock(&global_context_counter_mutex);
+	current_tcp_socket->tcp_control.tcp_context.context_id = global_context_counter;
+	mutex_unlock(&global_context_counter_mutex, 0);
+
+	current_tcp_socket->tcp_control.tcp_context.hc_type = FULL_HEADER;
+
+	// Remember TCP Context for possible TCP_RETRY
+	tcp_hc_context_t saved_tcp_context;
+	memcpy(&saved_tcp_context, &current_tcp_socket->tcp_control.tcp_context, sizeof(tcp_hc_context_t));
+#endif
+
+	set_tcp_cb(&current_tcp_socket->tcp_control, 0, STATIC_WINDOW, current_tcp_socket->tcp_control.send_iss, current_tcp_socket->tcp_control.send_iss, 0);
+
+	// Remember current time
+	current_tcp_socket->tcp_control.last_packet_time = vtimer_now();
+	current_tcp_socket->tcp_control.no_of_retries = 0;
+
+	msg_from_server.type = TCP_RETRY;
+
+	while (msg_from_server.type == TCP_RETRY)
+		{
+		// Send packet
+		send_tcp(current_int_tcp_socket, current_tcp_packet, temp_ipv6_header, TCP_SYN, 0);
+
+		// wait for SYN ACK or RETRY
+		msg_receive(&msg_from_server);
+		if (msg_from_server.type == TCP_TIMEOUT)
+			{
+#ifdef TCP_HC
+			// We did not send anything successful so restore last context
+			memcpy(&current_tcp_socket->tcp_control.tcp_context, &saved_tcp_context, sizeof(tcp_hc_context_t));
+#endif
+			return -1;
+			}
+#ifdef TCP_HC
+		else if (msg_from_server.type == TCP_RETRY)
+			{
+			// We retry sending a packet so set everything to last values again
+			memcpy(&current_tcp_socket->tcp_control.tcp_context, &saved_tcp_context, sizeof(tcp_hc_context_t));
+			}
+#endif
+		}
+
+	// Read packet content
+	tcp_hdr_t *tcp_header = ((tcp_hdr_t*)(msg_from_server.content.ptr));
+
+	// Check for consistency
+	if (tcp_header->ack_nr != current_tcp_socket->tcp_control.send_nxt+1)
+		{
+		printf("TCP packets not consistent!\n");
+		}
+
+	// Got SYN ACK from Server
+	// Refresh foreign TCP socket information
+	if ((tcp_header->dataOffset_reserved*4 > TCP_HDR_LEN) && (*(((uint8_t*)tcp_header)+TCP_HDR_LEN) == TCP_MSS_OPTION))
+		{
+		current_tcp_socket->tcp_control.mss = *((uint16_t*)(((uint8_t*)tcp_header)+TCP_HDR_LEN+2));
+		}
+	else
+		{
+		current_tcp_socket->tcp_control.mss = STATIC_MSS;
+		}
+	current_tcp_socket->tcp_control.rcv_irs = tcp_header->seq_nr;
+	set_tcp_cb(&current_tcp_socket->tcp_control, tcp_header->seq_nr+1, current_tcp_socket->tcp_control.rcv_wnd,
+			current_tcp_socket->tcp_control.send_una, current_tcp_socket->tcp_control.send_una, tcp_header->window);
+	current_tcp_socket->tcp_control.send_una++;
+	current_tcp_socket->tcp_control.send_nxt++;
+
+	msg_from_server.type = UNDEFINED;
+
+	// Remember current time
+	current_tcp_socket->tcp_control.last_packet_time = vtimer_now();
+	current_tcp_socket->tcp_control.no_of_retries = 0;
+
+#ifdef TCP_HC
+	current_tcp_socket->tcp_control.tcp_context.hc_type = FULL_HEADER;
+	// Remember TCP Context for possible TCP_RETRY
+	memcpy(&saved_tcp_context, &current_tcp_socket->tcp_control.tcp_context, sizeof(tcp_hc_context_t));
+#endif
+
+	while (msg_from_server.type != TCP_RETRY)
+		{
+		// Send packet
+		send_tcp(current_int_tcp_socket, current_tcp_packet, temp_ipv6_header, TCP_ACK, 0);
+
+		msg_receive(&msg_from_server);
+#ifdef TCP_HC
+		if (msg_from_server.type == TCP_SYN_ACK)
+			{
+			// TCP_SYN_ACK from server arrived again, copy old context and send TCP_ACK again
+			memcpy(&current_tcp_socket->tcp_control.tcp_context, &saved_tcp_context, sizeof(tcp_hc_context_t));
+			}
+		else if (msg_from_server.type == TCP_RETRY)
+			{
+			// We waited for RTT, no TCP_SYN_ACK received, so we assume the TCP_ACK packet arrived safely
+			}
+#endif
+		}
+
+	current_tcp_socket->tcp_control.state = ESTABLISHED;
+
+	current_int_tcp_socket->recv_pid = 255;
+
+	print_sockets();
+	return 0;
+	}
+
+void calculate_rto(tcp_cb_t *tcp_control, long current_time)
+	{
+	double rtt = current_time - tcp_control->last_packet_time.microseconds;
+	double srtt = tcp_control->srtt;
+	double rttvar = tcp_control->rttvar;
+	double rto = tcp_control->rto;
+
+	if ((srtt == 0) && (rttvar == 0) && (rto == TCP_INITIAL_ACK_TIMEOUT))
+		{
+		// First calculation
+		srtt = rtt;
+		rttvar = 0.5*rtt;
+		rto = rtt + (((4*rttvar) < TCP_TIMER_RESOLUTION) ? (TCP_TIMER_RESOLUTION) : (4*rttvar));
+		}
+	else
+		{
+		// every other calculation
+		srtt = (1-TCP_ALPHA)*srtt+TCP_ALPHA*rtt;
+		rttvar = (1-TCP_BETA)*rttvar+TCP_BETA*abs(srtt-rtt);
+		rto = srtt + (((4*rttvar) < TCP_TIMER_RESOLUTION) ? (TCP_TIMER_RESOLUTION) : (4*rttvar));
+		}
+	if (rto < SECOND)
+		{
+		rto = SECOND;
+		}
+	tcp_control->srtt = srtt;
+	tcp_control->rttvar = rttvar;
+	tcp_control->rto = rto;
+	}
+
+int32_t send(int s, void *msg, uint32_t len, int flags)
+	{
+	// Variables
+	msg_t recv_msg;
+	int32_t sent_bytes = 0, total_sent_bytes = 0;
+	socket_internal_t *current_int_tcp_socket;
+	socket_t *current_tcp_socket;
+	uint8_t send_buffer[BUFFER_SIZE];
+	memset(send_buffer, 0, BUFFER_SIZE);
+	ipv6_hdr_t *temp_ipv6_header = ((ipv6_hdr_t*)(&send_buffer));
+	tcp_hdr_t *current_tcp_packet = ((tcp_hdr_t*)(&send_buffer[IPV6_HDR_LEN]));
+
+
+	// Check if socket exists and is TCP socket
+	if (!isTCPSocket(s))
+		{
+		return -1;
+		}
+
+	current_int_tcp_socket = getSocket(s);
+	current_tcp_socket = &current_int_tcp_socket->socket_values;
+
+	// Check for ESTABLISHED STATE
+	if (current_tcp_socket->tcp_control.state != ESTABLISHED)
+		{
+		return -1;
+		}
+
+	// Add thread PID
+	current_int_tcp_socket->send_pid = thread_getpid();
+
+	recv_msg.type = UNDEFINED;
+
+	while (1)
+		{
+		current_tcp_socket->tcp_control.no_of_retries = 0;
+
+#ifdef TCP_HC
+		current_tcp_socket->tcp_control.tcp_context.hc_type = COMPRESSED_HEADER;
+		// Remember TCP Context for possible TCP_RETRY
+		tcp_hc_context_t saved_tcp_context;
+		memcpy(&saved_tcp_context, &current_tcp_socket->tcp_control.tcp_context, sizeof(tcp_hc_context_t)-1);
+#endif
+
+		while (recv_msg.type != TCP_ACK)
+			{
+			// Add packet data
+			if (current_tcp_socket->tcp_control.send_wnd > current_tcp_socket->tcp_control.mss)
+				{
+				// Window size > Maximum Segment Size
+				if ((len-total_sent_bytes) > current_tcp_socket->tcp_control.mss)
+					{
+					memcpy(&send_buffer[IPV6_HDR_LEN+TCP_HDR_LEN], msg, current_tcp_socket->tcp_control.mss);
+					sent_bytes = current_tcp_socket->tcp_control.mss;
+					total_sent_bytes += sent_bytes;
+					}
+				else
+					{
+					memcpy(&send_buffer[IPV6_HDR_LEN+TCP_HDR_LEN], msg+total_sent_bytes, len-total_sent_bytes);
+					sent_bytes = len-total_sent_bytes;
+					total_sent_bytes = len;
+					}
+				}
+			else
+				{
+				// Window size <= Maximum Segment Size
+				if ((len-total_sent_bytes) > current_tcp_socket->tcp_control.send_wnd)
+					{
+					memcpy(&send_buffer[IPV6_HDR_LEN+TCP_HDR_LEN], msg, current_tcp_socket->tcp_control.send_wnd);
+					sent_bytes = current_tcp_socket->tcp_control.send_wnd;
+					total_sent_bytes += sent_bytes;
+					}
+				else
+					{
+					memcpy(&send_buffer[IPV6_HDR_LEN+TCP_HDR_LEN], msg+total_sent_bytes, len-total_sent_bytes);
+					sent_bytes = len-total_sent_bytes;
+					total_sent_bytes = len;
+					}
+				}
+
+			current_tcp_socket->tcp_control.send_nxt += sent_bytes;
+			current_tcp_socket->tcp_control.send_wnd -= sent_bytes;
+
+			if (send_tcp(current_int_tcp_socket, current_tcp_packet, temp_ipv6_header, 0, sent_bytes) != 1)
+				{
+				// Error while sending tcp data
+				current_tcp_socket->tcp_control.send_nxt -= sent_bytes;
+				current_tcp_socket->tcp_control.send_wnd += sent_bytes;
+#ifdef TCP_HC
+				memcpy(&current_tcp_socket->tcp_control.tcp_context, &saved_tcp_context, sizeof(tcp_hc_context_t));
+				current_tcp_socket->tcp_control.tcp_context.hc_type = COMPRESSED_HEADER;
+#endif
+				printf("Error while sending, returning to application thread!\n");
+				return -1;
+				}
+
+			// Remember current time
+			current_tcp_socket->tcp_control.last_packet_time.microseconds = hwtimer_now();
+			net_msg_receive(&recv_msg);
+			switch (recv_msg.type)
+				{
+				case TCP_ACK:
+					{
+					if (current_tcp_socket->tcp_control.no_of_retries == 0)
+						{
+						calculate_rto(&current_tcp_socket->tcp_control, hwtimer_now());
+						}
+					tcp_hdr_t *tcp_header = ((tcp_hdr_t*)(recv_msg.content.ptr));
+					if ((current_tcp_socket->tcp_control.send_nxt == tcp_header->ack_nr) && (total_sent_bytes == len))
+						{
+						current_tcp_socket->tcp_control.send_una = tcp_header->ack_nr;
+						current_tcp_socket->tcp_control.send_nxt = tcp_header->ack_nr;
+						current_tcp_socket->tcp_control.send_wnd = tcp_header->window;
+						// Got ACK for every sent byte
+#ifdef TCP_HC
+						current_tcp_socket->tcp_control.tcp_context.hc_type = COMPRESSED_HEADER;
+#endif
+						return sent_bytes;
+						}
+					else if ((current_tcp_socket->tcp_control.send_nxt == tcp_header->ack_nr) && (total_sent_bytes != len))
+						{
+						current_tcp_socket->tcp_control.send_una = tcp_header->ack_nr;
+						current_tcp_socket->tcp_control.send_nxt = tcp_header->ack_nr;
+						current_tcp_socket->tcp_control.send_wnd = tcp_header->window;
+						// Got ACK for every sent byte
+#ifdef TCP_HC
+						current_tcp_socket->tcp_control.tcp_context.hc_type = COMPRESSED_HEADER;
+#endif
+						break;
+						}
+//					else
+//						{
+//						// TODO: If window size > MSS, ACK was valid only for a few segments, handle retransmit of missing segments
+//						break;
+//						}
+					break;
+					}
+				case TCP_RETRY:
+					{
+					current_tcp_socket->tcp_control.send_nxt -= sent_bytes;
+					current_tcp_socket->tcp_control.send_wnd += sent_bytes;
+					total_sent_bytes -= sent_bytes;
+#ifdef TCP_HC
+					memcpy(&current_tcp_socket->tcp_control.tcp_context, &saved_tcp_context, sizeof(tcp_hc_context_t));
+					current_tcp_socket->tcp_control.tcp_context.hc_type = MOSTLY_COMPRESSED_HEADER;
+#endif
+					break;
+					}
+				case TCP_TIMEOUT:
+					{
+					current_tcp_socket->tcp_control.send_nxt -= sent_bytes;
+					current_tcp_socket->tcp_control.send_wnd += sent_bytes;
+#ifdef TCP_HC
+					memcpy(&current_tcp_socket->tcp_control.tcp_context, &saved_tcp_context, sizeof(tcp_hc_context_t));
+					current_tcp_socket->tcp_control.tcp_context.hc_type = COMPRESSED_HEADER;
+#endif
+					return -1;
+					break;
+					}
+				}
+			}
+		}
+	return sent_bytes;
+	}
+
+uint8_t read_from_socket(socket_internal_t *current_int_tcp_socket, void *buf, int len)
+	{
+	if (len >= current_int_tcp_socket->tcp_input_buffer_end)
+		{
+		mutex_lock(&current_int_tcp_socket->tcp_buffer_mutex);
+		uint8_t read_bytes = current_int_tcp_socket->tcp_input_buffer_end;
+		memcpy(buf, current_int_tcp_socket->tcp_input_buffer, current_int_tcp_socket->tcp_input_buffer_end);
+		current_int_tcp_socket->tcp_input_buffer_end = 0;
+		current_int_tcp_socket->socket_values.tcp_control.rcv_wnd += read_bytes;
+		mutex_unlock(&current_int_tcp_socket->tcp_buffer_mutex, 0);
+		return read_bytes;
+		}
+	else
+		{
+		mutex_lock(&current_int_tcp_socket->tcp_buffer_mutex);
+		memcpy(buf, current_int_tcp_socket->tcp_input_buffer, len);
+		memmove(current_int_tcp_socket->tcp_input_buffer, (current_int_tcp_socket->tcp_input_buffer+len), current_int_tcp_socket->tcp_input_buffer_end-len);
+		current_int_tcp_socket->tcp_input_buffer_end = current_int_tcp_socket->tcp_input_buffer_end-len;
+		current_int_tcp_socket->socket_values.tcp_control.rcv_wnd += len;
+		mutex_unlock(&current_int_tcp_socket->tcp_buffer_mutex, 0);
+		return len;
+		}
+	}
+
+int recv(int s, void *buf, uint32_t len, int flags)
+	{
+	// Variables
+	uint8_t read_bytes;
+	msg_t m_recv, m_send;
+	socket_internal_t *current_int_tcp_socket;
+	// Check if socket exists
+	if (!isTCPSocket(s))
+		{
+		printf("INFO: NO TCP SOCKET!\n");
+		return -1;
+		}
+
+	current_int_tcp_socket = getSocket(s);
+
+	// Setting Thread PID
+	current_int_tcp_socket->recv_pid = thread_getpid();
+	if (current_int_tcp_socket->tcp_input_buffer_end > 0)
+		{
+		return read_from_socket(current_int_tcp_socket, buf, len);
+		}
+	msg_receive(&m_recv);
+	if ((exists_socket(s)) && (current_int_tcp_socket->tcp_input_buffer_end > 0))
+		{
+		read_bytes = read_from_socket(current_int_tcp_socket, buf, len);
+		net_msg_reply(&m_recv, &m_send, UNDEFINED);
+		return read_bytes;
+		}
+
+	// Received FIN
+	if (m_recv.type == CLOSE_CONN)
+		{
+		// Sent FIN_ACK, wait for ACK
+		msg_receive(&m_recv);
+		// Received ACK, return with closed socket!
+		return -1;
+		}
+	// Received Last ACK (connection closed) or no data to read yet
+	return -1;
+	}
+
+int32_t recvfrom(int s, void *buf, uint32_t len, int flags, sockaddr6_t *from, uint32_t *fromlen)
+	{
+	if (isUDPSocket(s))
+		{
+		msg_t m_recv, m_send;
+		ipv6_hdr_t *ipv6_header;
+		udp_hdr_t *udp_header;
+		uint8_t *payload;
+		getSocket(s)->recv_pid = thread_getpid();
+
+		msg_receive(&m_recv);
+
+		ipv6_header = ((ipv6_hdr_t*)m_recv.content.ptr);
+		udp_header = ((udp_hdr_t*)(m_recv.content.ptr + IPV6_HDR_LEN));
+		payload = (uint8_t*)(m_recv.content.ptr + IPV6_HDR_LEN+UDP_HDR_LEN);
+
+		memset(buf, 0, len);
+		memcpy(buf, payload, udp_header->length-UDP_HDR_LEN);
+		memcpy(&from->sin6_addr, &ipv6_header->srcaddr, 16);
+		from->sin6_family = AF_INET6;
+		from->sin6_flowinfo = 0;
+		from->sin6_port = udp_header->src_port;
+		*fromlen = sizeof(sockaddr6_t);
+
+		msg_reply(&m_recv, &m_send);
+		return udp_header->length-UDP_HDR_LEN;
+		}
+	else if (isTCPSocket(s))
+		{
+		return recv(s, buf, len, flags);
+		}
+	else
+		{
+		printf("Socket Type not supported!\n");
+		return -1;
+		}
+	}
+
+int32_t sendto(int s, const void *msg, uint32_t len, int flags, sockaddr6_t *to, uint32_t tolen)
+	{
+	if (isUDPSocket(s) && (getSocket(s)->socket_values.foreign_address.sin6_port == 0))
+		{
+		uint8_t send_buffer[BUFFER_SIZE];
+
+		ipv6_hdr_t *temp_ipv6_header = ((ipv6_hdr_t*)(&send_buffer));
+		udp_hdr_t *current_udp_packet = ((udp_hdr_t*)(&send_buffer[IPV6_HDR_LEN]));
+		uint8_t *payload = &send_buffer[IPV6_HDR_LEN+UDP_HDR_LEN];
+
+		memcpy(&(temp_ipv6_header->destaddr), &to->sin6_addr, 16);
+		ipv6_get_saddr(&(temp_ipv6_header->srcaddr), &(temp_ipv6_header->destaddr));
+
+		current_udp_packet->src_port = get_free_source_port(IPPROTO_UDP);
+		current_udp_packet->dst_port = to->sin6_port;
+		current_udp_packet->checksum = 0;
+
+		memcpy(payload, msg, len);
+		current_udp_packet->length = UDP_HDR_LEN + len;
+		temp_ipv6_header->length = UDP_HDR_LEN + len;
+
+		current_udp_packet->checksum = ~udp_csum(temp_ipv6_header, current_udp_packet);
+
+		sixlowpan_send(&to->sin6_addr, (uint8_t*)(current_udp_packet), current_udp_packet->length, IPPROTO_UDP);
+		return current_udp_packet->length;
+		}
+	else
+		{
+		return -1;
+		}
+	}
+
+int close(int s)
+	{
+	socket_internal_t *current_socket = getSocket(s);
+	if (current_socket != NULL)
+		{
+		if (isTCPSocket(s))
+			{
+			// Variables
+			msg_t m_recv;
+			uint8_t send_buffer[BUFFER_SIZE];
+			ipv6_hdr_t *temp_ipv6_header = ((ipv6_hdr_t*)(&send_buffer));
+			tcp_hdr_t *current_tcp_packet = ((tcp_hdr_t*)(&send_buffer[IPV6_HDR_LEN]));
+
+			// Check if socket exists and is TCP socket
+			if (!isTCPSocket(s))
+				{
+				return -1;
+				}
+
+			// Check for ESTABLISHED STATE
+			if (current_socket->socket_values.tcp_control.state != ESTABLISHED)
+				{
+				close_socket(current_socket);
+				return 1;
+				}
+
+			current_socket->send_pid = thread_getpid();
+
+			// Refresh local TCP socket information
+			current_socket->socket_values.tcp_control.send_una++;
+			current_socket->socket_values.tcp_control.state = FIN_WAIT_1;
+#ifdef TCP_HC
+			current_socket->socket_values.tcp_control.tcp_context.hc_type = COMPRESSED_HEADER;
+#endif
+
+			send_tcp(current_socket, current_tcp_packet, temp_ipv6_header, TCP_FIN, 0);
+			msg_receive(&m_recv);
+			close_socket(current_socket);
+			return 1;
+			}
+		else if(isUDPSocket(s))
+			{
+			close_socket(current_socket);
+			return 1;
+			}
+		return -1;
+		}
+	else
+		{
+		return -1;
+		}
+	}
+
+int bind(int s, sockaddr6_t *name, int namelen)
+	{
+	if (exists_socket(s))
+		{
+		socket_t *current_socket = &getSocket(s)->socket_values;
+		switch (current_socket->domain)
+			{
+			case (PF_INET):
+				{
+				// Not provided
+				return -1;
+				break;
+				}
+			case (PF_INET6):
+				{
+				switch (current_socket->type)
+					{
+					// TCP
+					case (SOCK_STREAM):
+						{
+						if ((current_socket->protocol == 0) || (current_socket->protocol == IPPROTO_TCP))
+							{
+							return bind_tcp_socket(s, name, namelen, thread_getpid());
+							break;
+							}
+						else
+							{
+							return -1;
+							break;
+							}
+						break;
+						}
+					// UDP
+					case (SOCK_DGRAM):
+						{
+						if ((current_socket->protocol == 0) || (current_socket->protocol == IPPROTO_UDP))
+							{
+							return bind_udp_socket(s, name, namelen, thread_getpid());
+							break;
+							}
+						else
+							{
+							return -1;
+							break;
+							}
+						break;
+						}
+					case (SOCK_SEQPACKET):
+						{
+						// not provided
+						return -1;
+						break;
+						}
+					case (SOCK_RAW):
+						{
+						// not provided
+						return -1;
+						break;
+						}
+					default:
+						{
+						return -1;
+						break;
+						}
+					}
+				break;
+				}
+			case (PF_UNIX):
+				{
+				// Not provided
+				return -1;
+				break;
+				}
+			}
+		}
+	else
+		{
+		printf("SOCKET DOES NOT EXIST!\n");
+		return -1;
+		}
+	return -1;
+	}
+
+int listen(int s, int backlog)
+	{
+	if (isTCPSocket(s) && getSocket(s)->socket_values.tcp_control.state == CLOSED)
+		{
+		socket_internal_t *current_socket = getSocket(s);
+		current_socket->socket_values.tcp_control.state = LISTEN;
+		return 0;
+		}
+	else
+		{
+		return -1;
+		}
+	}
+
+socket_internal_t *getWaitingConnectionSocket(int socket, ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header)
+	{
+	int i;
+	socket_internal_t *current_socket, *listening_socket = getSocket(socket);
+	for (i = 1; i < MAX_SOCKETS+1; i++)
+		{
+		current_socket = getSocket(i);
+		// Connection establishment ACK, Check for 4 touple and state
+		if ((ipv6_header != NULL) && (tcp_header != NULL))
+			{
+			if (is_four_touple(current_socket, ipv6_header, tcp_header) && (current_socket->socket_values.tcp_control.state == SYN_RCVD))
+				{
+				return current_socket;
+				}
+			}
+		// Connection establishment SYN ACK, check only for port and state
+		else
+			{
+			if ((current_socket->socket_values.tcp_control.state == SYN_RCVD) &&
+				(current_socket->socket_values.local_address.sin6_port == listening_socket->socket_values.local_address.sin6_port))
+				{
+				return current_socket;
+				}
+			}
+		}
+	return NULL;
+	}
+
+int handle_new_tcp_connection(socket_internal_t *current_queued_int_socket, socket_internal_t *server_socket, uint8_t pid)
+	{
+	msg_t msg_recv_client_ack, msg_send_client_ack;
+	socket_t *current_queued_socket = &current_queued_int_socket->socket_values;
+	uint8_t send_buffer[BUFFER_SIZE];
+	ipv6_hdr_t *temp_ipv6_header = ((ipv6_hdr_t*)(&send_buffer));
+	tcp_hdr_t *syn_ack_packet = ((tcp_hdr_t*)(&send_buffer[IPV6_HDR_LEN]));
+
+	current_queued_int_socket->recv_pid = thread_getpid();
+#ifdef TCP_HC
+	current_queued_int_socket->socket_values.tcp_control.tcp_context.hc_type = FULL_HEADER;
+	memcpy(&current_queued_int_socket->socket_values.tcp_control.tcp_context.context_id,
+			&server_socket->socket_values.tcp_control.tcp_context.context_id, sizeof(server_socket->socket_values.tcp_control.tcp_context.context_id));
+#endif
+	// Remember current time
+	current_queued_int_socket->socket_values.tcp_control.last_packet_time = vtimer_now();
+
+	current_queued_int_socket->socket_values.tcp_control.no_of_retries = 0;
+
+	// Set message type to Retry for while loop
+	msg_recv_client_ack.type = TCP_RETRY;
+
+	while (msg_recv_client_ack.type == TCP_RETRY)
+		{
+		// Send packet
+		send_tcp(current_queued_int_socket, syn_ack_packet, temp_ipv6_header, TCP_SYN_ACK, 0);
+
+		// wait for ACK from Client
+		msg_receive(&msg_recv_client_ack);
+		if (msg_recv_client_ack.type == TCP_TIMEOUT)
+			{
+			// Set status of internal socket back to LISTEN
+			server_socket->socket_values.tcp_control.state = LISTEN;
+
+			close_socket(current_queued_int_socket);
+			return -1;
+			}
+		}
+
+	tcp_hdr_t *tcp_header;
+
+	tcp_header = ((tcp_hdr_t*)(msg_recv_client_ack.content.ptr));
+
+	// Check for consistency
+	if (tcp_header->ack_nr != current_queued_socket->tcp_control.send_nxt+1)
+		{
+		printf("TCP packets not consistent!\n");
+		}
+
+	// Got ack, connection established, refresh local and foreign tcp socket status
+	set_tcp_cb(&current_queued_socket->tcp_control, tcp_header->seq_nr+1, current_queued_socket->tcp_control.rcv_wnd, tcp_header->ack_nr,
+			tcp_header->ack_nr, tcp_header->window);
+
+#ifdef TCP_HC
+	// Copy TCP context information into new socket
+	memset(&server_socket->socket_values.tcp_control.tcp_context, 0, sizeof(tcp_hc_context_t));
+#endif
+
+	// Update connection status information
+	current_queued_socket->tcp_control.state = ESTABLISHED;
+
+	// Set status of internal socket back to LISTEN
+	server_socket->socket_values.tcp_control.state = LISTEN;
+
+	// send a reply to the TCP handler after processing every information from the TCP ACK packet
+	msg_reply(&msg_recv_client_ack, &msg_send_client_ack);
+
+	// Reset PID to an unlikely value
+	current_queued_int_socket->recv_pid = 255;
+
+	// Waiting for Clients ACK waiting period to time out
+	vtimer_usleep(TCP_SYN_INITIAL_TIMEOUT/2);
+
+	print_sockets();
+
+	return current_queued_int_socket->socket_id;
+	}
+
+int accept(int s, sockaddr6_t *addr, uint32_t *addrlen)
+	{
+	socket_internal_t *server_socket = getSocket(s);
+	if (isTCPSocket(s) && (server_socket->socket_values.tcp_control.state == LISTEN))
+		{
+		socket_internal_t *current_queued_socket = getWaitingConnectionSocket(s, NULL, NULL);
+		if (current_queued_socket != NULL)
+			{
+			return handle_new_tcp_connection(current_queued_socket, server_socket, thread_getpid());
+			}
+		else
+			{
+			// No waiting connections, waiting for message from TCP Layer
+			msg_t msg_recv_client_syn;
+			msg_recv_client_syn.type = UNDEFINED;
+			while (msg_recv_client_syn.type != TCP_SYN)
+				{
+				msg_receive(&msg_recv_client_syn);
+				}
+
+			current_queued_socket = getWaitingConnectionSocket(s, NULL, NULL);
+
+			return handle_new_tcp_connection(current_queued_socket, server_socket, thread_getpid());
+			}
+		}
+	else
+		{
+		return -1;
+		}
+	}
+
+socket_internal_t *new_tcp_queued_socket(ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header)
+	{
+	int queued_socket_id;
+
+	queued_socket_id = socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP);
+	socket_internal_t *current_queued_socket = getSocket(queued_socket_id);
+
+	// Foreign address
+	set_socket_address(&current_queued_socket->socket_values.foreign_address, AF_INET6, tcp_header->src_port, ipv6_header->flowlabel, &ipv6_header->srcaddr);
+
+	// Local address
+	set_socket_address(&current_queued_socket->socket_values.local_address, AF_INET6, tcp_header->dst_port, 0, &ipv6_header->destaddr);
+
+	// Foreign TCP information
+	if ((tcp_header->dataOffset_reserved*4 > TCP_HDR_LEN) && (*(((uint8_t*)tcp_header)+TCP_HDR_LEN) == TCP_MSS_OPTION))
+		{
+		current_queued_socket->socket_values.tcp_control.mss = *((uint16_t*)(((uint8_t*)tcp_header)+TCP_HDR_LEN+2));
+		}
+	else
+		{
+		current_queued_socket->socket_values.tcp_control.mss = STATIC_MSS;
+		}
+	current_queued_socket->socket_values.tcp_control.rcv_irs 	= tcp_header->seq_nr;
+	mutex_lock(&global_sequence_clunter_mutex);
+	current_queued_socket->socket_values.tcp_control.send_iss 	= global_sequence_counter;
+	mutex_unlock(&global_sequence_clunter_mutex, 0);
+	current_queued_socket->socket_values.tcp_control.state 		= SYN_RCVD;
+	set_tcp_cb(&current_queued_socket->socket_values.tcp_control, tcp_header->seq_nr+1, STATIC_WINDOW,
+			current_queued_socket->socket_values.tcp_control.send_iss,
+			current_queued_socket->socket_values.tcp_control.send_iss, tcp_header->window);
+
+	return current_queued_socket;
+	}
diff --git a/sys/net/destiny/socket.h b/sys/net/destiny/socket.h
index d43afcb8c292be27371d4c1d74e05f16bcfbb5e2..7737ae414ece7481327ff84413cb3d87b4100f6d 100644
--- a/sys/net/destiny/socket.h
+++ b/sys/net/destiny/socket.h
@@ -194,13 +194,13 @@ int connect(int socket, sockaddr6_t *addr, uint32_t addrlen);
 socket_internal_t *getWaitingConnectionSocket(int socket, ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header);
 void close_socket(socket_internal_t *current_socket);
 int32_t recvfrom( int s, void *buf, uint32_t len, int flags, sockaddr6_t *from, uint32_t *fromlen );
-int32_t sendto( int s, void *msg, uint32_t len, int flags, sockaddr6_t *to, uint32_t tolen);
+int32_t sendto( int s, const void *msg, uint32_t len, int flags, sockaddr6_t *to, uint32_t tolen);
 int32_t send(int s, void *msg, uint32_t len, int flags);
 int recv(int s, void *buf, uint32_t len, int flags);
 int close(int s);
 int bind(int s, sockaddr6_t *name, int namelen);
 int listen(int s, int backlog);
-int accept(int s, sockaddr6_t *addr, uint32_t addrlen);
+int accept(int s, sockaddr6_t *addr, uint32_t *addrlen);
 void socket_init(void);
 socket_internal_t *get_udp_socket(ipv6_hdr_t *ipv6_header, udp_hdr_t *udp_header);
 socket_internal_t *get_tcp_socket(ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header);
diff --git a/sys/net/mm/makefile b/sys/net/mm/Makefile
similarity index 81%
rename from sys/net/mm/makefile
rename to sys/net/mm/Makefile
index 616321f4c3877dadda9bc0f9100e5ba82ef52c4d..e8e3b660736deac083bb3c080dcb44aa6f3a566f 100644
--- a/sys/net/mm/makefile
+++ b/sys/net/mm/Makefile
@@ -2,5 +2,5 @@ INCLUDES = -I.. -I../../include -I../../drivers/include -I../../../core/include
 
 MODULE =net_mm
 
-include $(MAKEBASE)/makefile.base	
+include $(MAKEBASE)/Makefile.base	
 
diff --git a/sys/net/mm/mmr.c b/sys/net/mm/mmr.c
index a1bf646b521d8ab4832403e624dfff153af37b5b..1bf3ae2f9243e8b2289ef5432e1cd5dbd6f3688e 100644
--- a/sys/net/mm/mmr.c
+++ b/sys/net/mm/mmr.c
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -29,7 +29,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief		Micro Mesh Routing
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @version     $Revision: 3854 $
  *
diff --git a/sys/net/mm/mmr.h b/sys/net/mm/mmr.h
index faff3572c87eec311662fe615a22ec5da9364906..e58d31edbdee354b0a3fdaf6169c7c51284c8e01 100644
--- a/sys/net/mm/mmr.h
+++ b/sys/net/mm/mmr.h
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -32,7 +32,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief		Micro Mesh Routing
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @version     $Revision: 3854 $
  *
diff --git a/sys/net/mm/mmstack.c b/sys/net/mm/mmstack.c
index 56fdb4d3d2b2f9f772c7002cdc398de34777cb2f..83a41b44e759a526837ad1e8c67b6b2f846e9aec 100644
--- a/sys/net/mm/mmstack.c
+++ b/sys/net/mm/mmstack.c
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -45,7 +45,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author 		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @version     $Revision: 3854 $
  *
diff --git a/sys/net/mm/mmstack.h b/sys/net/mm/mmstack.h
index e07fa4f38f20746d034e0e5ebd57cd0efbf2e4b4..22ce8790e31797ce6196844e33f4656886e0fd81 100644
--- a/sys/net/mm/mmstack.h
+++ b/sys/net/mm/mmstack.h
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -38,7 +38,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author 		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @version     $Revision: 3854 $
  *
diff --git a/sys/net/protocol-multiplex.c b/sys/net/protocol-multiplex.c
index 7f3857b4ef910e0854fa248058359f0496bb1fb9..d5ac1894fa61de4de98efc287a32e06b060842ea 100644
--- a/sys/net/protocol-multiplex.c
+++ b/sys/net/protocol-multiplex.c
@@ -4,14 +4,14 @@ Copyright 2009-2010, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -34,7 +34,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief		Protocol handler multiplexing
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @author		Michael Baar <baar@inf.fu-berlin.de>
diff --git a/sys/net/protocol-multiplex.h b/sys/net/protocol-multiplex.h
index d48bdefc1867ffaeac611ef700b227df76eb5c01..b324aede5b2e4b18fcc039f6f849d7ab6ed316e6 100644
--- a/sys/net/protocol-multiplex.h
+++ b/sys/net/protocol-multiplex.h
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -37,7 +37,7 @@ and the mailinglist (subscription via web site)
  * @internal
  * @brief		Protocol handler multiplexing
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
  * @author		Heiko Will <hwill@inf.fu-berlin.de>
  * @author		Michael Baar <baar@inf.fu-berlin.de>
diff --git a/sys/ping/makefile b/sys/ping/Makefile
similarity index 74%
rename from sys/ping/makefile
rename to sys/ping/Makefile
index 14489d8a7aabbdb0dd3c581bcdf24e6885c621f9..e944af2dce9901ae5aabaa8bcd696c405286907c 100644
--- a/sys/ping/makefile
+++ b/sys/ping/Makefile
@@ -1,5 +1,5 @@
 INCLUDES = -I../include -I$(RIOTBASE)/core/include/ -I$(RIOTBASE)/drivers/include
 MODULE =ping
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
diff --git a/sys/posix/makefile b/sys/posix/Makefile
similarity index 66%
rename from sys/posix/makefile
rename to sys/posix/Makefile
index 4ce0d5187e00e4da13db4b9abc082e8797492bb6..095298af207cbb65a50758019e020d9045fcc906 100644
--- a/sys/posix/makefile
+++ b/sys/posix/Makefile
@@ -1,5 +1,5 @@
 INCLUDES = -I../include -I$(RIOTBASE)/core/include
 MODULE =posix
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
diff --git a/sys/ps/makefile b/sys/ps/Makefile
similarity index 73%
rename from sys/ps/makefile
rename to sys/ps/Makefile
index 6c374d75a41f8c41f4a90373cdc85d8b78a6b1d8..11d0680982f01aba43255a21adfcdc50ec8976fd 100644
--- a/sys/ps/makefile
+++ b/sys/ps/Makefile
@@ -1,5 +1,5 @@
 INCLUDES = -I../include -I$(RIOTBASE)/core/include/ -I$(RIOTBASE)/drivers/include
 MODULE =ps
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
diff --git a/sys/shell/makefile b/sys/shell/Makefile
similarity index 100%
rename from sys/shell/makefile
rename to sys/shell/Makefile
diff --git a/sys/shell/commands/makefile b/sys/shell/commands/Makefile
similarity index 85%
rename from sys/shell/commands/makefile
rename to sys/shell/commands/Makefile
index 1008c51a7cb35822d935d37fee0b385919bf507c..c14ee9bcef14b8542ded7d595c588304dd92316a 100644
--- a/sys/shell/commands/makefile
+++ b/sys/shell/commands/Makefile
@@ -1,8 +1,6 @@
-#SRC = cc1100.c cc110x_ng.c disk.c id.c ltc4150.c ps.c rtc.c shell.c shell_commands.c sht11.c
 SRC = shell_commands.c sc_id.c
 INCLUDES = -I../../../core/include -I../../include -I../../../drivers/include/
 
-#cc1100.c  cc110x_ng.c  disk.c  id.c  Jamfile  ltc4150.c  makefile  makefile.commands  ps.c  rtc.c  shell.c  shell_commands.c  sht11.c
 ifneq (,$(findstring cc110x_ng,$(USEMODULE)))
 	INCLUDES += -I$(RIOTBASE)/drivers/cc110x_ng/include/
 	SRC += sc_cc110x_ng.c
diff --git a/sys/shell/shell.c b/sys/shell/shell.c
index ffeaee350a348db53bd6b51d06bd96ebb236d009..3762bc820d52523dfcbc24ed4d23e73020ac40cc 100644
--- a/sys/shell/shell.c
+++ b/sys/shell/shell.c
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/sys/swtimer/makefile b/sys/swtimer/Makefile
similarity index 74%
rename from sys/swtimer/makefile
rename to sys/swtimer/Makefile
index 2d5bd71b8cd7447fa706985b436331500f2cc681..b586e5476e0dc781e89210e735431aa9192be40a 100644
--- a/sys/swtimer/makefile
+++ b/sys/swtimer/Makefile
@@ -1,5 +1,5 @@
 INCLUDES = -I../include -I$(RIOTBASE)/core/include/ -I$(RIOTBASE)/drivers/include
 MODULE =swtimer
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
diff --git a/sys/syslog/makefile b/sys/syslog/Makefile
similarity index 85%
rename from sys/syslog/makefile
rename to sys/syslog/Makefile
index 968486c1c25b094d413589769ec4d0c7171d63e1..6d9a30e8f06a2cb5a2e6736f18b019b1e8c277c3 100644
--- a/sys/syslog/makefile
+++ b/sys/syslog/Makefile
@@ -1,6 +1,6 @@
 INCLUDES = -I../include -I../drivers/include -I../lib -I../../cpu/$(CPU)/include -I../../cpu/ -I../lib/cmdengine -I../net -I../../hal/include -I../../core/include -I../config
 MODULE =syslog
 
-include $(MAKEBASE)/makefile.base
+include $(MAKEBASE)/Makefile.base
 
 
diff --git a/sys/syslog/syslog-api.c b/sys/syslog/syslog-api.c
index 8b3c9a43f606f8b62e03456039b0b9f04905a452..8e157e5480403e0f752a7ddb4f188a61828d8576 100644
--- a/sys/syslog/syslog-api.c
+++ b/sys/syslog/syslog-api.c
@@ -4,14 +4,14 @@ Copyright 2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
diff --git a/sys/syslog/syslog-out.c b/sys/syslog/syslog-out.c
index 6253425c73a5fe6e308db4b825248438e0c621dc..78a62e0cd28be8db9e3b34ca3fdc2d76aedaac24 100644
--- a/sys/syslog/syslog-out.c
+++ b/sys/syslog/syslog-out.c
@@ -4,14 +4,14 @@ Copyright 2008-2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -29,7 +29,7 @@ and the mailinglist (subscription via web site)
  * @ingroup		syslog
  * @brief		System Logging Service output implementation
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @version     $Revision: 3854 $
  *
  * @note		$Id: syslog-out.c 3854 2011-12-06 15:27:01Z hwill $
diff --git a/sys/syslog/syslog.c b/sys/syslog/syslog.c
index 31ed0a0cbb2c508b494d3a3df373ae70532c1a91..7cd0e083c2f792884cb074d9ea6341cb0cf539ae 100644
--- a/sys/syslog/syslog.c
+++ b/sys/syslog/syslog.c
@@ -4,14 +4,14 @@ Copyright 2008-2009, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -33,7 +33,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		System Logging Service implementation
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Michael Baar <baar@inf.fu-berlin.de>
  * @version     $Revision: 3854 $
  *
diff --git a/sys/timex/makefile b/sys/timex/Makefile
similarity index 54%
rename from sys/timex/makefile
rename to sys/timex/Makefile
index 1ef2448bf3c9ea4be8b17f594acf72fea90bb4eb..09c9f9c7c5f97739c64116812a71f77506322eac 100644
--- a/sys/timex/makefile
+++ b/sys/timex/Makefile
@@ -1,5 +1,5 @@
 INCLUDES = -I../include 
 MODULE =timex
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
diff --git a/sys/tracelog/makefile b/sys/tracelog/Makefile
similarity index 85%
rename from sys/tracelog/makefile
rename to sys/tracelog/Makefile
index 899971b57c11c384348b5eb227792226145d5506..350c65eb1dc5818769e6562860795ea5f4b3d0fd 100644
--- a/sys/tracelog/makefile
+++ b/sys/tracelog/Makefile
@@ -1,6 +1,6 @@
 INCLUDES = -I../include -I../drivers/include -I../lib -I../../cpu/$(CPU)/include -I../../cpu/ -I../lib/cmdengine -I../net -I../../hal/include -I../../core/include -I../config
 MODULE =tracelog
 
-include $(MAKEBASE)/makefile.base
+include $(MAKEBASE)/Makefile.base
 
 
diff --git a/sys/tracelog/tracelog.c b/sys/tracelog/tracelog.c
index a1f88afe361027eee7866d04ffbf261492b85180..0e539f2b1b1ceb5fb432777d2766e5b9f48adb85 100644
--- a/sys/tracelog/tracelog.c
+++ b/sys/tracelog/tracelog.c
@@ -4,14 +4,14 @@ Copyright 2008, Freie Universitaet Berlin (FUB). All rights reserved.
 These sources were developed at the Freie Universitaet Berlin, Computer Systems
 and Telematics group (http://cst.mi.fu-berlin.de).
 -------------------------------------------------------------------------------
-This file is part of FeuerWare.
+This file is part of RIOT.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation, either version 3 of the License, or (at your option) any later
 version.
 
-FeuerWare is distributed in the hope that it will be useful, but WITHOUT
+RIOT is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
@@ -33,7 +33,7 @@ and the mailinglist (subscription via web site)
  * @file
  * @brief		Tracelog implementation
  *
- * @author      Freie Universität Berlin, Computer Systems & Telematics, FeuerWhere project
+ * @author      Freie Universität Berlin, Computer Systems & Telematics
  * @author		Michael Baar <baar@inf.fu-berlin.de>
  *
  * @note		$Id: tracelog.c 3854 2011-12-06 15:27:01Z hwill $
diff --git a/sys/transceiver/makefile b/sys/transceiver/Makefile
similarity index 86%
rename from sys/transceiver/makefile
rename to sys/transceiver/Makefile
index 8216bd217f72c913a204584625d3a8fc521c87c8..cc75d9d7d720e358d66c1de10870b2734ba9fa7e 100644
--- a/sys/transceiver/makefile
+++ b/sys/transceiver/Makefile
@@ -1,6 +1,6 @@
 INCLUDES = -I../include -I$(RIOTBAE)/drivers/include -I$(RIOTBASE)/drivers/cc110x_ng/include -I../lib -I../../cpu/$(CPU)/include -I../../cpu/ -I../net -I../../hal/include -I../../core/include -I../config
 MODULE =transceiver
 
-include $(MAKEBASE)/makefile.base
+include $(MAKEBASE)/Makefile.base
 
 
diff --git a/sys/uart0/makefile b/sys/uart0/Makefile
similarity index 85%
rename from sys/uart0/makefile
rename to sys/uart0/Makefile
index 72c2cbda2ef0f6a6c5c16071198337278abd706f..2f2d2f238c0297534ce3d648d6daa19ac36e7f28 100644
--- a/sys/uart0/makefile
+++ b/sys/uart0/Makefile
@@ -2,6 +2,6 @@ INCLUDES = -I../include -I../drivers/include -I../lib -I../../cpu/$(CPU)/include
 
 MODULE =uart0
 
-include $(MAKEBASE)/makefile.base
+include $(MAKEBASE)/Makefile.base
 
 
diff --git a/sys/vtimer/makefile b/sys/vtimer/Makefile
similarity index 74%
rename from sys/vtimer/makefile
rename to sys/vtimer/Makefile
index 6c1df6e8e5c4ffd1d1ba9f8e4fc2df98f9d4e9e8..adb12a5d812f2f1b9869cf1198ef2acce293aa0a 100644
--- a/sys/vtimer/makefile
+++ b/sys/vtimer/Makefile
@@ -1,5 +1,5 @@
 INCLUDES = -I../include -I$(RIOTBASE)/core/include/ -I$(RIOTBASE)/drivers/include
 MODULE =vtimer
 
-include $(RIOTBASE)/makefile.base
+include $(RIOTBASE)/Makefile.base
 
diff --git a/testsuite/build_and_generate_html.sh b/testsuite/build_and_generate_html.sh
deleted file mode 100755
index 335cd58de4d8a6b5920af734b6ca8e4aec3a3327..0000000000000000000000000000000000000000
--- a/testsuite/build_and_generate_html.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-test -f ~/.buildbot && . ~/.buildbot
-
-export REVISION=${1}
-export ROOT=${ROOT:-.}
-
-${ROOT}/testsuite/svn_test_revision.sh ${REVISION}
-${ROOT}/testsuite/generate_html.sh
-
diff --git a/testsuite/generate_html.sh b/testsuite/generate_html.sh
deleted file mode 100755
index 2d4b475f74b326a1614b42836aac67a573de444f..0000000000000000000000000000000000000000
--- a/testsuite/generate_html.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-ROOT=${ROOT:-.}
-TOOLROOT=${TOOLROOT:-${ROOT}}
-HTMLDIR=${TOOLROOT}/tools/testsuite/html
-
-test -f ~/.buildbot && . ~/.buildbot
-
-OUTFILE=${HTMLFILE:-${HOME}/firekernel.html}
-LOGDIR=${BUILDLOGS:-${HOME}/buildlogs}
-
-{
-cat ${HTMLDIR}/header 
-
-for i in `ls -t $LOGDIR/*.log`; do
-    ${TOOLROOT}/tools/testsuite/parse_buildlog.sh $i
-    if [ "x${HTTPROOT}x"!="xx" ]; then
-        echo "<br>"
-        echo "Full build log: <a href=\"${HTTPROOT}/`basename ${i}`\"> click here </a>."
-    fi
-
-done
-
-cat ${HTMLDIR}/footer 
-} > ${OUTFILE}
-
-
diff --git a/testsuite/html/footer b/testsuite/html/footer
deleted file mode 100644
index a446d53d9d16320fab607b7916e5c567663026b7..0000000000000000000000000000000000000000
--- a/testsuite/html/footer
+++ /dev/null
@@ -1 +0,0 @@
-</body>
diff --git a/testsuite/html/header b/testsuite/html/header
deleted file mode 100644
index 4d9384a397063b9811b2c835d8485e31b1d70233..0000000000000000000000000000000000000000
--- a/testsuite/html/header
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
-<header>
-<title> Feuerwhere Build Bot results </title>
-</header>
-<body>
-
diff --git a/testsuite/parse_buildlog.sh b/testsuite/parse_buildlog.sh
deleted file mode 100755
index 3ce5bf53cab99634749b1c62ce504c936ee699b1..0000000000000000000000000000000000000000
--- a/testsuite/parse_buildlog.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-LOG=${1}
-
-if [ "xx${PARSELOG_ALWAYS}xx"=!"xxyxx" ]; then
-    if [ -f ${LOG}.parsed ]; then
-        cat ${LOG}.parsed
-        exit 0
-    fi
-fi
-
-{
-#BUILD_FAIL=`grep '\[BUILD FAILED\]' ${LOG} | wc -l`
-NUM_FAIL=`grep '\[.* FAILED\]' ${LOG} | wc -l`
-NUM_OK=`grep '\[TEST SUCCESSFUL\]' ${LOG} | wc -l`
-
-REVISION=`awk '/^Revision:/ { print $2; exit}' $LOG`
-REPO=`awk '/^Repo:/ { print $2; exit}' $LOG`
-
-
-if [ -f ${LOG}.lock ]; then
-    BUILD_STATUS="build in progress..."
-elif (($NUM_FAIL==0)); then
-    BUILD_STATUS="OK"
-else
-    BUILD_STATUS="broken!"
-fi
-    
-echo "<h2>Revision: ${REVISION} Status: ${BUILD_STATUS}</h2>"
-
-svn log --incremental -v -l 1 ${REPO}@${REVISION} | sed -e 's/$/<br>/'
-
-echo "------------------------------------------------------------------------<br>"
-
-if (($NUM_FAIL==0)); then
-    true
-else
-echo "<br> Failed builds/tests: <br>"
-    grep '\[.* FAILED\]' ${LOG} | uniq | sed -e 's/$/<br>/'
-fi
-} | tee ${1}.parsed
-
-
diff --git a/testsuite/run_tests.sh b/testsuite/run_tests.sh
deleted file mode 100755
index 1344e604a38127546e46f114be7b82c8561dac61..0000000000000000000000000000000000000000
--- a/testsuite/run_tests.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-TOOLROOT=${TOOLROOT:-.}
-
-flash() {
-    echo "Building ${1}..."
-    jam -aq flash || ( echo "[BUILD FAILED] ${1}" && false ) 
-}
-
-run_tests() {
-    TESTDIR=projects/${1}/tests
-    flash ${PROJECT} || return
-    for tst in `ls ${TESTDIR}/`; do 
-        echo "Project \"${1}\": Running test ${tst}..."
-        $TESTDIR/$tst || (
-            echo
-            echo "[TEST FAILED] ${TESTDIR}/${tst}"
-            ) || echo "[TEST SUCCESSFUL] ${TESTDIR}/${tst}"
-    done
-}
-
-echo 
-echo "Running tests..."
-echo
-
-for i in projects/*; do
-    export PROJECT=`basename $i`
-    if [ -d projects/${PROJECT}/tests ]; then
-        {
-            echo "Testing project ${PROJECT}..."
-            PORT="`sh ${TOOLROOT}/tools/lock_board.sh`"
-            FLASHUTIL_SHELL="sh -c"
-
-            echo "Using Target connecting to ${PORT}."
-
-            export PORT FLASHUTIL_SHELL
-            run_tests ${PROJECT}
-
-            sh ${TOOLROOT}/tools/unlock_board.sh ${PORT}
-        } 2>&1
-    fi
-done
-
diff --git a/testsuite/svn_test_revision.sh b/testsuite/svn_test_revision.sh
deleted file mode 100755
index 239ab4b1997a3b8fcfa461f8589d54e19a0e9a34..0000000000000000000000000000000000000000
--- a/testsuite/svn_test_revision.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-
-. ~/.buildbot
-
-REPO=${REPO:-https://svn.mi.fu-berlin.de/msb/FeuerWare/trunk}
-LOGDIR=${LOGDIR:-${HOME}/buildlogs}
-
-REVISION=${1:-HEAD}
-
-LOGBASE="`date +%F-%Hh-%Mm-%Ss`-r${REVISION}-test.log"
-
-LOGFILE="${LOGDIR}/${LOGBASE}"
-TMPDIR=`mktemp -d /dev/shm/svn_test_repo.XXXXXXXXXX`
-
-TOOLROOT=${TOOLROOT:-.}
-
-if [ ! -d ${TMPDIR} ]; then exit 1; fi
-
-touch ${LOGFILE}.lock
-
-{
-    echo "${0} runnning checkout/build/test cycle."
-    echo "Repo: ${REPO}"
-    echo "Revision: ${REVISION}" 
-    echo "Temporary directory: ${TMPDIR}..."
-    echo "Logfilename: ${LOGBASE}"
-
-    cd ${TMPDIR} &&
-
-    echo "Checking out..." &&
-    svn co -q -r ${REVISION} ${REPO} &&
-    echo "Done." &&
-
-    cd ${TMPDIR}/trunk/board/msba2/tools && make &&
-    cd ${TMPDIR}/trunk &&
-    bash ${TOOLROOT}/tools/testsuite/run_tests.sh
-
-    echo
-    echo "Test run completed."
-} 2>&1 | tee ${LOGFILE}
-
-rm -f ${LOGFILE}.lock
-rm -f ${LOGFILE}.parsed
-
-rm -rf ${TMPDIR}
-