VirtualBox

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

Last change on this file since 28520 was 28450, checked in by vboxsync, 15 years ago

addendum to r60221.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1/* $Id: debug.h 28450 2010-04-19 09:59:27Z vboxsync $ */
2/** @file
3 * NAT - debug helpers (declarations/defines).
4 */
5
6/*
7 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22/*
23 * This code is based on:
24 *
25 * Copyright (c) 1995 Danny Gasparovski.
26 *
27 * Please read the file COPYRIGHT for the
28 * terms and conditions of the copyright.
29 */
30
31#define PRN_STDERR 1
32#define PRN_SPRINTF 2
33
34/* Unused anyway, using VBox Log facility. */
35#define dfd NULL
36
37#define DBG_CALL 0x1
38#define DBG_MISC 0x2
39#define DBG_ERROR 0x4
40#define DEBUG_DEFAULT DBG_CALL|DBG_MISC|DBG_ERROR
41
42#include <VBox/log.h>
43/* we've excluded stdio.h */
44# define FILE void
45
46#ifdef LOG_ENABLED
47#define DEBUG_CALL(x) LogFlow(("%s:\n", x))
48#define DEBUG_ARG(x, y) do { LogFlow((x, y)); LogFlow(("\n")); } while (0)
49#define DEBUG_ARGS(x) __debug_flow x
50#define DEBUG_MISC(x) __debug_log2 x
51#define DEBUG_ERROR(x) __debug_log x
52
53DECLINLINE(void) __debug_flow(FILE *pIgnore, const char *pszFormat, ...)
54{
55 va_list args;
56 va_start(args, pszFormat);
57 LogFlow(("%Nv\n", pszFormat, &args));
58 va_end(args);
59}
60
61DECLINLINE(void) __debug_log2(FILE *pIgnore, const char *pszFormat, ...)
62{
63 va_list args;
64 va_start(args, pszFormat);
65 Log2(("%Nv\n", pszFormat, &args));
66 va_end(args);
67}
68
69DECLINLINE(void) __debug_log(FILE *pIgnore, const char *pszFormat, ...)
70{
71 va_list args;
72 va_start(args, pszFormat);
73 Log(("%Nv\n", pszFormat, &args));
74 va_end(args);
75}
76
77#else /* !LOG_ENABLED */
78
79#define DEBUG_CALL(x) do {} while (0)
80#define DEBUG_ARG(x, y) do {} while (0)
81#define DEBUG_ARGS(x) do {} while (0)
82#define DEBUG_MISC(x) do {} while (0)
83#define DEBUG_ERROR(x) do {} while (0)
84
85#endif /* !LOG_ENABLED */
86
87int debug_init (void);
88void ipstats (PNATState);
89void tcpstats (PNATState);
90void udpstats (PNATState);
91void icmpstats (PNATState);
92void mbufstats (PNATState);
93void sockstats (PNATState);
94
Note: See TracBrowser for help on using the repository browser.

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