PACKET32.H
上传用户:d748196
上传日期:2007-01-07
资源大小:42k
文件大小:2k
源码类别:

网络截获/分析

开发平台:

WINDOWS

  1. #include "ntddpack.h"
  2. #ifndef __PACKET32
  3. #define __PACKET32
  4. #define EXPORT __declspec(dllexport)
  5. #define        DOSNAMEPREFIX   TEXT("Packet_")
  6. #define        MAX_LINK_NAME_LENGTH   64
  7. typedef struct _ADAPTER {
  8.     HANDLE     hFile;
  9.     TCHAR      SymbolicLink[MAX_LINK_NAME_LENGTH];
  10.     } ADAPTER, *LPADAPTER;
  11. typedef struct _PACKET {
  12.     HANDLE       hEvent;
  13.     OVERLAPPED   OverLapped;
  14.     PVOID        Buffer;
  15.     UINT         Length;
  16.     } PACKET, *LPPACKET;
  17. /* Receiver Block definition */
  18.     struct rcvblk {
  19.         int       active;
  20.         int       intf;
  21.         struct ep *pep;
  22.         int       len;
  23.         DWORD     cbRet;
  24.         LPPACKET  lpPacket;
  25.     };
  26. #define RTAB_SIZE 8                 /* 8 is an empirical value */
  27. PVOID PacketOpenAdapter(LPTSTR AdapterName);
  28. BOOLEAN PacketSendPacket(LPADAPTER lpAdapter,
  29.                          LPPACKET  lpPacket,
  30.                          BOOLEAN   Sync);
  31. PVOID PacketAllocatePacket();             
  32. VOID PacketInitPacket(LPPACKET lpPacket,    
  33.                       PVOID    Buffer,
  34.                       UINT     Length);
  35. VOID PacketFreePacket(LPPACKET lpPacket);
  36. BOOLEAN PacketResetAdapter(LPADAPTER lpAdapter);
  37. ULONG PacketGetAddress(LPADAPTER lpAdapter,
  38.                        PUCHAR    AddressBuffer);
  39. BOOLEAN PacketWaitPacket(LPADAPTER  lpAdapter,
  40.                          LPPACKET   lpPacket,
  41.                          PULONG     BytesReceived);
  42. BOOLEAN PacketReceivePacket(LPADAPTER lpAdapter,
  43.                             LPPACKET  lpPacket,
  44.                             BOOLEAN   Sync,
  45.                             PULONG    BytesReceived);
  46. VOID PacketCloseAdapter(LPADAPTER lpAdapter);
  47. BOOLEAN PacketSetFilter(LPADAPTER lpAdapter,
  48.                         ULONG     Filter);
  49. ULONG PacketGetAdapterNames(PTSTR   pStr,
  50.                             PULONG  BufferSize);
  51. ULONG PacketRequest(LPADAPTER lpAdapter,
  52.                     BOOLEAN   Set,
  53.                     PPACKET_OID_DATA OidData);
  54. ULONG PacketGetName(PTSTR pStr, 
  55.                     ULONG n);
  56. #endif