Stripped down version of Segundos NetService library (http://mbed.org/users/segundo/libraries/NetServices ). I have removed all NetServices, and all functions which had been disabled. Use this version when you need only pure TCP or UDP functions - this library compiles faster.

Dependencies:   lwip lwip-sys

Dependents:   christmasLights device_server pop3demo device_server_udp ... more

Committer:
hlipka
Date:
Mon Jan 10 21:03:11 2011 +0000
Revision:
0:8b387bed54c2
initial version

Who changed what in which revision?

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