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.

651 lines
8.4 KiB

  1. // prototypes
  2. NTSTATUS
  3. ArapProcessIoctl(
  4. IN PIRP pIrp
  5. );
  6. BOOLEAN
  7. ArapAcceptIrp(
  8. IN PIRP pIrp,
  9. IN ULONG IoControlCode,
  10. IN BOOLEAN *pfDerefDefPort
  11. );
  12. VOID
  13. ArapCancelIrp(
  14. IN PIRP pIrp
  15. );
  16. VOID
  17. ArapGetSelectIrp(
  18. IN PIRP *ppIrp
  19. );
  20. NTSTATUS
  21. ArapExchangeParms(
  22. IN PIRP pIrp
  23. );
  24. NTSTATUS
  25. ArapConnect(
  26. IN PIRP pIrp,
  27. IN ULONG IoControlCode
  28. );
  29. NTSTATUS
  30. ArapDisconnect(
  31. IN PIRP pIrp
  32. );
  33. NTSTATUS
  34. ArapGetStats(
  35. IN PIRP pIrp
  36. );
  37. NTSTATUS
  38. ArapGetAddr(
  39. IN PIRP pIrp
  40. );
  41. NTSTATUS
  42. ArapProcessSelect(
  43. IN PIRP pIrp
  44. );
  45. PARAPCONN
  46. FindArapConnByContx(
  47. IN PVOID pDllContext
  48. );
  49. PARAPCONN
  50. FindAndRefArapConnByAddr(
  51. IN ATALK_NODEADDR destNode,
  52. OUT DWORD *pdwFlags
  53. );
  54. PVOID
  55. FindAndRefRasConnByAddr(
  56. IN ATALK_NODEADDR destNode,
  57. OUT DWORD *pdwFlags,
  58. OUT BOOLEAN *pfThisIsPPP
  59. );
  60. BOOLEAN
  61. ArapConnIsValid(
  62. IN PARAPCONN pArapConn
  63. );
  64. VOID
  65. DerefArapConn(
  66. IN PARAPCONN pArapConn
  67. );
  68. VOID
  69. DerefMnpSendBuf(
  70. IN PMNPSENDBUF pMnpSendBuf,
  71. IN BOOLEAN fNdisSendComplete
  72. );
  73. VOID
  74. ArapReleaseAddr(
  75. IN PARAPCONN pArapConn
  76. );
  77. NTSTATUS
  78. ArapIoctlSend(
  79. IN PIRP pIrp
  80. );
  81. NTSTATUS
  82. ArapIoctlRecv(
  83. IN PIRP pIrp
  84. );
  85. VOID
  86. ArapDelayedNotify(
  87. OUT PARAPCONN *ppDiscArapConn,
  88. OUT PARAPCONN *ppRecvArapConn
  89. );
  90. DWORD
  91. ArapSendPrepare(
  92. IN PARAPCONN pArapConn,
  93. IN PBUFFER_DESC pOrgBuffDesc,
  94. IN DWORD Priority
  95. );
  96. VOID
  97. ArapIoctlSendComplete(
  98. IN DWORD StatusCode,
  99. IN PARAPCONN pArapConn
  100. );
  101. VOID
  102. ArapRcvIndication(
  103. IN PARAPCONN pArapConn,
  104. IN PVOID LkBuf,
  105. IN UINT LkBufSize
  106. );
  107. VOID
  108. ArapRcvComplete(
  109. IN VOID
  110. );
  111. VOID
  112. ArapPerConnRcvProcess(
  113. IN PARAPCONN pArapConn
  114. );
  115. VOID
  116. ArapNdisSend(
  117. IN PARAPCONN pArapConn,
  118. IN PLIST_ENTRY pSendHead
  119. );
  120. DWORD
  121. ArapGetNdisPacket(
  122. IN PMNPSENDBUF pMnpSendBuf
  123. );
  124. BOOLEAN
  125. ArapRefillSendQ(
  126. IN PARAPCONN pArapConn
  127. );
  128. VOID
  129. ArapNdisSendComplete(
  130. IN NDIS_STATUS Status,
  131. IN PBUFFER_DESC pBufferDesc,
  132. IN PSEND_COMPL_INFO pSendInfo
  133. );
  134. VOID
  135. RasStatusIndication(
  136. IN NDIS_STATUS GeneralStatus,
  137. IN PVOID StatusBuf,
  138. IN UINT StatusBufLen
  139. );
  140. VOID
  141. ArapRetransmitComplete(
  142. NDIS_STATUS Status,
  143. PBUFFER_DESC pBuffDesc,
  144. PSEND_COMPL_INFO pArapSendInfo
  145. );
  146. VOID ArapMnpSendComplete(
  147. IN PMNPSENDBUF pMnpSendBuf,
  148. IN DWORD Status
  149. );
  150. PARAPBUF
  151. ArapExtractAtalkSRP(
  152. IN PARAPCONN pArapConn
  153. );
  154. PBYTE
  155. ArapAllocDecompMemory(
  156. IN DWORD BufferSize
  157. );
  158. VOID
  159. ArapFreeDecompMemory(
  160. IN PBYTE pDecompMemory
  161. );
  162. DWORD
  163. ArapQueueSendBytes(
  164. IN PARAPCONN pArapConn,
  165. IN PBYTE pCompressedDataBuffer,
  166. IN DWORD CompressedDataLen,
  167. IN DWORD Priority
  168. );
  169. PMNPSENDBUF
  170. ArapGetSendBuf(
  171. IN PARAPCONN pArapConn,
  172. IN DWORD Priority
  173. );
  174. DWORD
  175. PrepareConnectionResponse(
  176. IN PARAPCONN pArapConn,
  177. IN PBYTE pReq,
  178. IN DWORD ReqLen,
  179. IN PBYTE pFrame,
  180. IN USHORT * pMnpLen
  181. );
  182. NTSTATUS
  183. ArapMarkConnectionForCallback(
  184. IN PIRP pIrp,
  185. IN ULONG IoControlCode
  186. );
  187. NTSTATUS
  188. ArapMarkConnectionUp(
  189. IN PIRP pIrp
  190. );
  191. PLIST_ENTRY
  192. ArapRearrangePackets(
  193. IN PARAPCONN pArapConn,
  194. IN PLIST_ENTRY pRcvList
  195. );
  196. VOID
  197. MnpSendAckIfReqd(
  198. IN PARAPCONN pArapConn,
  199. IN BOOLEAN fForceAck
  200. );
  201. VOID
  202. MnpSendLNAck(
  203. IN PARAPCONN pArapConn,
  204. IN BYTE LnSeqToAck
  205. );
  206. DWORD
  207. ArapSendLDPacket(
  208. IN PARAPCONN pArapConn,
  209. IN BYTE UserCode
  210. );
  211. VOID
  212. ArapConnectComplete(
  213. IN PMNPSENDBUF pMnpSendBuf,
  214. IN DWORD Status
  215. );
  216. VOID
  217. ArapCleanup(
  218. IN PARAPCONN pArapConn
  219. );
  220. DWORD
  221. ArapDataToDll(
  222. IN PARAPCONN pArapConn
  223. );
  224. VOID
  225. MnpSendAckComplete(
  226. IN NDIS_STATUS Status,
  227. IN PBUFFER_DESC pBuffDesc,
  228. IN PSEND_COMPL_INFO pInfo
  229. );
  230. DWORD
  231. ArapGetStaticAddr(
  232. IN PARAPCONN pArapConn
  233. );
  234. DWORD
  235. ArapGetDynamicAddr(
  236. IN PARAPCONN pArapConn
  237. );
  238. PARAPCONN
  239. AllocArapConn(
  240. IN ULONG LinkSpeed
  241. );
  242. DWORD
  243. ArapUnblockSelect(
  244. IN VOID
  245. );
  246. DWORD
  247. ArapReleaseResources(
  248. IN VOID
  249. );
  250. BOOLEAN
  251. AtalkReferenceRasDefPort(
  252. IN VOID
  253. );
  254. VOID
  255. AtalkPnPInformRas(
  256. IN BOOLEAN fEnableRas
  257. );
  258. DWORD
  259. ArapScheduleWorkerEvent(
  260. IN DWORD Action,
  261. IN PVOID Context1,
  262. IN PVOID Context2
  263. );
  264. VOID
  265. ArapDelayedEventHandler(
  266. IN PARAPQITEM pArapQItem
  267. );
  268. LONG FASTCALL
  269. ArapRetryTimer(
  270. IN PTIMERLIST pTimer,
  271. IN BOOLEAN TimerShuttingDown
  272. );
  273. VOID
  274. ArapRoutePacketFromWan(
  275. IN PARAPCONN pArapConn,
  276. IN PARAPBUF pArapBuf
  277. );
  278. VOID
  279. ArapRoutePacketToWan(
  280. IN ATALK_ADDR *pDestAddr,
  281. IN ATALK_ADDR *pSrcAddr,
  282. IN BYTE Protocol,
  283. IN PBYTE packet,
  284. IN USHORT PktLen,
  285. IN BOOLEAN broadcast,
  286. OUT PBOOLEAN pDelivered
  287. );
  288. BOOLEAN
  289. ArapOkToForward(
  290. IN PARAPCONN pArapConn,
  291. IN PBYTE packet,
  292. IN USHORT packetLen,
  293. OUT DWORD *pPriority
  294. );
  295. VOID
  296. ArapAddArapRoute(
  297. IN VOID
  298. );
  299. VOID
  300. ArapDeleteArapRoute(
  301. IN VOID
  302. );
  303. VOID
  304. ArapZipGetZoneStat(
  305. IN OUT PZONESTAT pZoneStat
  306. );
  307. VOID
  308. ArapZipGetZoneStatCompletion(
  309. IN ATALK_ERROR ErrorCode,
  310. IN PACTREQ pActReq
  311. );
  312. BOOLEAN
  313. ArapValidNetrange(
  314. IN NETWORKRANGE NetRange
  315. );
  316. BOOLEAN
  317. v42bisInit(
  318. IN PARAPCONN pArapConn,
  319. IN PBYTE pReq,
  320. OUT DWORD *dwReqToSkip,
  321. OUT PBYTE pFrame,
  322. OUT DWORD *dwFrameToSkip
  323. );
  324. DWORD
  325. v42bisCompress(
  326. IN PARAPCONN pArapConn,
  327. IN PUCHAR pUncompressedData,
  328. IN DWORD UnCompressedDataLen,
  329. OUT PUCHAR pCompressedData,
  330. OUT DWORD CompressedDataBufSize,
  331. OUT DWORD *pCompressedDataLen
  332. );
  333. DWORD
  334. v42bisDecompress(
  335. IN PARAPCONN pArapConn,
  336. IN PUCHAR pCompressedData,
  337. IN DWORD CompressedDataLen,
  338. OUT PUCHAR pDecompressedData,
  339. OUT DWORD DecompressedDataBufSize,
  340. OUT DWORD *pByteStillToDecompress,
  341. OUT DWORD *pDecompressedDataLen
  342. );
  343. VOID
  344. ArapCaptureSniff(
  345. IN PARAPCONN pArapConn,
  346. IN PBUFFER_DESC pBufferDescr,
  347. IN BYTE FirstSeq,
  348. IN BYTE LastSeq
  349. );
  350. //
  351. // PPP specific routines
  352. //
  353. PATCPCONN
  354. AllocPPPConn(
  355. IN VOID
  356. );
  357. NTSTATUS FASTCALL
  358. PPPProcessIoctl(
  359. IN PIRP pIrp,
  360. IN OUT PARAP_SEND_RECV_INFO pSndRcvInfo,
  361. IN ULONG IoControlCode,
  362. IN PATCPCONN pIncomingAtcpConn
  363. );
  364. VOID
  365. DerefPPPConn(
  366. IN PATCPCONN pAtcpConn
  367. );
  368. PATCPCONN
  369. FindAndRefPPPConnByAddr(
  370. IN ATALK_NODEADDR destNode,
  371. OUT DWORD *pdwFlags
  372. );
  373. VOID
  374. PPPRoutePacketToWan(
  375. IN ATALK_ADDR *pDestAddr,
  376. IN ATALK_ADDR *pSrcAddr,
  377. IN BYTE Protocol,
  378. IN PBYTE packet,
  379. IN USHORT PktLen,
  380. IN USHORT HopCount,
  381. IN BOOLEAN broadcast,
  382. OUT PBOOLEAN pDelivered
  383. );
  384. VOID FASTCALL
  385. PPPTransmit(
  386. IN PATCPCONN pAtcpConn,
  387. IN ATALK_ADDR *pDestAddr,
  388. IN ATALK_ADDR *pSrcAddr,
  389. IN BYTE Protocol,
  390. IN PBYTE packet,
  391. IN USHORT PktLen,
  392. IN USHORT HopCount
  393. );
  394. VOID FASTCALL
  395. PPPTransmitCompletion(
  396. IN NDIS_STATUS Status,
  397. IN PSEND_COMPL_INFO pSendInfo
  398. );
  399. DWORD
  400. PPPGetDynamicAddr(
  401. IN PATCPCONN pAtcpConn
  402. );
  403. //
  404. // Debug-only routines
  405. //
  406. #if DBG
  407. NTSTATUS
  408. ArapProcessSniff(
  409. IN PIRP pIrp
  410. );
  411. BOOLEAN
  412. DbgChkRcvQIntegrity(
  413. IN PARAPCONN pArapConn
  414. );
  415. VOID
  416. DbgDumpBytes(
  417. IN PBYTE pDbgMsg,
  418. IN PBYTE pBuffer,
  419. IN DWORD BufLen,
  420. IN DWORD DumpLevel
  421. );
  422. VOID
  423. DbgDumpBytesPart2(
  424. IN PBYTE pBuffer,
  425. OUT PBYTE OutBuf,
  426. IN DWORD BufLen,
  427. OUT DWORD *NextIndex
  428. );
  429. VOID
  430. DbgDumpNetworkNumbers(
  431. IN VOID
  432. );
  433. VOID
  434. ArapDbgTrace(
  435. IN PARAPCONN pArapConn,
  436. IN DWORD Location,
  437. IN PVOID Context,
  438. IN DWORD dwInfo1,
  439. IN DWORD dwInfo2,
  440. IN DWORD dwInfo3
  441. );
  442. VOID
  443. ArapDbgMnpHist(
  444. IN PARAPCONN pArapConn,
  445. IN BYTE Seq,
  446. IN BYTE FrameType
  447. );
  448. VOID
  449. ArapDbgDumpMnpHist(
  450. IN PARAPCONN pArapConn
  451. );
  452. BOOLEAN
  453. ArapDumpSniffInfo(
  454. IN PARAPCONN pArapConn
  455. );
  456. DWORD
  457. ArapFillIrpWithSniffInfo(
  458. IN PARAPCONN pArapConn,
  459. IN PIRP pIrp
  460. );
  461. VOID
  462. DbgTrackInfo(
  463. IN PARAPCONN pArapConn,
  464. IN DWORD Size,
  465. IN DWORD TrackingWhat
  466. );
  467. VOID
  468. ArapDumpNdisPktInfo(
  469. IN VOID
  470. );
  471. #endif