VirtualBox

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

Last change on this file since 79494 was 76553, checked in by vboxsync, 6 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1/* $Id: debug.h 76553 2019-01-01 01:45:53Z vboxsync $ */
2/** @file
3 * NAT - debug helpers (declarations/defines).
4 */
5
6/*
7 * Copyright (C) 2006-2019 Oracle Corporation
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
18/*
19 * This code is based on:
20 *
21 * Copyright (c) 1995 Danny Gasparovski.
22 *
23 * Please read the file COPYRIGHT for the
24 * terms and conditions of the copyright.
25 */
26
27#ifndef _DEBUG_H_
28#define _DEBUG_H_
29
30#include <VBox/log.h>
31/* we've excluded stdio.h */
32#define FILE void
33
34int debug_init (PNATState);
35void ipstats (PNATState);
36void tcpstats (PNATState);
37void udpstats (PNATState);
38void icmpstats (PNATState);
39void mbufstats (PNATState);
40void sockstats (PNATState);
41
42#ifdef LOG_ENABLED
43# define TCP_STATE_SWITCH_TO(tp, new_tcp_state) \
44 do { \
45 Log2(("%R[tcpcb793] switch to %R[tcpstate] -> %R[tcpstate]\n", (tp), (tp->t_state) ,(new_tcp_state))); \
46 if ((tp)->t_socket) \
47 Log2(("%R[tcpcb793] %R[natsock]\n", (tp), (tp)->t_socket)); \
48 (tp)->t_state = (new_tcp_state); \
49 } while (0)
50#else
51# define TCP_STATE_SWITCH_TO(tp, new_tcp_state) (tp)->t_state = (new_tcp_state)
52#endif
53
54/* TCP CB state validity macro definitions
55 * we need to be sure that TCP is in right state.
56 * TCP_ACCEPTABLE_STATEX(tp, (X-states here))
57 */
58#ifdef DEBUG_vvl
59# define TCP_ACCEPTABLE_STATE1(tp, tcp_state1) Assert((tp)->t_state == (tcp_state))
60# define TCP_ACCEPTABLE_STATE2(tp, tcp_state1, tcp_state2) \
61 Assert( (tp)->t_state == (tcp_state1) \
62 || (tp)->t_state == (tcp_state2) ); \
63#else
64# define TCP_ACCEPTABLE_STATE1(tp, tcp_state1) do { } while(0)
65# define TCP_ACCEPTABLE_STATE2(tp, tcp_state1, tcp_state2) do { } while(0)
66#endif
67#endif
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