VirtualBox

source: vbox/trunk/src/VBox/Devices/Network/slirp/debug.h@ 15074

Last change on this file since 15074 was 15074, checked in by vboxsync, 16 years ago

slirp: better readability

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1/*
2 * Copyright (c) 1995 Danny Gasparovski.
3 *
4 * Please read the file COPYRIGHT for the
5 * terms and conditions of the copyright.
6 */
7
8#define PRN_STDERR 1
9#define PRN_SPRINTF 2
10
11/* Unused anyway, using VBox Log facility. */
12#define dfd NULL
13
14#define DBG_CALL 0x1
15#define DBG_MISC 0x2
16#define DBG_ERROR 0x4
17#define DEBUG_DEFAULT DBG_CALL|DBG_MISC|DBG_ERROR
18
19#include <VBox/log.h>
20
21#ifdef LOG_ENABLED
22#define DEBUG_CALL(x) LogFlow(("%s:\n", x))
23#define DEBUG_ARG(x, y) do { LogFlow((x, y)); LogFlow(("\n")); } while (0)
24#define DEBUG_ARGS(x) __debug_flow x
25#define DEBUG_MISC(x) __debug_log2 x
26#define DEBUG_ERROR(x) __debug_log x
27
28DECLINLINE(void) __debug_flow(FILE *pIgnore, const char *pszFormat, ...)
29{
30 va_list args;
31 va_start(args, pszFormat);
32 LogFlow(("%Nv\n", pszFormat, &args));
33 va_end(args);
34}
35
36DECLINLINE(void) __debug_log2(FILE *pIgnore, const char *pszFormat, ...)
37{
38 va_list args;
39 va_start(args, pszFormat);
40 Log2(("%Nv\n", pszFormat, &args));
41 va_end(args);
42}
43
44DECLINLINE(void) __debug_log(FILE *pIgnore, const char *pszFormat, ...)
45{
46 va_list args;
47 va_start(args, pszFormat);
48 Log(("%Nv\n", pszFormat, &args));
49 va_end(args);
50}
51
52#else /* !LOG_ENABLED */
53
54#define DEBUG_CALL(x) do {} while (0)
55#define DEBUG_ARG(x, y) do {} while (0)
56#define DEBUG_ARGS(x) do {} while (0)
57#define DEBUG_MISC(x) do {} while (0)
58#define DEBUG_ERROR(x) do {} while (0)
59
60#endif /* !LOG_ENABLED */
61
62int debug_init _P((void));
63void ipstats _P((PNATState));
64void tcpstats _P((PNATState));
65void udpstats _P((PNATState));
66void icmpstats _P((PNATState));
67void mbufstats _P((PNATState));
68void sockstats _P((PNATState));
69
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette