Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

/opentcp/include/inet/debug.h

Go to the documentation of this file.
00001 /*
00002  *Copyright (c) 2000-2002 Viola Systems Ltd.
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  *
00009  *1. Redistributions of source code must retain the above copyright 
00010  *notice, this list of conditions and the following disclaimer.
00011  *
00012  *2. Redistributions in binary form must reproduce the above copyright 
00013  *notice, this list of conditions and the following disclaimer in the 
00014  *documentation and/or other materials provided with the distribution.
00015  *
00016  *3. The end-user documentation included with the redistribution, if 
00017  *any, must include the following acknowledgment:
00018  *      "This product includes software developed by Viola 
00019  *      Systems (http://www.violasystems.com/)."
00020  *
00021  *Alternately, this acknowledgment may appear in the software itself, 
00022  *if and wherever such third-party acknowledgments normally appear.
00023  *
00024  *4. The names "OpenTCP" and "Viola Systems" must not be used to 
00025  *endorse or promote products derived from this software without prior 
00026  *written permission. For written permission, please contact 
00027  *opentcp@opentcp.org.
00028  *
00029  *5. Products derived from this software may not be called "OpenTCP", 
00030  *nor may "OpenTCP" appear in their name, without prior written 
00031  *permission of the Viola Systems Ltd.
00032  *
00033  *THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED 
00034  *WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
00035  *MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
00036  *IN NO EVENT SHALL VIOLA SYSTEMS LTD. OR ITS CONTRIBUTORS BE LIABLE 
00037  *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
00038  *CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
00039  *SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
00040  *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
00041  *WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
00042  *OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
00043  *EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00044  *====================================================================
00045  *
00046  *OpenTCP is the unified open source TCP/IP stack available on a series 
00047  *of 8/16-bit microcontrollers, please see <http://www.opentcp.org>.
00048  *
00049  *For more information on how to network-enable your devices, or how to 
00050  *obtain commercial technical support for OpenTCP, please see 
00051  *<http://www.violasystems.com/>.
00052  */
00053 
00072 #ifndef INCLUDE_DEBUG_H
00073 #define INCLUDE_DEBUG_H
00074 
00075 #include <inet/datatypes.h>
00076 #include <inet/system.h>
00077 
00078 /* User Settings                                                                        */
00079 
00080 #define DEBUG   0               
00090 /* Choose modules that will be debugged 
00091  * works only if ((DEBUG == 1)&&(xxx_DEBUG==1))
00092  */
00093 #define ETHERNET_DEBUG  0       
00094 #define IP_DEBUG                0       
00095 #define ICMP_DEBUG              0       
00096 #define ARP_DEBUG               0       
00097 #define TCP_DEBUG               0       
00098 #define UDP_DEBUG               0       
00099 #define TIMERS_DEBUG    0       
00101 /****************************************************/
00102 /* Do not modify if not needed                                          */
00103 /****************************************************/
00104 
00105 #if DEBUG == 1
00106 
00107 #define DEBUGOUT(c);            mputs(c);
00108 
00109 #if ETHERNET_DEBUG == 1
00110 #define ETH_DEBUGOUT(c);                mputs(c);
00111 #else
00112 #define ETH_DEBUGOUT(c);                {};
00113 #endif
00114 
00115 #if IP_DEBUG == 1
00116 #define IP_DEBUGOUT(c);                 mputs(c);
00117 #else
00118 #define IP_DEBUGOUT(c);                 {};
00119 #endif
00120 
00121 #if ICMP_DEBUG == 1
00122 #define ICMP_DEBUGOUT(c);               mputs(c);
00123 #else
00124 #define ICMP_DEBUGOUT(c);               {};
00125 #endif
00126 
00127 #if ARP_DEBUG == 1
00128 #define ARP_DEBUGOUT(c);                mputs(c);
00129 #else
00130 #define ARP_DEBUGOUT(c);                {};
00131 #endif
00132 
00133 #if TCP_DEBUG == 1
00134 #define TCP_DEBUGOUT(c);                mputs(c);
00135 #else
00136 #define TCP_DEBUGOUT(c);                {};
00137 #endif
00138 
00139 #if UDP_DEBUG == 1
00140 #define UDP_DEBUGOUT(c);                mputs(c);
00141 #else
00142 #define UDP_DEBUGOUT(c);                {};
00143 #endif
00144 
00145 #if TIMERS_DEBUG == 1
00146 #define TMR_DEBUGOUT(c);                mputs(c);
00147 #else
00148 #define TMR_DEBUGOUT(c);                {};
00149 #endif
00150 
00151 #else
00152 /* everything turned off because DEBUG == 0*/
00153 #define DEBUGOUT(c);            {};
00154 
00155 #define ETH_DEBUGOUT(c);                {};
00156 #define IP_DEBUGOUT(c);                 {};
00157 #define ICMP_DEBUGOUT(c);               {};
00158 #define ARP_DEBUGOUT(c);                {};
00159 #define TCP_DEBUGOUT(c);                {};
00160 #define UDP_DEBUGOUT(c);                {};
00161 #define TMR_DEBUGOUT(c);                {};
00162 
00163 #endif
00164 
00165 #endif          /* Include      */
00166 

Generated on Sun Aug 3 20:32:59 2003 for OpenTCP by doxygen1.2.18