Leaked source code of windows server 2003
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.

177 lines
5.0 KiB

  1. /*++
  2. Copyright (c) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. debug.h
  5. Abstract:
  6. This file contains all the debugging related structures/macros.
  7. Author:
  8. Sanjay Anand (SanjayAn) 2-January-1997
  9. ChunYe
  10. Environment:
  11. Kernel mode
  12. Revision History:
  13. --*/
  14. #define DBF_EXTRADIAGNOSTIC 0x80000000
  15. #ifdef RUN_WPP
  16. #include "ipsecwpp.h"
  17. #if DBG
  18. #define IPSEC_DEBUG_KD_ONLY(_Flag, _Print) { \
  19. if (IPSecDebug & (_Flag)) { \
  20. DbgPrint ("IPSEC: "); \
  21. DbgPrint _Print; \
  22. DbgPrint ("\n"); \
  23. } \
  24. }
  25. #define IPSEC_PRINT_CONTEXT(_Context)
  26. #define IPSEC_PRINT_MDL(_Mdl)
  27. #else // DBG
  28. #define IPSEC_DEBUG_KD_ONLY(_Flag, _Print)
  29. #endif
  30. #else // RUN_WPP
  31. #if DBG
  32. #define DBF_LOAD 0x00000001
  33. #define DBF_AH 0x00000002
  34. #define DBF_IOCTL 0x00000004
  35. #define DBF_HUGHES 0x00000008
  36. #define DBF_ESP 0x00000010
  37. #define DBF_AHEX 0x00000020
  38. #define DBF_PATTERN 0x00000040
  39. #define DBF_SEND 0x00000080
  40. #define DBF_PARSE 0x00000100
  41. #define DBF_PMTU 0x00000200
  42. #define DBF_ACQUIRE 0x00000400
  43. #define DBF_HASH 0x00000800
  44. #define DBF_CLEARTEXT 0x00001000
  45. #define DBF_TIMER 0x00002000
  46. #define DBF_REF 0x00004000
  47. #define DBF_SA 0x00008000
  48. #define DBF_ALL 0x00010000
  49. #define DBF_POOL 0x00020000
  50. #define DBF_TUNNEL 0x00040000
  51. #define DBF_HW 0x00080000
  52. #define DBF_COMP 0x00100000
  53. #define DBF_SAAPI 0x00200000
  54. #define DBF_CACHE 0x00400000
  55. #define DBF_TRANS 0x00800000
  56. #define DBF_MDL 0x01000000
  57. #define DBF_REKEY 0x02000000
  58. #define DBF_GENHASH 0x04000000
  59. #define DBF_HWAPI 0x08000000
  60. #define DBF_GPC 0x10000000
  61. #define DBF_NATSHIM 0x20000000
  62. #define DBF_BOOTTIME 0x40000000
  63. #define IPSEC_DEBUG(_Level,_Flag, _Print) { \
  64. if (IPSecDebug & (_Flag)) { \
  65. DbgPrint ("IPSEC: "); \
  66. DbgPrint _Print; \
  67. DbgPrint ("\n"); \
  68. } \
  69. }
  70. #define IPSEC_DEBUG_KD_ONLY(_Flag, _Print) { \
  71. if (IPSecDebug & (_Flag)) { \
  72. DbgPrint ("IPSEC: "); \
  73. DbgPrint _Print; \
  74. DbgPrint ("\n"); \
  75. } \
  76. }
  77. #define IPSEC_PRINT_MDL(_Mdl) { \
  78. if ((_Mdl) == NULL) { \
  79. IPSEC_DEBUG(LL_A, DBF_MDL, ("IPSEC Mdl is NULL")); \
  80. } \
  81. if (IPSecDebug & DBF_MDL) { \
  82. PNDIS_BUFFER pBuf = _Mdl; \
  83. while (pBuf != NULL) { \
  84. IPSEC_DEBUG(LL_A, DBF_MDL, ("pBuf: %lx, size: %d", pBuf, pBuf->ByteCount)); \
  85. pBuf = NDIS_BUFFER_LINKAGE(pBuf); \
  86. } \
  87. } \
  88. }
  89. #define IPSEC_PRINT_CONTEXT(_Context) { \
  90. PIPSEC_SEND_COMPLETE_CONTEXT pC = (PIPSEC_SEND_COMPLETE_CONTEXT)(_Context); \
  91. if (pC == NULL) { \
  92. IPSEC_DEBUG(LL_A, DBF_MDL, ("IPSEC Context is NULL")); \
  93. } else if (IPSecDebug & DBF_MDL) { \
  94. DbgPrint("IPSEC: Context->Flags: %lx", pC->Flags); \
  95. if (pC->OptMdl) \
  96. DbgPrint("IPSEC: Context->OptMdl: %lx", pC->OptMdl); \
  97. if (pC->OriAHMdl) \
  98. DbgPrint("IPSEC: Context->OriAHMdl: %lx", pC->OriAHMdl); \
  99. if (pC->OriHUMdl) \
  100. DbgPrint("IPSEC: Context->OriHUMdl: %lx", pC->OriHUMdl); \
  101. if (pC->OriTuMdl) \
  102. DbgPrint("IPSEC: Context->OriTuMdl: %lx", pC->OriTuMdl); \
  103. if (pC->PrevMdl) \
  104. DbgPrint("IPSEC: Context->PrevMdl: %lx", pC->PrevMdl); \
  105. if (pC->PrevTuMdl) \
  106. DbgPrint("IPSEC: Context->PrevTuMdl: %lx", pC->PrevTuMdl);\
  107. if (pC->AHMdl) \
  108. DbgPrint("IPSEC: Context->AHMdl: %lx", pC->AHMdl); \
  109. if (pC->AHTuMdl) \
  110. DbgPrint("IPSEC: Context->AHTuMdl: %lx", pC->AHTuMdl);\
  111. if (pC->PadMdl) \
  112. DbgPrint("IPSEC: Context->PadMdl: %lx", pC->PadMdl); \
  113. if (pC->PadTuMdl) \
  114. DbgPrint("IPSEC: Context->PadTuMdl: %lx", pC->PadTuMdl); \
  115. if (pC->HUMdl) \
  116. DbgPrint("IPSEC: Context->HUMdl: %lx", pC->HUMdl); \
  117. if (pC->HUTuMdl) \
  118. DbgPrint("IPSEC: Context->HUTuMdl: %lx", pC->HUTuMdl);\
  119. if (pC->BeforePadMdl) \
  120. DbgPrint("IPSEC: Context->BeforePadMdl: %lx", pC->BeforePadMdl); \
  121. if (pC->BeforePadTuMdl) \
  122. DbgPrint("IPSEC: Context->BeforePadTuMdl: %lx", pC->BeforePadTuMdl); \
  123. if (pC->HUHdrMdl) \
  124. DbgPrint("IPSEC: Context->HUHdrMdl: %lx", pC->HUHdrMdl); \
  125. if (pC->OriAHMdl2) \
  126. DbgPrint("IPSEC: Context->OriAHMdl2: %lx", pC->OriAHMdl2);\
  127. if (pC->PrevAHMdl2) \
  128. DbgPrint("IPSEC: Context->PrevAHMdl2: %lx", pC->PrevAHMdl2); \
  129. if (pC->AHMdl2) \
  130. DbgPrint("IPSEC: Context->AHMdl2: %lx", pC->AHMdl2); \
  131. } \
  132. }
  133. #else // DBG
  134. #define IPSEC_DEBUG_KD_ONLY(_Flag, _Print)
  135. #define IPSEC_DEBUG(_Level, _Flag, _Print)
  136. #define IPSEC_PRINT_MDL(_Mdl)
  137. #define IPSEC_PRINT_CONTEXT(_Context)
  138. #endif // DBG
  139. #define WPP_INIT_TRACING(x,y)
  140. #define WPP_CLEANUP(x)
  141. #endif // else RUN_WPP