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 | /* we've excluded stdio.h */
|
---|
21 | # define FILE void
|
---|
22 |
|
---|
23 | #ifdef LOG_ENABLED
|
---|
24 | #define DEBUG_CALL(x) LogFlow(("%s:\n", x))
|
---|
25 | #define DEBUG_ARG(x, y) do { LogFlow((x, y)); LogFlow(("\n")); } while (0)
|
---|
26 | #define DEBUG_ARGS(x) __debug_flow x
|
---|
27 | #define DEBUG_MISC(x) __debug_log2 x
|
---|
28 | #define DEBUG_ERROR(x) __debug_log x
|
---|
29 |
|
---|
30 | DECLINLINE(void) __debug_flow(FILE *pIgnore, const char *pszFormat, ...)
|
---|
31 | {
|
---|
32 | va_list args;
|
---|
33 | va_start(args, pszFormat);
|
---|
34 | LogFlow(("%Nv\n", pszFormat, &args));
|
---|
35 | va_end(args);
|
---|
36 | }
|
---|
37 |
|
---|
38 | DECLINLINE(void) __debug_log2(FILE *pIgnore, const char *pszFormat, ...)
|
---|
39 | {
|
---|
40 | va_list args;
|
---|
41 | va_start(args, pszFormat);
|
---|
42 | Log2(("%Nv\n", pszFormat, &args));
|
---|
43 | va_end(args);
|
---|
44 | }
|
---|
45 |
|
---|
46 | DECLINLINE(void) __debug_log(FILE *pIgnore, const char *pszFormat, ...)
|
---|
47 | {
|
---|
48 | va_list args;
|
---|
49 | va_start(args, pszFormat);
|
---|
50 | Log(("%Nv\n", pszFormat, &args));
|
---|
51 | va_end(args);
|
---|
52 | }
|
---|
53 |
|
---|
54 | #else /* !LOG_ENABLED */
|
---|
55 |
|
---|
56 | #define DEBUG_CALL(x) do {} while (0)
|
---|
57 | #define DEBUG_ARG(x, y) do {} while (0)
|
---|
58 | #define DEBUG_ARGS(x) do {} while (0)
|
---|
59 | #define DEBUG_MISC(x) do {} while (0)
|
---|
60 | #define DEBUG_ERROR(x) do {} while (0)
|
---|
61 |
|
---|
62 | #endif /* !LOG_ENABLED */
|
---|
63 |
|
---|
64 | int debug_init (void);
|
---|
65 | void ipstats (PNATState);
|
---|
66 | void tcpstats (PNATState);
|
---|
67 | void udpstats (PNATState);
|
---|
68 | void icmpstats (PNATState);
|
---|
69 | void mbufstats (PNATState);
|
---|
70 | void sockstats (PNATState);
|
---|
71 |
|
---|