Mbed OS Reference
Loading...
Searching...
No Matches
pppdebug.h
1/*****************************************************************************
2* /@code
3*
4* pppdebug.h - System debugging utilities.
5*
6* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
7* portions Copyright (c) 1998 Global Election Systems Inc.
8* portions Copyright (c) 2001 by Cognizant Pty Ltd.
9*
10* The authors hereby grant permission to use, copy, modify, distribute,
11* and license this software and its documentation for any purpose, provided
12* that existing copyright notices are retained in all copies and that this
13* notice and the following disclaimer are included verbatim in any
14* distributions. No written agreement, license, or royalty fee is required
15* for any of the authorized uses.
16*
17* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
18* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20* IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27*
28******************************************************************************
29* REVISION HISTORY (please don't use tabs!)
30*
31* 03-01-01 Marc Boucher <marc@mbsi.ca>
32* Ported to lwIP.
33* 98-07-29 Guy Lancaster <lancasterg@acm.org>, Global Election Systems Inc.
34* Original.
35*
36* /@endcode
37*****************************************************************************
38*/
39
40#include "ppp_opts.h"
41#if PPP_SUPPORT /* don't build if not configured for use in ppp_opts.h */
42
43#ifndef PPPDEBUG_H
44#define PPPDEBUG_H
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50#if PPP_DEBUG
51#if MBED_CONF_MBED_TRACE_ENABLE
52#include "mbed_trace.h"
53#define TRACE_GROUP "ppp"
54#define PPP_DEBUGF(level, message) tr_info message
55#else
56#define PPP_DEBUGF(level, message) printf message
57#endif
58#else
59#define PPP_DEBUGF(level, message)
60#endif
61
62#define PPP_DBG_LEVEL_ALL 0x00
63#define PPP_DBG_LEVEL_WARNING 0x01
64#define PPP_DBG_LEVEL_SERIOUS 0x02
65#define PPP_DBG_LEVEL_SEVERE 0x03
66
67/* Trace levels. */
68#define LOG_CRITICAL (PPP_DEBUG | PPP_DBG_LEVEL_SEVERE)
69#define LOG_ERR (PPP_DEBUG | PPP_DBG_LEVEL_SEVERE)
70#define LOG_NOTICE (PPP_DEBUG | PPP_DBG_LEVEL_WARNING)
71#define LOG_WARNING (PPP_DEBUG | PPP_DBG_LEVEL_WARNING)
72#define LOG_INFO (PPP_DEBUG)
73#define LOG_DETAIL (PPP_DEBUG)
74#define LOG_DEBUG (PPP_DEBUG)
75
76#if PPP_DEBUG
77
78#define MAINDEBUG(a) PPP_DEBUGF(PPP_DBG_LEVEL_WARNING, a)
79#define SYSDEBUG(a) PPP_DEBUGF(PPP_DBG_LEVEL_WARNING, a)
80#define FSMDEBUG(a) PPP_DEBUGF(PPP_DBG_LEVEL_WARNING, a)
81#define LCPDEBUG(a) PPP_DEBUGF(PPP_DBG_LEVEL_WARNING, a)
82#define IPCPDEBUG(a) PPP_DEBUGF(PPP_DBG_LEVEL_WARNING, a)
83#define IPV6CPDEBUG(a) PPP_DEBUGF(PPP_DBG_LEVEL_WARNING, a)
84#define UPAPDEBUG(a) PPP_DEBUGF(PPP_DBG_LEVEL_WARNING, a)
85#define CHAPDEBUG(a) PPP_DEBUGF(PPP_DBG_LEVEL_WARNING, a)
86#define PPPDEBUG(a, b) PPP_DEBUGF(a, b)
87
88#else /* PPP_DEBUG */
89
90#define MAINDEBUG(a)
91#define SYSDEBUG(a)
92#define FSMDEBUG(a)
93#define LCPDEBUG(a)
94#define IPCPDEBUG(a)
95#define IPV6CPDEBUG(a)
96#define UPAPDEBUG(a)
97#define CHAPDEBUG(a)
98#define PPPDEBUG(a, b)
99
100#endif /* PPP_DEBUG */
101
102#ifdef __cplusplus
103}
104#endif
105
106#endif /* PPPDEBUG_H */
107
108#endif /* PPP_SUPPORT */