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.

348 lines
14 KiB

  1. /*++
  2. Copyright (c) 1993 Microsoft Corporation
  3. Module Name:
  4. cons.h
  5. Abstract:
  6. Global constant definitions for the AFD.SYS Kernel Debugger
  7. Extensions.
  8. Author:
  9. Keith Moore (keithmo) 19-Apr-1995.
  10. Environment:
  11. User Mode.
  12. --*/
  13. #ifndef _CONS_H_
  14. #define _CONS_H_
  15. #define MAX_TRANSPORT_ADDR 256
  16. #define MAX_ADDRESS_STRING 64
  17. #define Address00 Address[0].Address[0]
  18. #define UC(x) ((UINT)((x) & 0xFF))
  19. #define NTOHS(x) ( (UC(x) * 256) + UC((x) >> 8) )
  20. #define NTOHL(x) ( ( ((x)) << (8*3)) | \
  21. ( ((x) & 0x0000FF00) << (8*1)) | \
  22. ( ((x) & 0x00FF0000) >> (8*1)) | \
  23. ( ((x)) >> (8*3)) )
  24. #define PTR64_BITS 44
  25. #define PTR64_MASK ((1I64<<PTR64_BITS)-1)
  26. #define PTR32_BITS 32
  27. #define PTR32_MASK ((1I64<<PTR32_BITS)-1)
  28. #define DISP_PTR(x) (IsPtr64() ? (ULONG64)((x)&PTR64_MASK):(ULONG64)((x)&PTR32_MASK))
  29. #define MAX_ADDRESS_EXPRESSION 256
  30. #define MAX_FIELD_CHARS 256
  31. #define MAX_NUM_FIELDS 32
  32. #define MAX_FIELDS_EXPRESSION 1024
  33. #define MAX_CONDITIONAL_EXPRESSION 1024
  34. #define AFDKD_BRIEF_DISPLAY 0x00000001
  35. #define AFDKD_NO_DISPLAY 0x00000002
  36. #define AFDKD_RADDR_DISPLAY 0x00000004
  37. #define AFDKD_FIELD_DISPLAY 0x00000008
  38. #define AFDKD_BACKWARD_SCAN 0x00000010
  39. #define AFDKD_ENDPOINT_SCAN 0x00000020
  40. #define AFDKD_CONDITIONAL 0x00000040
  41. #define AFDKD_LIST_COUNT 0x00000080
  42. #define AFDKD_LINK_FIELD 0x00000100
  43. #define AFDKD_LINK_AOF 0x00000200
  44. #define AFDKD_LINK_SELF 0x00000400
  45. #define AFDKD_LIST_TYPE 0x00000800
  46. #define AFDKD_MSWSOCK_DISPLAY 0x00001000
  47. #define AFDKD_SYNTCB_DISPLAY 0x00100000
  48. #define AFDKD_TWTCB_DISPLAY 0x00200000
  49. #define AFDKD_CPP_PREFIX "@@"
  50. #define AFDKD_CPP_PREFSZ (sizeof (AFDKD_CPP_PREFIX)-1)
  51. #define AFDKD_BRIEF_ENDPOINT_DISPLAY_HEADER32 \
  52. "\nEndpoint Typ State Flags Transport LPort Counts Evt Pid Con/RAdr"
  53. // xxxxxxxx xxx xxx xxxxxxxxxxxx xxxxxxxxx xxxxx xx xx xx xx xxx xxxx xxxxxxxx
  54. #define AFDKD_BRIEF_ENDPOINT_DISPLAY_HEADER64 \
  55. "\nEndpoint Typ State Flags Transport LPort Counts Evt Pid Con/RemAddr"
  56. // xxxxxxxxxxx xxx xxx xxxxxxxxxxxx xxxxxxxxx xxxxx xx xx xx xx xxx xxxx xxxxxxxxxxx
  57. #define AFDKD_BRIEF_ENDPOINT_DISPLAY_HEADER (IsPtr64() \
  58. ? AFDKD_BRIEF_ENDPOINT_DISPLAY_HEADER64 \
  59. : AFDKD_BRIEF_ENDPOINT_DISPLAY_HEADER32)
  60. #define AFDKD_BRIEF_ENDPOINT_DISPLAY_TRAILER \
  61. "\nFlags: Nblock,Inline,clEaned-up,Polled,routeQuery,-fastSnd,-fastRcv,Adm.access"\
  62. "\n SD_rECV,SD_rEND,SD_bOTH,SD_aBORT,Listen,Circ.que,Half.conn,#-dg.drop mask"\
  63. "\n p,m,f-ctx xfer pending,more,failed;i-implicit dupe"\
  64. "\nCounts: Dg/Con(bytes)-buffered snd,rcv; Lstn(cons)-free,AccEx,pending,unacc"\
  65. "\n SANendp-reqID, select events; SANhlpr-plsn, pending requests"\
  66. "\n"
  67. #define AFDKD_BRIEF_CONNECTION_DISPLAY_HEADER32 \
  68. "\nConnectn Stat Flags SndB-cnt RcvB-cnt Pid Endpoint Remote Address"\
  69. // xxxxxxxx xxx xxxxxxx xxxxx-xx xxxxx-xx xxxx xxxxxxxx xxxxxxxxxxxxxx"
  70. #define AFDKD_BRIEF_CONNECTION_DISPLAY_HEADER64 \
  71. "\nConnection Stat Flags SndB-cnt RcvB-cnt Pid Endpoint Remote Address"\
  72. // xxxxxxxxxxx xxx xxxxxxx xxxxx-xx xxxxx-xx xxxx xxxxxxxxxxx xxxxxxxxxxxxxx
  73. #define AFDKD_BRIEF_CONNECTION_DISPLAY_HEADER (IsPtr64() \
  74. ? AFDKD_BRIEF_CONNECTION_DISPLAY_HEADER64 \
  75. : AFDKD_BRIEF_CONNECTION_DISPLAY_HEADER32)
  76. #define AFDKD_BRIEF_CONNECTION_DISPLAY_TRAILER \
  77. "\nFlags: Abort-,Disc-indicated,+cRef,Special-cond,Cleaning,Tpack closing,Lr-list"\
  78. "\n"
  79. #define AFDKD_BRIEF_TPACKETS_DISPLAY_HEADER32 \
  80. "\nTPackets I R P S Endpoint Flags Next Elmt Mo"\
  81. "\nAddress Transmit Send Arr Read Address App | State Elmt Cnt. re"\
  82. // xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxx xxxxxxxxxxxxxx xxxx xxxx xx
  83. #define AFDKD_BRIEF_TPACKETS_DISPLAY_HEADER64 \
  84. "\nTPackets I R P S Endpoint Flags Next Elmt Mo"\
  85. "\nAddress Transmit SAr Read Address App | State Elmt Cnt. re"\
  86. // xxxxxxxxxxx xxxxxxxxxxx xxx xxxxxxxxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxx xxxx xxxx xx
  87. #define AFDKD_BRIEF_TPACKETS_DISPLAY_HEADER (IsPtr64() \
  88. ? AFDKD_BRIEF_TPACKETS_DISPLAY_HEADER64 \
  89. : AFDKD_BRIEF_TPACKETS_DISPLAY_HEADER32)
  90. #define AFDKD_BRIEF_TPACKETS_DISPLAY_TRAILER \
  91. "\nApp flags: b-write Behind,d-Disconnect,r-Reuse,s-system threads,a-kernel APCs"\
  92. "\nState flags: A-Abort,W-Work,S-Sent,Q-Qued,&-s&d,0-reading,1-8-sending"\
  93. "\n"
  94. #define AFDKD_BRIEF_TRANFILE_DISPLAY_HEADER \
  95. "\nTranInfo I R P S Endpoint Flags Cur.Read Read"\
  96. "\nAddress Transmit Send1 Send2 Read Address Offset End "\
  97. "\n"
  98. #define AFDKD_BRIEF_TRANFILE_DISPLAY_TRAILER \
  99. "\nFlags: A-aborting,W-work pending,H-head,R-reusing,S-S&D,1-send1,2-send2,3-read"\
  100. "\n"
  101. #define AFDKD_BRIEF_BUFFER_DISPLAY_HEADER32 \
  102. "\nBuffer Buff Data Data Context Mdl|IRP Flags Remote Address"\
  103. "\nAddress Size Size Offs Status Address "\
  104. // xxxxxxxx xxxx xxxx xxxx xxxxxxxx xxxxxxxx xxxxxx xxxxxxxx:xxxxxxxxxxxx:xxxx
  105. #define AFDKD_BRIEF_BUFFER_DISPLAY_HEADER64 \
  106. "\nBuffer Buff Data Data Context Mdl | IRP Flags Remote Address"\
  107. "\nAddress Size Size Offs Status Address "\
  108. // xxxxxxxxxxx xxxx xxxx xxxx xxxxxxxxxxx xxxxxxxxxxx xxxxxx xxxxxxxx:xxxxxxxxxxxx:xxxx
  109. #define AFDKD_BRIEF_BUFFER_DISPLAY_HEADER (IsPtr64() \
  110. ? AFDKD_BRIEF_BUFFER_DISPLAY_HEADER64 \
  111. : AFDKD_BRIEF_BUFFER_DISPLAY_HEADER32)
  112. #define AFDKD_BRIEF_BUFFER_DISPLAY_TRAILER \
  113. "\nFlags: E-expedited,P-partial,L-lookaside,N-ndis packet "\
  114. "\n first: h-header,i-irp,m-mdl,b-buffer "\
  115. "\n"
  116. #define AFDKD_BRIEF_POLL_DISPLAY_HEADER32 \
  117. "\nPollInfo IRP Thread (pid.tid) Expires in Flg Hdls Array"\
  118. // xxxxxxxx xxxxxxxx xxxxxxxx xxxx:xxxx xx:xx:xx.xxx xxx xxxx xxxxxxxx
  119. #define AFDKD_BRIEF_POLL_DISPLAY_HEADER64 \
  120. "\nPollInfo IRP Thread (pid.tid) Expires in Flg Hdls Array"\
  121. // xxxxxxxxxxx xxxxxxxxxxx xxxxxxxxxxx xxxx:xxxx xx:xx:xx.xxx xxx xxxx xxxxxxxxxxx
  122. #define AFDKD_BRIEF_POLL_DISPLAY_HEADER (IsPtr64() \
  123. ? AFDKD_BRIEF_POLL_DISPLAY_HEADER64 \
  124. : AFDKD_BRIEF_POLL_DISPLAY_HEADER32)
  125. #define AFDKD_BRIEF_POLL_DISPLAY_TRAILER \
  126. "\nFlags: T-timer started, U-unique, S-SAN poll"\
  127. "\n"
  128. #define AFDKD_BRIEF_ADDRLIST_DISPLAY_HEADER32 \
  129. "\nAddrLEnt Device Name Address"\
  130. // xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  131. #define AFDKD_BRIEF_ADDRLIST_DISPLAY_HEADER64 \
  132. "\nAddrLEntry Device Name Address"\
  133. // xxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  134. #define AFDKD_BRIEF_ADDRLIST_DISPLAY_HEADER (IsPtr64()\
  135. ? AFDKD_BRIEF_ADDRLIST_DISPLAY_HEADER64 \
  136. : AFDKD_BRIEF_ADDRLIST_DISPLAY_HEADER32)
  137. #define AFDKD_BRIEF_ADDRLIST_DISPLAY_TRAILER \
  138. "\n"
  139. #define AFDKD_BRIEF_TRANSPORT_DISPLAY_HEADER32 \
  140. "\nTranInfo Device Name RefC Ver Max.Send MaxDg Flags"\
  141. // xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxx xxx xxxxxxxx xxxxx xxxxx-xxxxxxxxx
  142. #define AFDKD_BRIEF_TRANSPORT_DISPLAY_HEADER64 \
  143. "\nTranInfo Device Name RefC Ver Max.Send MaxDg Flags"\
  144. // xxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxx xxx xxxxxxxx xxxxx xxxxx-xxxxxxxxx
  145. #define AFDKD_BRIEF_TRANSPORT_DISPLAY_HEADER (IsPtr64() \
  146. ? AFDKD_BRIEF_TRANSPORT_DISPLAY_HEADER64 \
  147. : AFDKD_BRIEF_TRANSPORT_DISPLAY_HEADER32)
  148. #define AFDKD_BRIEF_TRANSPORT_DISPLAY_TRAILER \
  149. "\nFlags: Orderly release, Delayed accept, Expedited, internal Buffering,"\
  150. "\n Message mode, dataGram connection, Access check, s&d, diRect accept"\
  151. "\n"
  152. #define AFDKD_BRIEF_SOCKET_DISPLAY_HEADER32 \
  153. "\nHandle DSOCKET Flg Provider"\
  154. // xxxxxx xxxxxxxx xxx xxxxxxxx-xxx...
  155. #define AFDKD_BRIEF_SOCKET_DISPLAY_HEADER64 \
  156. "\nHandle DSOCKET Flg Provider"\
  157. // xxxxxx xxxxxxxxxxxxxxxx xxx xxxxxxxxxxxxxxxx-xxx...
  158. #define AFDKD_BRIEF_SOCKET_DISPLAY_HEADER (IsPtr64() \
  159. ? AFDKD_BRIEF_SOCKET_DISPLAY_HEADER64 \
  160. : AFDKD_BRIEF_SOCKET_DISPLAY_HEADER32)
  161. #define AFDKD_BRIEF_SOCKET_DISPLAY_TRAILER \
  162. "\nFlags: P-created by provider, A-exposed to the app, O-overlapped"\
  163. "\n"
  164. #define AFDKD_BRIEF_MSWSOCK_DISPLAY_TRAILER \
  165. "MSAFD Flags: Listen,Bcast,Debug,Oobinline,reuseAddr,Excladdr,NBlock,Condaccept"\
  166. "\n sd_Snd,sd_Rcv"\
  167. "\nSAN Flags: Flow_inited,remoteReset,Closing"\
  168. "\n"
  169. #define AFDKD_BRIEF_DPROV_DISPLAY_HEADER32 \
  170. "\nProvider PF SFlags CatID Ch RefC Triple Protocol"\
  171. // xxxxxxxx xx xxxxxx xxxxx xx xxxx xx,x,xxxx(x) xxxxxxxxxxxxxxx
  172. #define AFDKD_BRIEF_DPROV_DISPLAY_HEADER64 \
  173. "\nProvider PF SFlags CatID Ch RefC Triple Protocol"\
  174. // xxxxxxxxxxx xx xxxxxx xxxxx xx xxxx xx,x,xxxx(x) xxxxxxxxxxxxxxx
  175. #define AFDKD_BRIEF_DPROV_DISPLAY_HEADER (IsPtr64() \
  176. ? AFDKD_BRIEF_DPROV_DISPLAY_HEADER64 \
  177. : AFDKD_BRIEF_DPROV_DISPLAY_HEADER32)
  178. #define AFDKD_BRIEF_DPROV_DISPLAY_TRAILER \
  179. "\n"
  180. #define AFDKD_BRIEF_NPROV_DISPLAY_HEADER32 \
  181. "\nProvider NS id AF Fl RefC Display String"\
  182. // xxxxxxxx xxxxx xx xx xxxx xxxxxxxxxxxxxxx
  183. #define AFDKD_BRIEF_NPROV_DISPLAY_HEADER64 \
  184. "\nProvider NS id AF Fl RefC Display String"\
  185. // xxxxxxxxxxx xxxxx xx xx xxxx xxxxxxxxxxxxxxx
  186. #define AFDKD_BRIEF_NPROV_DISPLAY_HEADER (IsPtr64() \
  187. ? AFDKD_BRIEF_NPROV_DISPLAY_HEADER64 \
  188. : AFDKD_BRIEF_NPROV_DISPLAY_HEADER32)
  189. #define AFDKD_BRIEF_NPROV_DISPLAY_TRAILER \
  190. "\nFl: Enabled,stores_Class_info" \
  191. "\n"
  192. #define AFDKD_BRIEF_TCB_DISPLAY_HEADER32 \
  193. "\nTCB St Flags Client ConnCtx PID Source Address Dest Addr"\
  194. // xxxxxxxx xx xxxxxxxx xxxxxx xxxxxxxx xxxx xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx
  195. #define AFDKD_BRIEF_TCB_DISPLAY_HEADER64 \
  196. "\nTCB St Flags Client ConnCtx PID Source Address Dest Addr"\
  197. // xxxxxxxxxxx xx xxxxxxxx xxxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx
  198. #define AFDKD_BRIEF_TCB_DISPLAY_HEADER (IsPtr64() \
  199. ? AFDKD_BRIEF_TCB_DISPLAY_HEADER64 \
  200. : AFDKD_BRIEF_TCB_DISPLAY_HEADER32)
  201. #define AFDKD_BRIEF_TCB_DISPLAY_TRAILER \
  202. "\nFlags:1-win,2-cl.opt,4-accept,8-active,10-disc,2-inDelQ,4-inRCmpl,8-inRInd,"\
  203. "\n 100-ndRCmpl,2-ndAck,4-ndOut,8-delack,1000-pmtuP,2-bsdU,4-inDU,8-urgValid"\
  204. "\n 10000-ndFin,2-nagle,4-inTSnd,8-flowC,100000-discPend,2-twPend,4-forceO"\
  205. "\n 8-sndArcv,1000000-gcPend,2-keepAl,4-urgInl,8-scaleCW,10000000-finPend"\
  206. "\n 2-finSend,4-ndRst,8-inTable"\
  207. "\nStates: Cd-closed,Li-listen,SS-syn_sent,SR-syn_rcvd,Es-establ,F1-fin_wait_1"\
  208. "\n F2-fin_wait_2,CW-close_wait,Ci-closing,LA-last_ack, TW-time_wait"\
  209. "\n"
  210. #define AFDKD_BRIEF_TAO_DISPLAY_HEADER32 \
  211. "\nAddrObj Prot Flags Client Context PID Local Address Ques(LAI)/RAddr"\
  212. // xxxxxxxx xxxx xxxxx xxxxxx xxxxxxxx xxxx xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx
  213. #define AFDKD_BRIEF_TAO_DISPLAY_HEADER64 \
  214. "\nAddrObj Prot Flags Client Context PID Local Address Ques(LAI)/RAddr"\
  215. // xxxxxxxxxxx xxxx xxxxx xxxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx
  216. #define AFDKD_BRIEF_TAO_DISPLAY_HEADER (IsPtr64() \
  217. ? AFDKD_BRIEF_TAO_DISPLAY_HEADER64 \
  218. : AFDKD_BRIEF_TAO_DISPLAY_HEADER32)
  219. #define AFDKD_BRIEF_TAO_DISPLAY_TRAILER \
  220. "\nFlags: 1-del,2-opt,4-send,8-xsum,10-queued,2-oor,4-busy,8-valid,100-dhcp,2-raw"\
  221. "\n 4-bcast,8-conudp,1000-shared,2-pktinfo,4-defer,8-cwin,10000-winset"\
  222. "\nQues: L - listen, A - active, I - idle"\
  223. "\n"
  224. #define AFDKD_BRIEF_TCB6_DISPLAY_HEADER32 \
  225. "\nTCB St Flags Client ConnCtx PID Source / Destination"\
  226. // xxxxxxxx xx xxxxxxxx xxxxxx xxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx...
  227. // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  228. #define AFDKD_BRIEF_TCB6_DISPLAY_HEADER64 \
  229. "\nTCB St Falgs Client ConnCtx PID Source / Destination"\
  230. // xxxxxxxxxxx xx xxxxxxxx xxxxxx xxxxxxxxxxx xxxx xxxxxxxxxxxxxxxxxxxx...
  231. // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  232. #define AFDKD_BRIEF_TCB6_DISPLAY_HEADER (IsPtr64() \
  233. ? AFDKD_BRIEF_TCB6_DISPLAY_HEADER64 \
  234. : AFDKD_BRIEF_TCB6_DISPLAY_HEADER32)
  235. #define AFDKD_BRIEF_TCB6_DISPLAY_TRAILER \
  236. "\nFlags:1-win,2-cl.opt,4-accept,8-active,10-disc,2-inDelQ,4-inRCmpl,8-inRInd,"\
  237. "\n 100-ndRCmpl,2-ndAck,4-ndOut,8-delack,1000-pmtuP,2-bsdU,4-inDU,8-urgValid"\
  238. "\n 10000-ndFin,2-nagle,4-inTSnd,8-flowC,100000-discPend,2-twPend,4-forceO"\
  239. "\n 8-sndArcv,1000000-gcPend,2-keepAl,4-urgInl,8-accPend,10000000-finPend"\
  240. "\n 2-finSend,4-ndRst,8-inTable"\
  241. "\nStates: Cd-closed,Li-listen,SS-syn_sent,SR-syn_rcvd,Es-establ,F1-fin_wait_1"\
  242. "\n F2-fin_wait_2,CW-close_wait,Ci-closing,LA-last_ack,TW-time_wait"\
  243. "\n"
  244. #define AFDKD_BRIEF_TAO6_DISPLAY_HEADER32 \
  245. "\nAddrObj Prot Flgs Client Context PID Address"\
  246. // xxxxxxxx xxxx xxxx xxxxxx xxxxxxxx xxxx xxxxxxx...
  247. #define AFDKD_BRIEF_TAO6_DISPLAY_HEADER64 \
  248. "\nAddrObj Prot Flgs Client Context PID Address"\
  249. // xxxxxxxxxxx xxxx xxxx xxxxxxxx xxxxxxxxxxx xxxx xxxxxxx...
  250. #define AFDKD_BRIEF_TAO6_DISPLAY_HEADER (IsPtr64() \
  251. ? AFDKD_BRIEF_TAO6_DISPLAY_HEADER64 \
  252. : AFDKD_BRIEF_TAO6_DISPLAY_HEADER32)
  253. #define AFDKD_BRIEF_TAO6_DISPLAY_TRAILER \
  254. "\nFlags: 1-del,2-opt,4-send,8-,10-queued,2-oor,4-busy,8-valid,100-dhcp,2-raw"\
  255. "\n 4-hdrInc,8-,1000-shared,2-pktinfo"\
  256. "\n"
  257. #endif // _CONS_H_