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.

114 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 1990-1995 Microsoft Corporation
  3. Module Name:
  4. packet.h
  5. Abstract:
  6. This file contains data structures used by the NdisWan driver
  7. to define ndis packet particulars.
  8. Author:
  9. Tony Bell (TonyBe) June 06, 1995
  10. Environment:
  11. Kernel Mode
  12. Revision History:
  13. TonyBe 02/11/97
  14. --*/
  15. #ifndef _NDISWAN_PACKETS_
  16. #define _NDISWAN_PACKETS_
  17. #define MAGIC_EXTERNAL_RECV '!RxE'
  18. #define MAGIC_EXTERANL_SEND '!SxE'
  19. #define MAGIC_INTERNAL_IO '!InI'
  20. #define MAGIC_INTERNAL_SEND '!SnI'
  21. #define MAGIC_INTERNAL_RECV '!RnI'
  22. #define MAGIC_INTERNAL_ALLOC '!AnI'
  23. //
  24. // The first 16 bytes of the protocol reserved section
  25. // of a ndis packet indicated to ndiswan by a miniport
  26. // belong to ndiswan
  27. //
  28. typedef struct _NDISWAN_RECV_RESERVED {
  29. LIST_ENTRY Linkage;
  30. ULONG MagicNumber;
  31. ULONG NdisPacket;
  32. } NDISWAN_RECV_RESERVED, *PNDISWAN_RECV_RESERVED;
  33. //
  34. // When ndiswan indicates a ndis packet to a protocol
  35. // the first 16 bytes of the protocol reseved belong to
  36. // the transport. NdisWan will store its information
  37. // beyond this area.
  38. //
  39. typedef struct _NDISWAN_PROTOCOL_RESERVED {
  40. UCHAR Reserved[16]; // 16 bytes reserved for the protocol
  41. union {
  42. SINGLE_LIST_ENTRY SLink;
  43. ULONG MagicNumber;
  44. };
  45. struct _POOL_DESC *PoolDesc;
  46. struct _LINKCB *LinkCB;
  47. union {
  48. struct _RECV_DESC *RecvDesc;
  49. struct _SEND_DESC *SendDesc;
  50. struct _DATA_DESC *DataDesc;
  51. };
  52. } NDISWAN_PROTOCOL_RESERVED, *PNDISWAN_PROTOCOL_RESERVED;
  53. typedef struct _NDISWAN_MINIPORT_RESERVED {
  54. union {
  55. PNDIS_PACKET Next;
  56. ULONG RefCount; // Used to count number of fragments
  57. };
  58. struct _CM_VCCB *CmVcCB;
  59. } NDISWAN_MINIPORT_RESERVED, *PNDISWAN_MINIPORT_RESERVED;
  60. typedef struct _POOLDESC_LIST {
  61. LIST_ENTRY List;
  62. NDIS_SPIN_LOCK Lock;
  63. ULONG TotalDescCount;
  64. ULONG MaxDescCount;
  65. ULONG AllocatedCount;
  66. ULONG MaxAllocatedCount;
  67. ULONG FreeCount;
  68. } POOLDESC_LIST, *PPOOLDESC_LIST;
  69. typedef struct _POOL_DESC {
  70. LIST_ENTRY Linkage;
  71. SINGLE_LIST_ENTRY Head;
  72. NDIS_HANDLE PoolHandle;
  73. ULONG AllocatedCount;
  74. ULONG MaxAllocatedCount;
  75. ULONG FreeCount;
  76. } POOL_DESC, *PPOOL_DESC;
  77. typedef struct _PACKET_QUEUE {
  78. PNDIS_PACKET HeadQueue; // Queue of ndis packets
  79. // waiting to be sent
  80. PNDIS_PACKET TailQueue; // Last packet on the queue
  81. ULONG ByteDepth;
  82. ULONG MaxByteDepth;
  83. ULONG PacketDepth;
  84. ULONG MaxPacketDepth;
  85. ULONG DumpedPacketCount;
  86. ULONG DumpedByteCount;
  87. LONG OutstandingFrags;
  88. } PACKET_QUEUE, *PPACKET_QUEUE;
  89. #endif // end of _NDISWAN_PACKETS_