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.

142 lines
4.4 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 IPSEC_DEBUG_LOAD 0x00000001
  15. #define IPSEC_DEBUG_AH 0x00000002
  16. #define IPSEC_DEBUG_IOCTL 0x00000004
  17. #define IPSEC_DEBUG_HUGHES 0x00000008
  18. #define IPSEC_DEBUG_ESP 0x00000010
  19. #define IPSEC_DEBUG_AHEX 0x00000020
  20. #define IPSEC_DEBUG_PATTERN 0x00000040
  21. #define IPSEC_DEBUG_SEND 0x00000080
  22. #define IPSEC_DEBUG_PARSE 0x00000100
  23. #define IPSEC_DEBUG_PMTU 0x00000200
  24. #define IPSEC_DEBUG_ACQUIRE 0x00000400
  25. #define IPSEC_DEBUG_HASH 0x00000800
  26. #define IPSEC_DEBUG_CLEARTEXT 0x00001000
  27. #define IPSEC_DEBUG_TIMER 0x00002000
  28. #define IPSEC_DEBUG_REF 0x00004000
  29. #define IPSEC_DEBUG_SA 0x00008000
  30. #define IPSEC_DEBUG_ALL 0x00010000
  31. #define IPSEC_DEBUG_POOL 0x00020000
  32. #define IPSEC_DEBUG_TUNNEL 0x00040000
  33. #define IPSEC_DEBUG_HW 0x00080000
  34. #define IPSEC_DEBUG_COMP 0x00100000
  35. #define IPSEC_DEBUG_SAAPI 0x00200000
  36. #define IPSEC_DEBUG_CACHE 0x00400000
  37. #define IPSEC_DEBUG_TRANS 0x00800000
  38. #define IPSEC_DEBUG_MDL 0x01000000
  39. #define IPSEC_DEBUG_REKEY 0x02000000
  40. #define IPSEC_DEBUG_GENHASH 0x04000000
  41. #define IPSEC_DEBUG_HWAPI 0x08000000
  42. #if GPC
  43. #define IPSEC_DEBUG_GPC 0x10000000
  44. #endif
  45. #if DBG
  46. #define IPSEC_DEBUG(_Flag, _Print) { \
  47. if (IPSecDebug & (IPSEC_DEBUG_ ## _Flag)) { \
  48. DbgPrint ("IPSEC: "); \
  49. DbgPrint _Print; \
  50. } \
  51. }
  52. #define IPSEC_PRINT_MDL(_Mdl) { \
  53. if ((_Mdl) == NULL) { \
  54. IPSEC_DEBUG(MDL, ("IPSEC Mdl is NULL\n")); \
  55. } \
  56. if (IPSecDebug & IPSEC_DEBUG_MDL) { \
  57. PNDIS_BUFFER pBuf = _Mdl; \
  58. while (pBuf != NULL) { \
  59. IPSEC_DEBUG(MDL, ("pBuf: %lx, size: %d\n", pBuf, pBuf->ByteCount)); \
  60. pBuf = NDIS_BUFFER_LINKAGE(pBuf); \
  61. } \
  62. } \
  63. }
  64. #define IPSEC_PRINT_CONTEXT(_Context) { \
  65. PIPSEC_SEND_COMPLETE_CONTEXT pC = (PIPSEC_SEND_COMPLETE_CONTEXT)(_Context); \
  66. if (pC == NULL) { \
  67. IPSEC_DEBUG(MDL, ("IPSEC Context is NULL\n")); \
  68. } else if (IPSecDebug & IPSEC_DEBUG_MDL) { \
  69. DbgPrint("IPSEC: Context->Flags: %lx\n", pC->Flags); \
  70. if (pC->OptMdl) \
  71. DbgPrint("IPSEC: Context->OptMdl: %lx\n", pC->OptMdl); \
  72. if (pC->OriAHMdl) \
  73. DbgPrint("IPSEC: Context->OriAHMdl: %lx\n", pC->OriAHMdl); \
  74. if (pC->OriHUMdl) \
  75. DbgPrint("IPSEC: Context->OriHUMdl: %lx\n", pC->OriHUMdl); \
  76. if (pC->OriTuMdl) \
  77. DbgPrint("IPSEC: Context->OriTuMdl: %lx\n", pC->OriTuMdl); \
  78. if (pC->PrevMdl) \
  79. DbgPrint("IPSEC: Context->PrevMdl: %lx\n", pC->PrevMdl); \
  80. if (pC->PrevTuMdl) \
  81. DbgPrint("IPSEC: Context->PrevTuMdl: %lx\n", pC->PrevTuMdl);\
  82. if (pC->AHMdl) \
  83. DbgPrint("IPSEC: Context->AHMdl: %lx\n", pC->AHMdl); \
  84. if (pC->AHTuMdl) \
  85. DbgPrint("IPSEC: Context->AHTuMdl: %lx\n", pC->AHTuMdl);\
  86. if (pC->PadMdl) \
  87. DbgPrint("IPSEC: Context->PadMdl: %lx\n", pC->PadMdl); \
  88. if (pC->PadTuMdl) \
  89. DbgPrint("IPSEC: Context->PadTuMdl: %lx\n", pC->PadTuMdl); \
  90. if (pC->HUMdl) \
  91. DbgPrint("IPSEC: Context->HUMdl: %lx\n", pC->HUMdl); \
  92. if (pC->HUTuMdl) \
  93. DbgPrint("IPSEC: Context->HUTuMdl: %lx\n", pC->HUTuMdl);\
  94. if (pC->BeforePadMdl) \
  95. DbgPrint("IPSEC: Context->BeforePadMdl: %lx\n", pC->BeforePadMdl); \
  96. if (pC->BeforePadTuMdl) \
  97. DbgPrint("IPSEC: Context->BeforePadTuMdl: %lx\n", pC->BeforePadTuMdl); \
  98. if (pC->HUHdrMdl) \
  99. DbgPrint("IPSEC: Context->HUHdrMdl: %lx\n", pC->HUHdrMdl); \
  100. if (pC->OriAHMdl2) \
  101. DbgPrint("IPSEC: Context->OriAHMdl2: %lx\n", pC->OriAHMdl2);\
  102. if (pC->PrevAHMdl2) \
  103. DbgPrint("IPSEC: Context->PrevAHMdl2: %lx\n", pC->PrevAHMdl2); \
  104. if (pC->AHMdl2) \
  105. DbgPrint("IPSEC: Context->AHMdl2: %lx\n", pC->AHMdl2); \
  106. } \
  107. }
  108. #else
  109. #define IPSEC_DEBUG(_Flag, _Print)
  110. #define IPSEC_PRINT_MDL(_Mdl)
  111. #define IPSEC_PRINT_CONTEXT(_Context)
  112. #endif
  113. //
  114. // Lock order...
  115. //
  116. // SADBLock -> SPILiskLock -> LarvalListLock.
  117. //