Witness: set col_info for interfaceInfo_state
[wireshark-wip.git] / epan / crypt / airpdcap_debug.h
blob323d564fb97dba222132329d039753e14844a19d
1 /* airpcap_debug.h
3 * $Id$
5 * Copyright (c) 2006 CACE Technologies, Davis (California)
6 * All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
20 * Alternatively, this software may be distributed under the terms of the
21 * GNU General Public License ("GPL") version 2 as published by the Free
22 * Software Foundation.
24 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
37 #ifndef _AIRPDCAP_DEBUG_H
38 #define _AIRPDCAP_DEBUG_H
40 #include "airpdcap_interop.h"
42 void print_debug_line(const CHAR *function, const CHAR *msg, const INT level);
44 #ifdef _DEBUG
45 #ifdef __FUNCTION__
46 #define AIRPDCAP_DEBUG_PRINT_LINE(notdefined, msg, level) print_debug_line(__FUNCTION__, msg, level);
47 #else
48 #define AIRPDCAP_DEBUG_PRINT_LINE(function, msg, level) print_debug_line(function, msg, level);
49 #endif
50 #else
51 #ifdef __FUNCTION__
52 #define AIRPDCAP_DEBUG_PRINT_LINE(notdefined, msg, level)
53 #else
54 #define AIRPDCAP_DEBUG_PRINT_LINE(function, msg, level)
55 #endif
56 #endif
58 /******************************************************************************/
59 /* Debug section: internal function to print debug information */
60 /* */
61 #ifdef _DEBUG
62 #include <stdio.h>
63 #include <time.h>
65 /* Debug level definition */
66 #define AIRPDCAP_DEBUG_LEVEL_1 1
67 #define AIRPDCAP_DEBUG_LEVEL_2 2
68 #define AIRPDCAP_DEBUG_LEVEL_3 3
69 #define AIRPDCAP_DEBUG_LEVEL_4 4
70 #define AIRPDCAP_DEBUG_LEVEL_5 5
72 #define AIRPDCAP_DEBUG_USED_LEVEL AIRPDCAP_DEBUG_LEVEL_3
74 #ifdef _TRACE
75 #ifdef __FUNCTION__
76 #define AIRPDCAP_DEBUG_TRACE_START(notdefined) print_debug_line(__FUNCTION__, "Start!", AIRPDCAP_DEBUG_USED_LEVEL);
77 #define AIRPDCAP_DEBUG_TRACE_END(notdefined) print_debug_line(__FUNCTION__, "End!", AIRPDCAP_DEBUG_USED_LEVEL);
78 #else
79 #define AIRPDCAP_DEBUG_TRACE_START(function) print_debug_line(function, "Start!", AIRPDCAP_DEBUG_USED_LEVEL);
80 #define AIRPDCAP_DEBUG_TRACE_END(function) print_debug_line(function, "End!", AIRPDCAP_DEBUG_USED_LEVEL);
81 #endif
82 #else
83 #ifdef __FUNCTION__
84 #define AIRPDCAP_DEBUG_TRACE_START(notdefined)
85 #define AIRPDCAP_DEBUG_TRACE_END(notdefined)
86 #else
87 #define AIRPDCAP_DEBUG_TRACE_START(function)
88 #define AIRPDCAP_DEBUG_TRACE_END(function)
89 #endif
90 #endif
92 #define DEBUG_DUMP(x,y,z) g_warning("%s: %s", x, bytes_to_str(y, (z)))
94 #else /* !defined _DEBUG */
96 #define AIRPDCAP_DEBUG_LEVEL_1
97 #define AIRPDCAP_DEBUG_LEVEL_2
98 #define AIRPDCAP_DEBUG_LEVEL_3
99 #define AIRPDCAP_DEBUG_LEVEL_4
100 #define AIRPDCAP_DEBUG_LEVEL_5
102 #define AIRPDCAP_DEBUG_TRACE_START(function)
103 #define AIRPDCAP_DEBUG_TRACE_END(function)
105 #define DEBUG_DUMP(x,y,z)
107 #endif /* ?defined _DEBUG */
110 #endif /* ?defined _AIRPDCAP_DEBUG_H */