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.

84 lines
2.3 KiB

  1. /********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1990-1993 **/
  4. /********************************************************************/
  5. /* :ts=4 */
  6. //** TCPDELIV.H - TCP data delivery definitions.
  7. //
  8. // This file contains the definitions for structures used by the data
  9. // delivery code.
  10. //
  11. extern void FreeRcvReq(struct TCPRcvReq *FreedReq);
  12. extern uint IndicateData(struct TCB *RcvTCB, uint RcvFlags, IPRcvBuf *InBuffer,
  13. uint Size);
  14. extern uint BufferData(struct TCB *RcvTCB, uint RcvFlags, IPRcvBuf *InBuffer,
  15. uint Size);
  16. extern uint PendData(struct TCB *RcvTCB, uint RcvFlags, IPRcvBuf *InBuffer,
  17. uint Size);
  18. extern void IndicatePendingData(struct TCB *RcvTCB, struct TCPRcvReq *RcvReq,
  19. CTELockHandle TCBHandle);
  20. extern void HandleUrgent(struct TCB *RcvTCB, struct TCPRcvInfo *RcvInfo,
  21. IPRcvBuf *RcvBuf, uint *Size);
  22. extern TDI_STATUS TdiReceive(PTDI_REQUEST Request, ushort *Flags,
  23. uint *RcvLength, PNDIS_BUFFER Buffer);
  24. extern IPRcvBuf *FreePartialRB(IPRcvBuf *RB, uint Size);
  25. extern void PushData(struct TCB *PushTCB);
  26. #if !MILLEN
  27. //* AllocTcpIpr - Allocates the IPRcvBuffer from NPP.
  28. //
  29. // A utility routine to allocate a TCP owned IPRcvBuffer. This routine
  30. // allocates the IPR from NPP and initializes appropriate fields.
  31. //
  32. // Input: BufferSize - Size of data to buffer.
  33. //
  34. // Returns: Pointer to allocated IPR.
  35. //
  36. __inline IPRcvBuf *
  37. AllocTcpIpr(ULONG BufferSize, ULONG Tag)
  38. {
  39. IPRcvBuf *Ipr;
  40. ULONG AllocateSize;
  41. // Real size that we need.
  42. AllocateSize = BufferSize + sizeof(IPRcvBuf);
  43. Ipr = CTEAllocMemLow(AllocateSize, Tag);
  44. if (Ipr != NULL) {
  45. // Set up IPR fields appropriately.
  46. Ipr->ipr_owner = IPR_OWNER_TCP;
  47. Ipr->ipr_next = NULL;
  48. Ipr->ipr_buffer = (PCHAR) Ipr + sizeof(IPRcvBuf);
  49. Ipr->ipr_size = BufferSize;
  50. }
  51. return Ipr;
  52. }
  53. //* FreeTcpIpr - Frees the IPRcvBuffer..
  54. //
  55. // A utility routine to free a TCP owned IPRcvBuffer.
  56. //
  57. // Input: Ipr - Pointer the IPR.
  58. //
  59. // Returns: None.
  60. //
  61. __inline VOID
  62. FreeTcpIpr(IPRcvBuf *Ipr)
  63. {
  64. CTEFreeMem(Ipr);
  65. }
  66. #else // MILLEN
  67. IPRcvBuf *AllocTcpIpr(ULONG BufferSize, ULONG Tag);
  68. VOID FreeTcpIpr(IPRcvBuf *Ipr);
  69. #endif // MILLEN
  70.