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.

103 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1998, Microsoft Corporation
  3. Module Name:
  4. bufferc.h
  5. Abstract:
  6. This module contains declarations for buffer-management.
  7. All network I/O in this component occurs via completion packets.
  8. The buffer routines below are used to acquire and release the buffers
  9. used for sending and receiving data.
  10. In addition to holding the data transferred, the buffers contain fields
  11. to facilitate their use with completion ports. See below for details
  12. on the use of the fields.
  13. Author:
  14. Abolade Gbadegesin (aboladeg) 2-Mar-1998
  15. Savas Guven (savasg) 20-Oct-2000
  16. Revision History:
  17. --*/
  18. #if 0
  19. #ifndef _NATHLP_BUFFER_H_
  20. #define _NATHLP_BUFFER_H_
  21. #define NH_BUFFER_SIZE 576
  22. #define NH_MAX_BUFFER_QUEUE_LENGTH 32
  23. //
  24. // Structure: NH_BUFFER
  25. //
  26. // This structure holds a buffer used for network I/O on a socket.
  27. //
  28. typedef enum _NH_BUFFER_TYPE {
  29. NhFixedLengthBufferType,
  30. NhVariableLengthBufferType
  31. } NH_BUFFER_TYPE;
  32. class NH_BUFFER : public GENERIC_NODE
  33. {
  34. class _CNhSock * Socketp;
  35. //
  36. // Completion routine and contexts for the buffer's most recent I/O request
  37. //
  38. PNH_COMPLETION_ROUTINE CompletionRoutine;
  39. PVOID Context;
  40. PVOID Context2;
  41. //
  42. // Passed as the system context area for any I/O using the buffer
  43. //
  44. OVERLAPPED Overlapped;
  45. //
  46. // Upon completion of a receive, the receive-flags and source-address
  47. // length for the message read
  48. //
  49. ULONG ReceiveFlags;
  50. ULONG AddressLength;
  51. union {
  52. //
  53. // Holds the source address when a datagram-read completes
  54. //
  55. SOCKADDR_IN ReadAddress;
  56. //
  57. // Holds the destination address while a datagram-send is in progress
  58. //
  59. SOCKADDR_IN WriteAddress;
  60. //
  61. // Holds the remote address while a connect is in progress
  62. //
  63. SOCKADDR_IN ConnectAddress;
  64. //
  65. // Holds the state of a multi-request read or write
  66. //
  67. struct {
  68. ULONG UserFlags;
  69. ULONG BytesToTransfer;
  70. ULONG TransferOffset;
  71. };
  72. };
  73. //
  74. // Upon completion of an I/O request, the error-code, byte-count,
  75. // and data-bytes for the request
  76. //
  77. ULONG ErrorCode;
  78. ULONG BytesTransferred;
  79. UCHAR Buffer[NH_BUFFER_SIZE];
  80. }
  81. #endif