diff --git a/core/include/atomic.h b/core/include/atomic.h index c24981f9f1..8733e5037e 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 */ diff --git a/core/include/bitarithm.h b/core/include/bitarithm.h index d159f33348..022e09b396 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 */ diff --git a/core/include/clist.h b/core/include/clist.h index 2dac25f09b..5df80db5bc 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 */ diff --git a/core/include/debug.h b/core/include/debug.h index d680fd5aa7..649171de72 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 * @} */ diff --git a/core/include/hwtimer.h b/core/include/hwtimer.h index 7a2ce835d8..9dcd3fc5eb 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 * @author Michael Baar diff --git a/core/include/hwtimer_arch.h b/core/include/hwtimer_arch.h index 23fa96b890..2c872521e6 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 * @author Heiko Will * @author Kaspar Schleiser diff --git a/core/include/kernel.h b/core/include/kernel.h index 49dda3664b..17bad79878 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 */ diff --git a/core/include/kernel_intern.h b/core/include/kernel_intern.h index ca50b55e36..4eb1a9e9b6 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 */ diff --git a/core/include/lpm.h b/core/include/lpm.h index 95b2d7b5be..a10ded3546 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 fe9792caf6..d907ccf99d 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 */ diff --git a/core/include/mutex.h b/core/include/mutex.h index 5140881ee4..3613e91a4a 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 */ diff --git a/core/include/oneway_malloc.h b/core/include/oneway_malloc.h index 56daf2cc80..d030dd6759 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 */ diff --git a/core/include/queue.h b/core/include/queue.h index ae377409de..2e3cab39f8 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 */ diff --git a/core/include/sched.h b/core/include/sched.h index 5f3c3ce15c..108914d5a9 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 */ diff --git a/core/include/tcb.h b/core/include/tcb.h index 9d6f5f26cf..729837d594 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 */ diff --git a/core/include/thread.h b/core/include/thread.h index 31fb4e80a6..f4cb0bad5e 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 */ diff --git a/core/kernel_init.c b/core/kernel_init.c index 6af76399cf..3124ce65f5 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 fd905db895..120e818156 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/arm_common/bootloader.c b/cpu/arm_common/bootloader.c index f68a75e07b..56bfc39958 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 * @author Michael Baar * @version $Revision$ diff --git a/cpu/arm_common/hwtimer_cpu.c b/cpu/arm_common/hwtimer_cpu.c index a959429c8b..beadde7607 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 * @author Heiko Will * diff --git a/cpu/arm_common/include/arm_common.h b/cpu/arm_common/include/arm_common.h index b4fa499492..2fdc7d200e 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 14dcda90a1..b9103ff592 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 * @version $Revision$ * diff --git a/cpu/cc430/cc430-gpioint.c b/cpu/cc430/cc430-gpioint.c index 56cdbf1511..6775b81f9e 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 8d2b43fcb7..f37de37328 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 15e27bdb40..b3b7d5596c 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/include/cpu.h b/cpu/lpc214x/include/cpu.h index e439e61fd1..0a8dcdad47 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/cpu.c b/cpu/lpc2387/cpu.c index c68bb6d6b9..07ed4856c6 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/lpc2387-gpioint.c b/cpu/lpc2387/gpioint/lpc2387-gpioint.c index 4941727454..30706da9d4 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 * @version $Revision: 1508 $ * diff --git a/cpu/lpc2387/include/cpu-conf.h b/cpu/lpc2387/include/cpu-conf.h index 9e6a2dde94..5f7c2860b4 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 70e2bc7e30..659ba8c84c 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 9f832a5ae6..b273c27ce8 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 * @version $Revision: 3249 $ * diff --git a/cpu/lpc2387/include/lpc2387-rtc.h b/cpu/lpc2387/include/lpc2387-rtc.h index 080a330cfc..600554cc02 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 efa60aaa29..79ca56a93b 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 f3348a3d18..274876fbe4 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 * @version $Revision: 3250 $ * diff --git a/cpu/lpc2387/lpc2387-lpm.c b/cpu/lpc2387/lpc2387-lpm.c index e14cd9a30d..8261873d40 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/rtc/lpc2387-rtc.c b/cpu/lpc2387/rtc/lpc2387-rtc.c index 4642042a6b..0364fb7793 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 * @version $Revision: 2005 $ * diff --git a/cpu/msp430-common/cpu.c b/cpu/msp430-common/cpu.c index a297ec08d4..c7288cb94a 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 94d2e023f8..3419fcfc70 100644 --- a/cpu/msp430-common/flashrom.c +++ b/cpu/msp430-common/flashrom.c @@ -1,7 +1,6 @@ #include #include #include -#include #include uint8_t ie1, ie2; diff --git a/cpu/msp430-common/hwtimer_cpu.c b/cpu/msp430-common/hwtimer_cpu.c index 0427e32a3f..41024ac341 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 a79e422f54..a7cca6aa22 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 99d49f1131..a3e0a1df8c 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 3151539218..a60012b02e 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 c5363076f2..a77f817597 100644 --- a/cpu/msp430-common/msp430-main.c +++ b/cpu/msp430-common/msp430-main.c @@ -32,7 +32,6 @@ * * Modified by Kaspar Schleiser */ -#include #include "cpu.h" #include diff --git a/cpu/msp430-common/startup.c b/cpu/msp430-common/startup.c index 230a0fd800..bad3bb95cc 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/dist/tools/testsuite/svn_test_revision.sh b/dist/tools/testsuite/svn_test_revision.sh deleted file mode 100755 index 239ab4b199..0000000000 --- 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/riot.doxyfile b/doc/doxygen/riot.doxyfile index 490fd04f21..a05ba6d5f4 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 0000000000..a4ad401ba3 --- /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 POSIX compliant operating systgems. 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 0f98f639d4..f54fa45185 100644 --- a/doc/doxygen/src/ukleos-header.html +++ b/doc/doxygen/src/riot-header.html @@ -4,7 +4,7 @@ $title - + 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 8d82f8bbb6..54dfc81a24 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 35d966b41d..0000000000 --- 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.

- -*/ diff --git a/drivers/cc110x/arch_cc1100.h b/drivers/cc110x/arch_cc1100.h index 7c8b018a50..7d42ed3279 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 * @version $Revision: 1775 $ * diff --git a/drivers/cc110x/cc1100-csmaca-mac.c b/drivers/cc110x/cc1100-csmaca-mac.c index efa875631a..2eaa401b94 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 * @author Heiko Will * @version $Revision: 2128 $ diff --git a/drivers/cc110x/cc1100-csmaca-mac.h b/drivers/cc110x/cc1100-csmaca-mac.h index ecfeedc39d..5d0e2b2f2a 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 * @author Heiko Will * @version $Revision: 1999 $ diff --git a/drivers/cc110x/cc1100-defaultSettings.c b/drivers/cc110x/cc1100-defaultSettings.c index e4561ff589..008e9d9393 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 * @author Heiko Will * @version $Revision: 2058 $ diff --git a/drivers/cc110x/cc1100-defaultSettings.h b/drivers/cc110x/cc1100-defaultSettings.h index a43ebe42cf..2d8fa84087 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 * @author Heiko Will * @version $Revision: 2139 $ diff --git a/drivers/cc110x/cc1100-interface.h b/drivers/cc110x/cc1100-interface.h index ff9a0f2d5e..cc54f0cc56 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 * @version $Revision: 2283 $ * diff --git a/drivers/cc110x/cc1100-internal.h b/drivers/cc110x/cc1100-internal.h index 54ddabde70..6f9e13acfe 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 * @author Heiko Will * @version $Revision: 1231 $ diff --git a/drivers/cc110x/cc1100.c b/drivers/cc110x/cc1100.c index 49e73d27b7..987b3568b0 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 * @author Heiko Will * @version $Revision: 2283 $ diff --git a/drivers/cc110x/cc1100.h b/drivers/cc110x/cc1100.h index 2143e853a6..6eefb5d1ec 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 * @author Heiko Will * @version $Revision: 2128 $ diff --git a/drivers/cc110x/cc1100_phy.c b/drivers/cc110x/cc1100_phy.c index 8241605806..01c49e5869 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 * @author Heiko Will * @version $Revision: 2130 $ diff --git a/drivers/cc110x/cc1100_phy.h b/drivers/cc110x/cc1100_phy.h index eb4c3530ff..8459783add 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 * @author Heiko Will * @version $Revision: 1285 $ diff --git a/drivers/cc110x/cc1100_spi.c b/drivers/cc110x/cc1100_spi.c index 2614caf20a..04aa21d29b 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 * @author Heiko Will * @version $Revision: 1775 $ diff --git a/drivers/cc110x/cc1100_spi.h b/drivers/cc110x/cc1100_spi.h index e76deb8b27..c5c53c2e22 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 * @author Heiko Will * @version $Revision: 1775 $ diff --git a/drivers/cc110x_ng/cc110x-defaultSettings.c b/drivers/cc110x_ng/cc110x-defaultSettings.c index dc15fbd232..844dcb5758 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 * @author Heiko Will * @version $Revision: 2058 $ diff --git a/drivers/cc110x_ng/include/cc110x-arch.h b/drivers/cc110x_ng/include/cc110x-arch.h index 3a990b1ba5..fb05fef5d5 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 * @version $Revision: 1775 $ * diff --git a/drivers/cc110x_ng/include/cc110x-defaultSettings.h b/drivers/cc110x_ng/include/cc110x-defaultSettings.h index d15a45cd55..76eb00d441 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 * @author Heiko Will * @version $Revision: 2139 $ diff --git a/drivers/cc110x_ng/include/cc110x-internal.h b/drivers/cc110x_ng/include/cc110x-internal.h index 409c3b9885..77ff43fbce 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 * @author Heiko Will * @version $Revision: 1231 $ diff --git a/drivers/cc110x_ng/include/cc110x-reg.h b/drivers/cc110x_ng/include/cc110x-reg.h index 02756ca5f6..49943585f3 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 * @author Heiko Will * @version $Revision: 1775 $ diff --git a/drivers/cc110x_ng/spi/cc110x_spi.c b/drivers/cc110x_ng/spi/cc110x_spi.c index cd57303862..867f93111f 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 * @author Heiko Will * @version $Revision: 1775 $ diff --git a/drivers/include/gpioint.h b/drivers/include/gpioint.h index 8d5d30f1e4..8f4ecd260a 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 * @version $Revision: 1508 $ * diff --git a/drivers/include/ltc4150_arch.h b/drivers/include/ltc4150_arch.h index 51c76ca594..84a5c68102 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 b40b72b503..25b0d8759b 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 227569f5e1..00f00e0bd1 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/ltc4150.c b/drivers/ltc4150/ltc4150.c index 70c4a4ac11..2175c37b08 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 */ diff --git a/drivers/sht11/sht11.c b/drivers/sht11/sht11.c index c81cfc56b1..872888a067 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/include/radio/radio.h b/sys/include/radio/radio.h index 747b9c86d0..c45431ce59 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 * @version $Revision: 1961 $ diff --git a/sys/include/radio/types.h b/sys/include/radio/types.h index c84a12e097..a0d6b4c27d 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 * @version $Revision: 2061 $ * diff --git a/sys/include/shell.h b/sys/include/shell.h index d5ca165890..00f34148b1 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/logd/logd.c b/sys/logd/logd.c index 2dcfa1196d..2552e7a78d 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 * @version $Revision: 3854 $ * diff --git a/sys/net/destiny/socket.c b/sys/net/destiny/socket.c index 69d01796c2..a0982c2610 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 -#include -#include -#include -#include -#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(¤t_socket->local_address.sin6_addr); - ipv6_print_addr(¤t_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 = ¤t_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(¤t_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(¤t_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 = ¤t_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, ¤t_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), ¤t_tcp_socket->foreign_address.sin6_addr, 16); - memcpy(&(temp_ipv6_header->srcaddr), ¤t_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(¤t_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(¤t_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 = ¤t_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(¤t_tcp_socket->local_address, PF_INET6, HTONS(get_free_source_port(IPPROTO_TCP)), 0, &src_addr); - - // Foreign address information - set_socket_address(¤t_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, ¤t_tcp_socket->tcp_control.tcp_context, sizeof(tcp_hc_context_t)); -#endif - - set_tcp_cb(¤t_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(¤t_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(¤t_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(¤t_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, ¤t_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(¤t_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 = ¤t_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, ¤t_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(¤t_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(¤t_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(¤t_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(¤t_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(¤t_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(¤t_int_tcp_socket->tcp_buffer_mutex, 0); - return read_bytes; - } - else - { - mutex_lock(¤t_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(¤t_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 = ¤t_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(¤t_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(¤t_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(¤t_queued_socket->socket_values.foreign_address, AF_INET6, tcp_header->src_port, ipv6_header->flowlabel, &ipv6_header->srcaddr); - - // Local address - set_socket_address(¤t_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(¤t_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 +#include +#include +#include +#include +#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(¤t_socket->local_address.sin6_addr); + ipv6_print_addr(¤t_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 = ¤t_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(¤t_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(¤t_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 = ¤t_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, ¤t_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), ¤t_tcp_socket->foreign_address.sin6_addr, 16); + memcpy(&(temp_ipv6_header->srcaddr), ¤t_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(¤t_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(¤t_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 = ¤t_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(¤t_tcp_socket->local_address, PF_INET6, HTONS(get_free_source_port(IPPROTO_TCP)), 0, &src_addr); + + // Foreign address information + set_socket_address(¤t_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, ¤t_tcp_socket->tcp_control.tcp_context, sizeof(tcp_hc_context_t)); +#endif + + set_tcp_cb(¤t_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(¤t_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(¤t_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(¤t_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, ¤t_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(¤t_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 = ¤t_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, ¤t_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(¤t_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(¤t_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(¤t_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(¤t_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(¤t_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(¤t_int_tcp_socket->tcp_buffer_mutex, 0); + return read_bytes; + } + else + { + mutex_lock(¤t_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(¤t_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 = ¤t_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(¤t_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(¤t_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(¤t_queued_socket->socket_values.foreign_address, AF_INET6, tcp_header->src_port, ipv6_header->flowlabel, &ipv6_header->srcaddr); + + // Local address + set_socket_address(¤t_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(¤t_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/mm/mmr.c b/sys/net/mm/mmr.c index a1bf646b52..1bf3ae2f92 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 * @version $Revision: 3854 $ * diff --git a/sys/net/mm/mmr.h b/sys/net/mm/mmr.h index faff3572c8..e58d31edbd 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 * @version $Revision: 3854 $ * diff --git a/sys/net/mm/mmstack.c b/sys/net/mm/mmstack.c index 56fdb4d3d2..83a41b44e7 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 * @version $Revision: 3854 $ * diff --git a/sys/net/mm/mmstack.h b/sys/net/mm/mmstack.h index e07fa4f38f..22ce8790e3 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 * @version $Revision: 3854 $ * diff --git a/sys/net/protocol-multiplex.c b/sys/net/protocol-multiplex.c index 7f3857b4ef..d5ac1894fa 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 * @author Heiko Will * @author Michael Baar diff --git a/sys/net/protocol-multiplex.h b/sys/net/protocol-multiplex.h index d48bdefc18..b324aede5b 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 * @author Heiko Will * @author Michael Baar diff --git a/sys/shell/shell.c b/sys/shell/shell.c index ffeaee350a..3762bc820d 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/syslog/syslog-api.c b/sys/syslog/syslog-api.c index 8b3c9a43f6..8e157e5480 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 6253425c73..78a62e0cd2 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 31ed0a0cbb..7cd0e083c2 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 * @version $Revision: 3854 $ * diff --git a/sys/tracelog/tracelog.c b/sys/tracelog/tracelog.c index a1f88afe36..0e539f2b1b 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 * * @note $Id: tracelog.c 3854 2011-12-06 15:27:01Z hwill $ diff --git a/testsuite/build_and_generate_html.sh b/testsuite/build_and_generate_html.sh deleted file mode 100755 index 335cd58de4..0000000000 --- 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 2d4b475f74..0000000000 --- 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 "
" - echo "Full build log: click here ." - fi - -done - -cat ${HTMLDIR}/footer -} > ${OUTFILE} - - diff --git a/testsuite/html/footer b/testsuite/html/footer deleted file mode 100644 index a446d53d9d..0000000000 --- a/testsuite/html/footer +++ /dev/null @@ -1 +0,0 @@ - diff --git a/testsuite/html/header b/testsuite/html/header deleted file mode 100644 index 4d9384a397..0000000000 --- a/testsuite/html/header +++ /dev/null @@ -1,6 +0,0 @@ - -

- Feuerwhere Build Bot results -
- - diff --git a/testsuite/parse_buildlog.sh b/testsuite/parse_buildlog.sh deleted file mode 100755 index 3ce5bf53ca..0000000000 --- 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 "

Revision: ${REVISION} Status: ${BUILD_STATUS}

" - -svn log --incremental -v -l 1 ${REPO}@${REVISION} | sed -e 's/$/
/' - -echo "------------------------------------------------------------------------
" - -if (($NUM_FAIL==0)); then - true -else -echo "
Failed builds/tests:
" - grep '\[.* FAILED\]' ${LOG} | uniq | sed -e 's/$/
/' -fi -} | tee ${1}.parsed - - diff --git a/testsuite/run_tests.sh b/testsuite/run_tests.sh deleted file mode 100755 index 1344e604a3..0000000000 --- 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 239ab4b199..0000000000 --- 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} -