home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / buffer.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  4.6 KB  |  119 lines

  1.  
  2. //=============================================================================
  3. //  Microsoft (R) Bloodhound (tm). Copyright (C) 1991-1992.
  4. //
  5. //  MODULE: buffer.h
  6. //
  7. //  This source file contains defintions for Bloodhound buffers.
  8. //=============================================================================
  9.  
  10. #if !defined(_BUFFER_)
  11. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  12.  
  13. #define _BUFFER_
  14.  
  15. #pragma pack(1)
  16.  
  17. #define BUFFERSIZE      ((DWORD) 32768U)    //... Size of each buffer (NDIS and ODI NAL's).
  18.  
  19. #define ONE_MEG         32
  20.  
  21. #define ONE_HALF_MEG    (ONE_MEG / 2)
  22.  
  23. #define STAT_FRAME_SIZE 1024
  24.  
  25. //=============================================================================
  26. //  Frame type.
  27. //=============================================================================
  28.  
  29. typedef struct _FRAME
  30. {
  31.     DWORD   TimeStamp;        //... Relative time in milliseconds.
  32.     WORD    FrameLength;    //... MAC frame length.
  33.     WORD    nBytesAvail;    //... Actual frame length copied.
  34.     BYTE    MacFrame[0];    //... Frame data.
  35. } FRAME;
  36.  
  37. typedef FRAME *LPFRAME;
  38. typedef FRAME UNALIGNED *ULPFRAME;
  39.  
  40. #define FRAME_SIZE  sizeof(FRAME)
  41.  
  42. //=============================================================================
  43. //  Buffer Table Entry (BTE). This is the private part of the buffer for
  44. //  the NDIS 2.0, NDIS 3.0, and ODI nals.
  45. //=============================================================================
  46.  
  47. typedef struct _BTE *LPBTE;
  48.  
  49. typedef struct _BTE
  50. {
  51.     DWORD   ObjectType;     //... 'BTE$'. Filled in byt kernel.
  52.     DWORD   Flags;        //... Used by Nal/driver.
  53.     LPBTE   KrnlModeNext;    //... Optional, reserved for NAL usage.
  54.     LPBTE   Next;        //... Pointer to next BTE.
  55.     LPFRAME UserModeBuffer;    //... User mode buffer pointer.
  56.     LPVOID  KrnlModeBuffer;    //... Kernel mode buffer pointer.
  57.     DWORD   Length;        //... Overall buffer length (in bytes)
  58.     DWORD   ByteCount;        //... Number of bytes in buffer.
  59.     DWORD   FrameCount;     //... Number of frames in buffer.
  60.     WORD    DropCount;          //... Number of dropped frames detected.
  61.     WORD    TransfersPended;    //... Number of transferdatas pended by mac
  62. } BTE;
  63.  
  64. #define BTE_SIZE    sizeof(BTE)
  65.  
  66. //=============================================================================
  67. //  Buffer type.
  68. //=============================================================================
  69.  
  70. typedef struct _BUFFER
  71. {
  72.     //=========================================================================
  73.     //  PUBLIC portion of BUFFER type. This section is filled in by NAL.DLL.
  74.     //  The public section is 64 bytes in size.
  75.     //=========================================================================
  76.  
  77.     DWORD           ObjectType;         //... 'BUF$'.
  78.     DWORD           NetworkID;          //... Network ID.
  79.     DWORD           BufferSize;         //... Buffer size requested.
  80.     DWORD           TotalBytes;         //... Total bytes captured.
  81.     DWORD           TotalFrames;        //... Total frames captured.
  82.     LPVOID          hNetwork;           //... Handle of network.
  83.     SYSTEMTIME      TimeOfCapture;      //... Time of capture.
  84.     LPBTE           StatFrameBTE;          //... Pointer to the stat frame
  85.     DWORD           Reserved[5];        //... Reserved for future use.
  86.  
  87.     //=========================================================================
  88.     //  PRIVATE portion of BUFFER type. This section is filled by NAL drivers/dlls.
  89.     //  The private section is 32 bytes in size.
  90.     //=========================================================================
  91.  
  92. //    BYTE        Private[32];    //... 32 bytes of private space for NAL use.
  93. //  start MSINTERNAL
  94.     DWORD        HeadBTEIndex;    //... BTE containing frame #1, filled in by NAL.
  95.     DWORD        TailBTEIndex;    //... BTE containing frame #N, filled in by NAL.
  96.     DWORD        NumberOfBuffers;    //... Total number of BTE's, filled in by kernel.
  97.     DWORD           NumberOfBuffersUsed;//... Total number of BTE's used, filled in by driver.
  98.     DWORD           Pad[4];             //... Pad out to 32 bytes.
  99.     BTE             bte[0];             //... BTE's follow BUFFER structure in memory.
  100. // stop MSINTERNAL
  101. } BUFFER;
  102.  
  103. typedef BUFFER *HBUFFER;
  104.  
  105. //=============================================================================
  106. //  FUNCTION: GetBteIndex();
  107. //
  108. //  Modification History
  109. //
  110. //  raypa       07/10/93                Created.
  111. //=============================================================================
  112.  
  113. #define GetBteIndex(hBuffer, lpBte)       ((DWORD) ((lpBte) - (hBuffer)->bte))
  114.  
  115. #pragma pack()
  116.  
  117. #pragma option pop /*P_O_Pop*/
  118. #endif
  119.