testing of combination of LCS and LAN

Dependencies:   mbed

Committer:
damir
Date:
Wed Jan 14 13:29:55 2015 +0000
Revision:
0:a7a6a692162f
Test of LAN

Who changed what in which revision?

UserRevisionLine numberNew contents of line
damir 0:a7a6a692162f 1 /*
damir 0:a7a6a692162f 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
damir 0:a7a6a692162f 3 * All rights reserved.
damir 0:a7a6a692162f 4 *
damir 0:a7a6a692162f 5 * Redistribution and use in source and binary forms, with or without modification,
damir 0:a7a6a692162f 6 * are permitted provided that the following conditions are met:
damir 0:a7a6a692162f 7 *
damir 0:a7a6a692162f 8 * 1. Redistributions of source code must retain the above copyright notice,
damir 0:a7a6a692162f 9 * this list of conditions and the following disclaimer.
damir 0:a7a6a692162f 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
damir 0:a7a6a692162f 11 * this list of conditions and the following disclaimer in the documentation
damir 0:a7a6a692162f 12 * and/or other materials provided with the distribution.
damir 0:a7a6a692162f 13 * 3. The name of the author may not be used to endorse or promote products
damir 0:a7a6a692162f 14 * derived from this software without specific prior written permission.
damir 0:a7a6a692162f 15 *
damir 0:a7a6a692162f 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
damir 0:a7a6a692162f 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
damir 0:a7a6a692162f 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
damir 0:a7a6a692162f 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
damir 0:a7a6a692162f 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
damir 0:a7a6a692162f 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
damir 0:a7a6a692162f 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
damir 0:a7a6a692162f 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
damir 0:a7a6a692162f 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
damir 0:a7a6a692162f 25 * OF SUCH DAMAGE.
damir 0:a7a6a692162f 26 *
damir 0:a7a6a692162f 27 * This file is part of the lwIP TCP/IP stack.
damir 0:a7a6a692162f 28 *
damir 0:a7a6a692162f 29 * Author: Adam Dunkels <adam@sics.se>
damir 0:a7a6a692162f 30 *
damir 0:a7a6a692162f 31 */
damir 0:a7a6a692162f 32 #ifndef __LWIP_DEBUG_H__
damir 0:a7a6a692162f 33 #define __LWIP_DEBUG_H__
damir 0:a7a6a692162f 34
damir 0:a7a6a692162f 35 #include "lwip/arch.h"
damir 0:a7a6a692162f 36
damir 0:a7a6a692162f 37 /** lower two bits indicate debug level
damir 0:a7a6a692162f 38 * - 0 all
damir 0:a7a6a692162f 39 * - 1 warning
damir 0:a7a6a692162f 40 * - 2 serious
damir 0:a7a6a692162f 41 * - 3 severe
damir 0:a7a6a692162f 42 */
damir 0:a7a6a692162f 43 #define LWIP_DBG_LEVEL_ALL 0x00
damir 0:a7a6a692162f 44 #define LWIP_DBG_LEVEL_OFF LWIP_DBG_LEVEL_ALL /* compatibility define only */
damir 0:a7a6a692162f 45 #define LWIP_DBG_LEVEL_WARNING 0x01 /* bad checksums, dropped packets, ... */
damir 0:a7a6a692162f 46 #define LWIP_DBG_LEVEL_SERIOUS 0x02 /* memory allocation failures, ... */
damir 0:a7a6a692162f 47 #define LWIP_DBG_LEVEL_SEVERE 0x03
damir 0:a7a6a692162f 48 #define LWIP_DBG_MASK_LEVEL 0x03
damir 0:a7a6a692162f 49
damir 0:a7a6a692162f 50 /** flag for LWIP_DEBUGF to enable that debug message */
damir 0:a7a6a692162f 51 #define LWIP_DBG_ON 0x80U
damir 0:a7a6a692162f 52 /** flag for LWIP_DEBUGF to disable that debug message */
damir 0:a7a6a692162f 53 #define LWIP_DBG_OFF 0x00U
damir 0:a7a6a692162f 54
damir 0:a7a6a692162f 55 /** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */
damir 0:a7a6a692162f 56 #define LWIP_DBG_TRACE 0x40U
damir 0:a7a6a692162f 57 /** flag for LWIP_DEBUGF indicating a state debug message (to follow module states) */
damir 0:a7a6a692162f 58 #define LWIP_DBG_STATE 0x20U
damir 0:a7a6a692162f 59 /** flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet */
damir 0:a7a6a692162f 60 #define LWIP_DBG_FRESH 0x10U
damir 0:a7a6a692162f 61 /** flag for LWIP_DEBUGF to halt after printing this debug message */
damir 0:a7a6a692162f 62 #define LWIP_DBG_HALT 0x08U
damir 0:a7a6a692162f 63
damir 0:a7a6a692162f 64 #ifndef LWIP_NOASSERT
damir 0:a7a6a692162f 65 #define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \
damir 0:a7a6a692162f 66 LWIP_PLATFORM_ASSERT(message); } while(0)
damir 0:a7a6a692162f 67 #else /* LWIP_NOASSERT */
damir 0:a7a6a692162f 68 #define LWIP_ASSERT(message, assertion)
damir 0:a7a6a692162f 69 #endif /* LWIP_NOASSERT */
damir 0:a7a6a692162f 70
damir 0:a7a6a692162f 71 /** if "expression" isn't true, then print "message" and execute "handler" expression */
damir 0:a7a6a692162f 72 #ifndef LWIP_ERROR
damir 0:a7a6a692162f 73 #define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \
damir 0:a7a6a692162f 74 LWIP_PLATFORM_ASSERT(message); handler;}} while(0)
damir 0:a7a6a692162f 75 #endif /* LWIP_ERROR */
damir 0:a7a6a692162f 76
damir 0:a7a6a692162f 77 #ifdef LWIP_DEBUG
damir 0:a7a6a692162f 78 /** print debug message only if debug message type is enabled...
damir 0:a7a6a692162f 79 * AND is of correct type AND is at least LWIP_DBG_LEVEL
damir 0:a7a6a692162f 80 */
damir 0:a7a6a692162f 81 #define LWIP_DEBUGF(debug, message) do { \
damir 0:a7a6a692162f 82 if ( \
damir 0:a7a6a692162f 83 ((debug) & LWIP_DBG_ON) && \
damir 0:a7a6a692162f 84 ((debug) & LWIP_DBG_TYPES_ON) && \
damir 0:a7a6a692162f 85 ((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \
damir 0:a7a6a692162f 86 LWIP_PLATFORM_DIAG(message); \
damir 0:a7a6a692162f 87 if ((debug) & LWIP_DBG_HALT) { \
damir 0:a7a6a692162f 88 while(1); \
damir 0:a7a6a692162f 89 } \
damir 0:a7a6a692162f 90 } \
damir 0:a7a6a692162f 91 } while(0)
damir 0:a7a6a692162f 92
damir 0:a7a6a692162f 93 #else /* LWIP_DEBUG */
damir 0:a7a6a692162f 94 #define LWIP_DEBUGF(debug, message)
damir 0:a7a6a692162f 95 #endif /* LWIP_DEBUG */
damir 0:a7a6a692162f 96
damir 0:a7a6a692162f 97 #endif /* __LWIP_DEBUG_H__ */
damir 0:a7a6a692162f 98