debug.h

00001 /*
00002  * Copyright (c) 2001, Swedish Institute of Computer Science.
00003  * All rights reserved. 
00004  *
00005  * Redistribution and use in source and binary forms, with or without 
00006  * modification, are permitted provided that the following conditions 
00007  * are met: 
00008  * 1. Redistributions of source code must retain the above copyright 
00009  *    notice, this list of conditions and the following disclaimer. 
00010  * 2. Redistributions in binary form must reproduce the above copyright 
00011  *    notice, this list of conditions and the following disclaimer in the 
00012  *    documentation and/or other materials provided with the distribution. 
00013  * 3. Neither the name of the Institute nor the names of its contributors 
00014  *    may be used to endorse or promote products derived from this software 
00015  *    without specific prior written permission. 
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 
00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 
00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 
00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
00027  * SUCH DAMAGE. 
00028  *
00029  * This file is part of the lwIP TCP/IP stack.
00030  * 
00031  * Author: Adam Dunkels <adam@sics.se>
00032  *
00033  * $Id$
00034  */
00035 #ifndef __LWIP_DEBUG_H__
00036 #define __LWIP_DEBUG_H__
00037 
00038 #ifdef LWIP_DEBUG
00039 
00040 #define ASSERT(x,y) if(!(y)) {printf("Assertion \"%s\" failed at line %d in %s\n", \
00041                                      x, __LINE__, __FILE__); fflush(NULL); abort();}
00042 
00043 /* These defines control the amount of debugging output: */
00044 #define MEM_TRACKING
00045 
00046 #define DEMO_DEBUG       1
00047 
00048 #define ARP_DEBUG        0
00049 
00050 #define NETIF_DEBUG      1
00051 #define PBUF_DEBUG       0
00052 #define DELIF_DEBUG      0
00053 #define DROPIF_DEBUG     0
00054 #define TUNIF_DEBUG      0
00055 #define UNIXIF_DEBUG     0
00056 #define TAPIF_DEBUG      0
00057 
00058 #define API_LIB_DEBUG    0
00059 #define API_MSG_DEBUG    0
00060 #define SOCKETS_DEBUG    1
00061 #define ICMP_DEBUG       0
00062 #define INET_DEBUG       0
00063 #define IP_DEBUG         0
00064 #define IP_REASS_DEBUG   1
00065 #define MEM_DEBUG        0
00066 #define MEMP_DEBUG       0
00067 #define SYS_DEBUG        0
00068 #define TCP_DEBUG        0
00069 #define TCP_INPUT_DEBUG  0
00070 #define TCP_FR_DEBUG     0
00071 #define TCP_RTO_DEBUG    0
00072 #define TCP_REXMIT_DEBUG 0
00073 #define TCP_CWND_DEBUG   0
00074 #define TCP_WND_DEBUG    0
00075 #define TCP_OUTPUT_DEBUG 0
00076 #define TCP_RST_DEBUG    0
00077 #define TCP_QLEN_DEBUG   0
00078 #define UDP_DEBUG        0
00079 #define TCPIP_DEBUG      0
00080 #define TCPDUMP_DEBUG    0
00081 #define DHCP_DEBUG       1
00082 
00083 #include <stdio.h>
00084 #define DEBUGF(debug, x) do { if(debug){ printf x; } } while(0)
00085 
00086 
00087 #else /* LWIP_DEBUG */
00088 
00089 /* DEBUG is not defined, so we define null macros for ASSERT and DEBUGF */
00090 
00091 #define ASSERT(x,y)
00092 #define DEBUGF(debug, x)
00093 
00094 /* And we define those to be zero: */
00095 
00096 #define DEMO_DEBUG       0
00097 #define ARP_DEBUG        0
00098 #define NETIF_DEBUG      0
00099 #define PBUF_DEBUG       0
00100 #define DELIF_DEBUG      0
00101 #define DROPIF_DEBUG     0
00102 #define TUNIF_DEBUG      0
00103 #define UNIXIF_DEBUG     0
00104 #define TAPIF_DEBUG      0
00105 #define API_LIB_DEBUG    0
00106 #define API_MSG_DEBUG    0
00107 #define SOCKETS_DEBUG    0
00108 #define ICMP_DEBUG       0
00109 #define INET_DEBUG       0
00110 #define IP_DEBUG         0
00111 #define IP_REASS_DEBUG   0
00112 #define MEM_DEBUG        0
00113 #define MEMP_DEBUG       0
00114 #define SYS_DEBUG        0
00115 #define TCP_DEBUG        0
00116 #define TCP_INPUT_DEBUG  0
00117 #define TCP_FR_DEBUG     0
00118 #define TCP_RTO_DEBUG    0
00119 #define TCP_REXMIT_DEBUG 0
00120 #define TCP_CWND_DEBUG   0
00121 #define TCP_WND_DEBUG    0
00122 #define TCP_OUTPUT_DEBUG 0
00123 #define TCP_RST_DEBUG    0
00124 #define TCP_QLEN_DEBUG   0
00125 #define UDP_DEBUG        0
00126 #define TCPIP_DEBUG      0
00127 #define TCPDUMP_DEBUG    0
00128 #define DHCP_DEBUG       0
00129 
00130 #endif /* LWIP_DEBUG */
00131 
00132 
00133 #endif /* __LWIP_DEBUG_H__ */
00134 
00135 
00136 
00137 
00138 
00139 

Generated on Wed Apr 28 17:49:32 2004 for Ubixos by doxygen 1.3.3