Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

184 lines
6.2 KiB

  1. /*++
  2. Copyright (c) 1993 Microsoft Corporation
  3. Module Name:
  4. vwdebug.h
  5. Abstract:
  6. Prototypes, structures, manifests, macros for VWIPXSPX debug routines
  7. Author:
  8. Richard L Firth (rfirth) 5-Oct-1993
  9. Revision History:
  10. 5-Oct-1993 rfirth
  11. Created
  12. --*/
  13. #ifndef _VWDEBUG_H_
  14. #define _VWDEBUG_H_
  15. //
  16. // debug flags
  17. //
  18. #define DEBUG_ANY 0xFFFFFFFF // any debug flags set
  19. #define DEBUG_NOTHING 0x00000001 // no debug output
  20. #define DEBUG_CHECK_INT 0x00080000 // check interrupts (DOS)
  21. #define DEBUG_STATS 0x00100000 // dump connection stats
  22. #define DEBUG_DATA 0x00200000 // dump data (send)
  23. #define DEBUG_FRAGMENTS 0x00400000 // dump fragments
  24. #define DEBUG_HEADERS 0x00800000 // dump IPX/SPX headers
  25. #define DEBUG_ECB 0x01000000 // dump 16-bit ECBs
  26. #define DEBUG_XECB 0x02000000 // dump 32-bit XECBs
  27. #define DEBUG_SOCKINFO 0x04000000 // dump SOCKET_INFO structs
  28. #define DEBUG_CONNINFO 0x08000000 // dump CONNECTION_INFO structs
  29. #define DEBUG_DLL 0x10000000 // include DLL attach/detach info
  30. #define DEBUG_FLUSH 0x20000000 // flush every write
  31. #define DEBUG_TO_FILE 0x40000000 // write debug stuff to file
  32. #define DEBUG_TO_DBG 0x80000000 // debug stuff to debugger
  33. #define VWDEBUG_FILE "VWDEBUG.LOG"
  34. //
  35. // function designators
  36. //
  37. #define FUNCTION_ANY 0xFFFFFFFF
  38. #define FUNCTION_IPXOpenSocket 0x00000001 // 0x00
  39. #define FUNCTION_IPXCloseSocket 0x00000002 // 0x01
  40. #define FUNCTION_IPXGetLocalTarget 0x00000004 // 0x02
  41. #define FUNCTION_IPXSendPacket 0x00000008 // 0x03
  42. #define FUNCTION_IPXListenForPacket 0x00000010 // 0x04
  43. #define FUNCTION_IPXScheduleIPXEvent 0x00000020 // 0x05
  44. #define FUNCTION_IPXCancelEvent 0x00000040 // 0x06
  45. #define FUNCTION_IPXScheduleAESEvent 0x00000080 // 0x07
  46. #define FUNCTION_IPXGetIntervalMarker 0x00000100 // 0x08
  47. #define FUNCTION_IPXGetInternetworkAddress 0x00000200 // 0x09
  48. #define FUNCTION_IPXRelinquishControl 0x00000400 // 0x0A
  49. #define FUNCTION_IPXDisconnectFromTarget 0x00000800 // 0x0B
  50. #define FUNCTION_InvalidFunction_0C 0x00001000 // 0x0C
  51. #define FUNCTION_InvalidFunction_0D 0x00002000 // 0x0D
  52. #define FUNCTION_InvalidFunction_0E 0x00004000 // 0x0E
  53. #define FUNCTION_InvalidFunction_0F 0x00008000 // 0x0F
  54. #define FUNCTION_SPXInitialize 0x00010000 // 0x10
  55. #define FUNCTION_SPXEstablishConnection 0x00020000 // 0x11
  56. #define FUNCTION_SPXListenForConnection 0x00040000 // 0x12
  57. #define FUNCTION_SPXTerminateConnection 0x00080000 // 0x13
  58. #define FUNCTION_SPXAbortConnection 0x00100000 // 0x14
  59. #define FUNCTION_SPXGetConnectionStatus 0x00200000 // 0x15
  60. #define FUNCTION_SPXSendSequencedPacket 0x00400000 // 0x16
  61. #define FUNCTION_SPXListenForSequencedPacket 0x00800000 // 0x17
  62. #define FUNCTION_InvalidFunction_18 0x01000000 // 0x18
  63. #define FUNCTION_InvalidFunction_19 0x02000000 // 0x19
  64. #define FUNCTION_IPXGetMaxPacketSize 0x04000000 // 0x1A
  65. #define FUNCTION_InvalidFunction_1B 0x08000000 // 0x1B
  66. #define FUNCTION_InvalidFunction_1C 0x10000000 // 0x1C
  67. #define FUNCTION_InvalidFunction_1D 0x20000000 // 0x1D
  68. #define FUNCTION_InvalidFunction_1E 0x40000000 // 0x1E
  69. #define FUNCTION_IPXGetInformation 0x80000000 // 0x1F
  70. #define FUNCTION_IPXSendWithChecksum 0xFFFFFFFF // 0x20
  71. #define FUNCTION_IPXGenerateChecksum 0xFFFFFFFF // 0x21
  72. #define FUNCTION_IPXVerifyChecksum 0xFFFFFFFF // 0x22
  73. //
  74. // debug levels
  75. //
  76. #define IPXDBG_LEVEL_ALL 0
  77. #define IPXDBG_LEVEL_INFO 1
  78. #define IPXDBG_LEVEL_WARNING 2
  79. #define IPXDBG_LEVEL_ERROR 3
  80. #define IPXDBG_LEVEL_FATAL 4
  81. #define IPXDBG_MIN_LEVEL IPXDBG_LEVEL_ALL
  82. #define IPXDBG_MAX_LEVEL IPXDBG_LEVEL_FATAL
  83. //
  84. // info dump flags (VWDUMP)
  85. //
  86. #define DUMP_ECB_IN 0x00000001
  87. #define DUMP_ECB_OUT 0x00000002
  88. #define DUMP_SEND_DATA 0x00000004
  89. #define DUMP_RECEIVE_DATA 0x00000008
  90. //
  91. // show flags
  92. //
  93. #define SHOW_ECBS 0x00000001 // show ECBs vs. raw data
  94. #define SHOW_HEADERS 0x00000002 // show IPX/SPX headers vs. raw data
  95. #if DBG
  96. extern DWORD VwDebugFlags;
  97. extern DWORD VwDebugFunctions;
  98. extern DWORD VwShow;
  99. extern DWORD DebugFlagsEx;
  100. #define IF_DEBUG(f) if (VwDebugFlags & DEBUG_ ## f)
  101. #define IF_NOT_DEBUG(f) if (!(VwDebugFlags & DEBUG_ ## f))
  102. #define IF_SHOW(f) if (VwShow & SHOW_ ## f)
  103. #define IF_NOT_SHOW(f) if (!(VwShow & SHOW_ ## f))
  104. #define PRIVATE
  105. #define IPXDBGPRINT(x) VwDebugPrint x
  106. #define IPXDBGSTART() VwDebugStart()
  107. #define IPXDBGEND() VwDebugEnd()
  108. #define VWASSERT(a, b) ASSERT((a) == (b))
  109. #define IPXDUMPDATA(x) VwDumpData x
  110. #define IPXDUMPECB(x) VwDumpEcb x
  111. #define DUMPXECB(x) VwDumpXecb(x)
  112. #define DUMPCONN(x) VwDumpConnectionInfo(x)
  113. #define DUMPSTATS(x) VwDumpConnectionStats(x)
  114. #define CHECK_INTERRUPTS(s) CheckInterrupts(s)
  115. #define DUMPALL() VwDumpAll()
  116. #else
  117. #define IF_DEBUG(f) if (0)
  118. #define IF_NOT_DEBUG(f) if (0)
  119. #define IF_SHOW(f) if (0)
  120. #define IF_NOT_SHOW(f) if (0)
  121. #define PRIVATE static
  122. #define IPXDBGPRINT(x)
  123. #define IPXDBGSTART()
  124. #define IPXDBGEND()
  125. #define VWASSERT(a, b) a
  126. #define IPXDUMPDATA(x)
  127. #define IPXDUMPECB(x)
  128. #define DUMPXECB(x)
  129. #define DUMPCONN(x)
  130. #define DUMPSTATS(x)
  131. #define CHECK_INTERRUPTS(s)
  132. #define DUMPALL()
  133. #endif
  134. //
  135. // debug function prototypes
  136. //
  137. extern VOID VwDebugStart(VOID);
  138. extern VOID VwDebugEnd(VOID);
  139. extern VOID VwDebugPrint(LPSTR, DWORD, DWORD, DWORD, LPSTR, ...);
  140. extern VOID VwDumpData(ULPBYTE, WORD, WORD, BOOL, WORD);
  141. extern VOID VwDumpEcb(LPECB, WORD, WORD, BYTE, BOOL, BOOL, BOOL);
  142. extern VOID VwDumpFragment(WORD, LPFRAGMENT, BYTE, BOOL, BOOL);
  143. extern VOID VwDumpPacketHeader(ULPBYTE, BYTE);
  144. extern VOID VwDumpXecb(LPXECB);
  145. extern VOID VwDumpSocketInfo(LPSOCKET_INFO);
  146. extern VOID VwDumpConnectionInfo(LPCONNECTION_INFO);
  147. extern VOID VwDumpConnectionStats(LPSPX_CONNECTION_STATS);
  148. extern VOID VwLog(LPSTR);
  149. extern VOID CheckInterrupts(LPSTR);
  150. extern VOID VwDumpAll(VOID);
  151. #endif // _VWDEBUG_H_