/[lwip]/lwip/src/include/lwip/debug.h
ViewVC logotype

Diff of /lwip/src/include/lwip/debug.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by davidhaas, Tue Feb 18 19:27:48 2003 UTC revision 1.13 by likewise, Thu Feb 20 13:13:54 2003 UTC
# Line 32  Line 32 
32  #ifndef __LWIP_DEBUG_H__  #ifndef __LWIP_DEBUG_H__
33  #define __LWIP_DEBUG_H__  #define __LWIP_DEBUG_H__
34    
35  #include "lwipopts.h"  #include "arch/cc.h"
36    
37  #ifdef LWIP_DEBUG  /** lower two bits indicate debug level
38     * - 0 off
39     * - 1 warning
40     * - 2 serious
41     * - 3 severe
42     */
43    #define DBG_MASK_LEVEL 3
44    
45    /** print only debug messages with this level or higher */
46    #define DBG_MIN_LEVEL 0
47    
48    /** flag for DEBUGF to enable the debug message */
49    #define DBG_ON  0x80U
50    /** flag for DEBUGF to disable the debug message */
51    #define DBG_OFF 0x00U
52    
53    /** flag for DEBUGF to indicate it is a tracing message (to follow program flow) */
54    #define DBG_TRACE   0x40
55    /** flag for DEBUGF to indicate it is a state debug message (to follow states) */
56    #define DBG_STATE   0x20
57    /** flag for DEBUGF that indicates newly added code, not thoroughly tested yet */
58    #define DBG_FRESH   0x10
59    /** flag for DEBUGF to halt after printing this debug message */
60    #define DBG_HALT    0x08
61    
62  #define LWIP_ASSERT(x,y) do { if(!(y)) LWIP_PLATFORM_ASSERT(x); } while(0)  #define LWIP_ASSERT(x,y) do { if(!(y)) LWIP_PLATFORM_ASSERT(x); } while(0)
63  #define DEBUGF(debug, x) do { if(debug) LWIP_PLATFORM_DIAG(x); } while(0)  /** print debug message only if debug message is enabled AND is of correct type
64      * AND is at least DBG_LEVEL */
65    #define DEBUGF(debug, x) do { if ((debug & DBG_ON) && (debug & DBG_TYPES_ON) && ((debug & DBG_MASK_LEVEL) >= DBG_MIN_LEVEL)) { LWIP_PLATFORM_DIAG(x); if (debug & DBG_HALT) while(1); } } while(0)
66  #define LWIP_ERROR(x)    do { LWIP_PLATFORM_DIAG(x); } while(0)  #define LWIP_ERROR(x)    do { LWIP_PLATFORM_DIAG(x); } while(0)
67    
68  /* These defines control the amount of debugging output: */  #ifndef LWIP_DEBUG
 #define MEM_TRACKING  
69    
70  #ifndef DEMO_DEBUG  #define LWIP_ASSERT(x,y)
71  #define DEMO_DEBUG       0  #define DEBUGF(debug, x)
72  #endif  #define LWIP_ERROR(x)  
73    
74  #ifndef ETHARP_DEBUG  
75  #define ETHARP_DEBUG     0  #define DBG_TYPES_ON 0U
76  #endif  
77     /**
78  #ifndef NETIF_DEBUG   * Disable all debug messages
79  #define NETIF_DEBUG      0   */
80  #endif  #define DEMO_DEBUG       DBG_OFF
81    #define ETHARP_DEBUG     DBG_OFF
82  #ifndef PBUF_DEBUG  #define NETIF_DEBUG      DBG_OFF
83  #define PBUF_DEBUG       0  #define PBUF_DEBUG       DBG_OFF
84  #endif  #define DELIF_DEBUG      DBG_OFF
85    #define DROPIF_DEBUG     DBG_OFF
86  #ifndef DELIF_DEBUG  #define TUNIF_DEBUG      DBG_OFF
87  #define DELIF_DEBUG      0  #define UNIXIF_DEBUG     DBG_OFF
88  #endif  #define TAPIF_DEBUG      DBG_OFF
89    #define SIO_FIFO_DEBUG   DBG_OFF
90  #ifndef DROPIF_DEBUG  #define PPP_DEBUG        DBG_OFF
91  #define DROPIF_DEBUG     0  #define API_LIB_DEBUG    DBG_OFF
92  #endif  #define API_MSG_DEBUG    DBG_OFF
93    #define SOCKETS_DEBUG    DBG_OFF
94  #ifndef TUNIF_DEBUG  #define ICMP_DEBUG       DBG_OFF
95  #define TUNIF_DEBUG      0  #define INET_DEBUG       DBG_OFF
96  #endif  #define IP_DEBUG         DBG_OFF
97    #define IP_REASS_DEBUG   DBG_OFF
98  #ifndef UNIXIF_DEBUG  #define MEM_DEBUG        DBG_OFF
99  #define UNIXIF_DEBUG     0  #define MEMP_DEBUG       DBG_OFF
100  #endif  #define SYS_DEBUG        DBG_OFF
101    #define TCP_DEBUG        DBG_OFF
102  #ifndef TAPIF_DEBUG  #define TCP_INPUT_DEBUG  DBG_OFF
103  #define TAPIF_DEBUG      0  #define TCP_FR_DEBUG     DBG_OFF
104  #endif  #define TCP_RTO_DEBUG    DBG_OFF
105    #define TCP_REXMIT_DEBUG DBG_OFF
106  #ifndef SIO_FIFO_DEBUG  #define TCP_CWND_DEBUG   DBG_OFF
107  #define SIO_FIFO_DEBUG   0  #define TCP_WND_DEBUG    DBG_OFF
108  #endif  #define TCP_OUTPUT_DEBUG DBG_OFF
109    #define TCP_RST_DEBUG    DBG_OFF
110  #ifndef SLIP_DEBUG  #define TCP_QLEN_DEBUG   DBG_OFF
111  #define SLIP_DEBUG        0  #define UDP_DEBUG        DBG_OFF
112  #endif  #define TCPIP_DEBUG      DBG_OFF
113    #define TCPDUMP_DEBUG    DBG_OFF
114  #ifndef PPP_DEBUG  #define DHCP_DEBUG       DBG_OFF
 #define PPP_DEBUG        0  
 #endif  
   
 #ifndef API_LIB_DEBUG  
 #define API_LIB_DEBUG    0  
 #endif  
   
 #ifndef API_MSG_DEBUG  
 #define API_MSG_DEBUG    0  
 #endif  
   
 #ifndef SOCKETS_DEBUG  
 #define SOCKETS_DEBUG    0  
 #endif  
   
 #ifndef ICMP_DEBUG  
 #define ICMP_DEBUG       0  
 #endif  
   
 #ifndef INET_DEBUG  
 #define INET_DEBUG       0  
 #endif  
   
 #ifndef IP_DEBUG  
 #define IP_DEBUG         0  
 #endif  
   
 #ifndef IP_REASS_DEBUG  
 #define IP_REASS_DEBUG   0  
 #endif  
   
 #ifndef MEM_DEBUG  
 #define MEM_DEBUG        0  
 #endif  
   
 #ifndef MEMP_DEBUG  
 #define MEMP_DEBUG       0  
 #endif  
   
 #ifndef SYS_DEBUG  
 #define SYS_DEBUG        0  
 #endif  
   
 #ifndef TCP_DEBUG  
 #define TCP_DEBUG        0  
 #endif  
   
 #ifndef TCP_INPUT_DEBUG  
 #define TCP_INPUT_DEBUG  0  
 #endif  
   
 #ifndef TCP_FR_DEBUG  
 #define TCP_FR_DEBUG     0  
 #endif  
   
 #ifndef TCP_RTO_DEBUG  
 #define TCP_RTO_DEBUG    0  
 #endif  
   
 #ifndef TCP_REXMIT_DEBUG  
 #define TCP_REXMIT_DEBUG 0  
 #endif  
   
 #ifndef TCP_CWND_DEBUG  
 #define TCP_CWND_DEBUG   0  
 #endif  
   
 #ifndef TCP_WND_DEBUG  
 #define TCP_WND_DEBUG    0  
 #endif  
   
 #ifndef TCP_OUTPUT_DEBUG  
 #define TCP_OUTPUT_DEBUG 0  
 #endif  
   
 #ifndef TCP_RST_DEBUG  
 #define TCP_RST_DEBUG    0  
 #endif  
   
 #ifndef TCP_QLEN_DEBUG  
 #define TCP_QLEN_DEBUG   0  
 #endif  
   
 #ifndef UDP_DEBUG  
 #define UDP_DEBUG        0  
 #endif  
   
 #ifndef TCPIP_DEBUG  
 #define TCPIP_DEBUG      0  
 #endif  
   
 #ifndef TCPDUMP_DEBUG  
 #define TCPDUMP_DEBUG    0  
 #endif  
   
 #ifndef DHCP_DEBUG  
 #define DHCP_DEBUG       0  
 #endif  
   
   
   
 #else /* LWIP_DEBUG */  
   
 /* DEBUG is not defined, so we define null macros for LWIP_ASSERT , DEBUGF and LWIP_ERROR */  
   
 #define LWIP_ASSERT(x,y)  
 #define DEBUGF(debug, x)  
 #define LWIP_ERROR(x)  
   
 /* And we define those to be zero: */  
   
 #define DEMO_DEBUG       0  
 #define ETHARP_DEBUG     0  
 #define NETIF_DEBUG      0  
 #define PBUF_DEBUG       0  
 #define DELIF_DEBUG      0  
 #define DROPIF_DEBUG     0  
 #define TUNIF_DEBUG      0  
 #define UNIXIF_DEBUG     0  
 #define TAPIF_DEBUG      0  
 #define SIO_FIFO_DEBUG   0  
 #define PPP_DEBUG        0  
 #define API_LIB_DEBUG    0  
 #define API_MSG_DEBUG    0  
 #define SOCKETS_DEBUG    0  
 #define ICMP_DEBUG       0  
 #define INET_DEBUG       0  
 #define IP_DEBUG         0  
 #define IP_REASS_DEBUG   0  
 #define MEM_DEBUG        0  
 #define MEMP_DEBUG       0  
 #define SYS_DEBUG        0  
 #define TCP_DEBUG        0  
 #define TCP_INPUT_DEBUG  0  
 #define TCP_FR_DEBUG     0  
 #define TCP_RTO_DEBUG    0  
 #define TCP_REXMIT_DEBUG 0  
 #define TCP_CWND_DEBUG   0  
 #define TCP_WND_DEBUG    0  
 #define TCP_OUTPUT_DEBUG 0  
 #define TCP_RST_DEBUG    0  
 #define TCP_QLEN_DEBUG   0  
 #define UDP_DEBUG        0  
 #define TCPIP_DEBUG      0  
 #define TCPDUMP_DEBUG    0  
 #define DHCP_DEBUG       0  
115    
116  #endif /* LWIP_DEBUG */  #endif /* LWIP_DEBUG */
117    

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26