Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

Packet32.h File Reference

#include <winsock2.h>
#include "devioctl.h"

Go to the source code of this file.

Classes

struct  NetType
 Network type structure. More...
struct  bpf_program
 A BPF pseudo-assembly program. More...
struct  bpf_insn
 A single BPF pseudo-instruction. More...
struct  bpf_stat
 Structure that contains a couple of statistics values on the current capture. More...
struct  bpf_hdr
 Packet header. More...
struct  npf_if_addr
 Addresses of a network adapter. More...
struct  _ADAPTER
 Describes a network adapter. More...
struct  _PACKET
 Structure that contains a group of packets coming from the driver. More...
struct  _PACKET_OID_DATA
 Structure containing an OID request. More...

Defines

#define PACKET_MODE_CAPT   0x0
 Capture mode.
#define PACKET_MODE_STAT   0x1
 Statistical mode.
#define PACKET_MODE_MON   0x2
 Monitoring mode.
#define PACKET_MODE_DUMP   0x10
 Dump mode.
#define PACKET_MODE_STAT_DUMP   MODE_DUMP | MODE_STAT
 Statistical dump Mode.
#define FILE_DEVICE_PROTOCOL   0x8000
#define IOCTL_PROTOCOL_STATISTICS   CTL_CODE(FILE_DEVICE_PROTOCOL, 2 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PROTOCOL_RESET   CTL_CODE(FILE_DEVICE_PROTOCOL, 3 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PROTOCOL_READ   CTL_CODE(FILE_DEVICE_PROTOCOL, 4 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PROTOCOL_WRITE   CTL_CODE(FILE_DEVICE_PROTOCOL, 5 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_PROTOCOL_MACNAME   CTL_CODE(FILE_DEVICE_PROTOCOL, 6 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_OPEN   CTL_CODE(FILE_DEVICE_PROTOCOL, 7 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_CLOSE   CTL_CODE(FILE_DEVICE_PROTOCOL, 8 , METHOD_BUFFERED, FILE_ANY_ACCESS)
#define pBIOCSETBUFFERSIZE   9592
 IOCTL code: set kernel buffer size.
#define pBIOCSETF   9030
 IOCTL code: set packet filtering program.
#define pBIOCGSTATS   9031
 IOCTL code: get the capture stats.
#define pBIOCSRTIMEOUT   7416
 IOCTL code: set the read timeout.
#define pBIOCSMODE   7412
 IOCTL code: set working mode.
#define pBIOCSWRITEREP   7413
 IOCTL code: set number of physical repetions of every packet written by the app.
#define pBIOCSMINTOCOPY   7414
 IOCTL code: set minimum amount of data in the kernel buffer that unlocks a read call.
#define pBIOCSETOID   2147483648
 IOCTL code: set an OID value.
#define pBIOCQUERYOID   2147483652
 IOCTL code: get an OID value.
#define pATTACHPROCESS   7117
 IOCTL code: attach a process to the driver. Used in Win9x only.
#define pDETACHPROCESS   7118
 IOCTL code: detach a process from the driver. Used in Win9x only.
#define pBIOCSETDUMPFILENAME   9029
 IOCTL code: set the name of a the file used by kernel dump mode.
#define pBIOCEVNAME   7415
 IOCTL code: get the name of the event that the driver signals when some data is present in the buffer.
#define pBIOCSENDPACKETSNOSYNC   9032
 IOCTL code: Send a buffer containing multiple packets to the network, ignoring the timestamps associated with the packets.
#define pBIOCSENDPACKETSSYNC   9033
 IOCTL code: Send a buffer containing multiple packets to the network, respecting the timestamps associated with the packets.
#define pBIOCSETDUMPLIMITS   9034
 IOCTL code: Set the dump file limits. See the PacketSetDumpLimits() function.
#define pBIOCISDUMPENDED   7411
 IOCTL code: Get the status of the kernel dump process. See the PacketIsDumpEnded() function.
#define pBIOCSTIMEZONE   7471
 IOCTL code: set time zone. Used in Win9x only.
#define Packet_ALIGNMENT   sizeof(int)
 Alignment macro. Defines the alignment size.
#define Packet_WORDALIGN(x)   (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1))
 Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT.
#define NdisMediumNull   -1
#define NdisMediumCHDLC   -2
#define NdisMediumPPPSerial   -3
#define DOSNAMEPREFIX   TEXT("Packet_")
 Prefix added to the adapters device names to create the WinPcap devices.
#define MAX_LINK_NAME_LENGTH   64
#define NMAX_PACKET   65535
#define ADAPTER_NAME_LENGTH   256 + 12
 Maximum length for the name of an adapter. The value is the same used by the IP Helper API.
#define ADAPTER_DESC_LENGTH   128
 Maximum length for the description of an adapter. The value is the same used by the IP Helper API.
#define MAX_MAC_ADDR_LENGTH   8
 Maximum length for the link layer address of an adapter. The value is the same used by the IP Helper API.
#define MAX_NETWORK_ADDRESSES   16
 Maximum length for the link layer address of an adapter. The value is the same used by the IP Helper API.
#define INFO_FLAG_NDIS_ADAPTER   0
 Flag for ADAPTER_INFO: this is a traditional ndis adapter.
#define INFO_FLAG_NDISWAN_ADAPTER   1
 Flag for ADAPTER_INFO: this is a NdisWan adapter.
#define INFO_FLAG_DAG_CARD   2
 Flag for ADAPTER_INFO: this is a DAG card.
#define INFO_FLAG_DAG_FILE   6
 Flag for ADAPTER_INFO: this is a DAG file.
#define INFO_FLAG_DONT_EXPORT   8
 Flag for ADAPTER_INFO: when this flag is set, the adapter will not be listed or openend by winpcap. This allows to prevent exporting broken network adapters, like for example FireWire ones.
#define ODS(_x)
#define ODSEx(_x, _y)
#define FIREWIRE_SUBSTR   L"1394"

Typedefs

typedef NetType NetType
 Network type structure.
typedef npf_if_addr npf_if_addr
 Addresses of a network adapter.
typedef WAN_ADAPTER_INT WAN_ADAPTER
 Describes an opened wan (dialup, VPN...) network adapter using the NetMon API.
typedef WAN_ADAPTERPWAN_ADAPTER
 Describes an opened wan (dialup, VPN...) network adapter using the NetMon API.
typedef _ADAPTER_INFO ADAPTER_INFO
 Contains comprehensive information about a network adapter.
typedef _ADAPTER_INFOPADAPTER_INFO
 Contains comprehensive information about a network adapter.
typedef _ADAPTER ADAPTER
 Describes an opened network adapter.
typedef _ADAPTERLPADAPTER
 Describes an opened network adapter.
typedef _PACKET PACKET
 Structure that contains a group of packets coming from the driver.
typedef _PACKETLPPACKET
 Structure that contains a group of packets coming from the driver.
typedef _PACKET_OID_DATA PACKET_OID_DATA
typedef _PACKET_OID_DATAPPACKET_OID_DATA

Functions

void PacketPopulateAdaptersInfoList ()
PWCHAR SChar2WChar (PCHAR string)
PCHAR WChar2SChar (PWCHAR string)
BOOL PacketGetFileVersion (LPTSTR FileName, PCHAR VersionBuff, UINT VersionBuffLen)
PADAPTER_INFO PacketFindAdInfo (PCHAR AdapterName)
BOOLEAN PacketUpdateAdInfo (PCHAR AdapterName)
BOOLEAN IsFireWire (TCHAR *AdapterDesc)
PCHAR PacketGetVersion ()
PCHAR PacketGetDriverVersion ()
BOOLEAN PacketSetMinToCopy (LPADAPTER AdapterObject, int nbytes)
BOOLEAN PacketSetNumWrites (LPADAPTER AdapterObject, int nwrites)
BOOLEAN PacketSetMode (LPADAPTER AdapterObject, int mode)
BOOLEAN PacketSetReadTimeout (LPADAPTER AdapterObject, int timeout)
BOOLEAN PacketSetBpf (LPADAPTER AdapterObject, struct bpf_program *fp)
INT PacketSetSnapLen (LPADAPTER AdapterObject, int snaplen)
BOOLEAN PacketGetStats (LPADAPTER AdapterObject, struct bpf_stat *s)
BOOLEAN PacketGetStatsEx (LPADAPTER AdapterObject, struct bpf_stat *s)
BOOLEAN PacketSetBuff (LPADAPTER AdapterObject, int dim)
BOOLEAN PacketGetNetType (LPADAPTER AdapterObject, NetType *type)
LPADAPTER PacketOpenAdapter (PCHAR AdapterName)
BOOLEAN PacketSendPacket (LPADAPTER AdapterObject, LPPACKET pPacket, BOOLEAN Sync)
INT PacketSendPackets (LPADAPTER AdapterObject, PVOID PacketBuff, ULONG Size, BOOLEAN Sync)
LPPACKET PacketAllocatePacket (void)
VOID PacketInitPacket (LPPACKET lpPacket, PVOID Buffer, UINT Length)
VOID PacketFreePacket (LPPACKET lpPacket)
BOOLEAN PacketReceivePacket (LPADAPTER AdapterObject, LPPACKET lpPacket, BOOLEAN Sync)
BOOLEAN PacketSetHwFilter (LPADAPTER AdapterObject, ULONG Filter)
BOOLEAN PacketGetAdapterNames (PTSTR pStr, PULONG BufferSize)
BOOLEAN PacketGetNetInfoEx (PCHAR AdapterName, npf_if_addr *buffer, PLONG NEntries)
BOOLEAN PacketRequest (LPADAPTER AdapterObject, BOOLEAN Set, PPACKET_OID_DATA OidData)
HANDLE PacketGetReadEvent (LPADAPTER AdapterObject)
BOOLEAN PacketSetDumpName (LPADAPTER AdapterObject, void *name, int len)
BOOLEAN PacketSetDumpLimits (LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks)
BOOLEAN PacketIsDumpEnded (LPADAPTER AdapterObject, BOOLEAN sync)
BOOL PacketStopDriver ()
VOID PacketCloseAdapter (LPADAPTER lpAdapter)


Define Documentation

#define FIREWIRE_SUBSTR   L"1394"
 

Definition at line 374 of file Packet32.h.


Function Documentation

BOOLEAN IsFireWire TCHAR *  AdapterDesc  ) 
 

LPPACKET PacketAllocatePacket void   ) 
 

VOID PacketCloseAdapter LPADAPTER  lpAdapter  ) 
 

PADAPTER_INFO PacketFindAdInfo PCHAR  AdapterName  ) 
 

VOID PacketFreePacket LPPACKET  lpPacket  ) 
 

BOOLEAN PacketGetAdapterNames PTSTR  pStr,
PULONG  BufferSize
 

PCHAR PacketGetDriverVersion  ) 
 

BOOL PacketGetFileVersion LPTSTR  FileName,
PCHAR  VersionBuff,
UINT  VersionBuffLen
 

BOOLEAN PacketGetNetInfoEx PCHAR  AdapterName,
npf_if_addr buffer,
PLONG  NEntries
 

BOOLEAN PacketGetNetType LPADAPTER  AdapterObject,
NetType type
 

HANDLE PacketGetReadEvent LPADAPTER  AdapterObject  ) 
 

BOOLEAN PacketGetStats LPADAPTER  AdapterObject,
struct bpf_stat s
 

BOOLEAN PacketGetStatsEx LPADAPTER  AdapterObject,
struct bpf_stat s
 

PCHAR PacketGetVersion  ) 
 

VOID PacketInitPacket LPPACKET  lpPacket,
PVOID  Buffer,
UINT  Length
 

BOOLEAN PacketIsDumpEnded LPADAPTER  AdapterObject,
BOOLEAN  sync
 

LPADAPTER PacketOpenAdapter PCHAR  AdapterName  ) 
 

void PacketPopulateAdaptersInfoList  ) 
 

BOOLEAN PacketReceivePacket LPADAPTER  AdapterObject,
LPPACKET  lpPacket,
BOOLEAN  Sync
 

BOOLEAN PacketRequest LPADAPTER  AdapterObject,
BOOLEAN  Set,
PPACKET_OID_DATA  OidData
 

BOOLEAN PacketSendPacket LPADAPTER  AdapterObject,
LPPACKET  pPacket,
BOOLEAN  Sync
 

INT PacketSendPackets LPADAPTER  AdapterObject,
PVOID  PacketBuff,
ULONG  Size,
BOOLEAN  Sync
 

BOOLEAN PacketSetBpf LPADAPTER  AdapterObject,
struct bpf_program fp
 

BOOLEAN PacketSetBuff LPADAPTER  AdapterObject,
int  dim
 

BOOLEAN PacketSetDumpLimits LPADAPTER  AdapterObject,
UINT  maxfilesize,
UINT  maxnpacks
 

BOOLEAN PacketSetDumpName LPADAPTER  AdapterObject,
void *  name,
int  len
 

BOOLEAN PacketSetHwFilter LPADAPTER  AdapterObject,
ULONG  Filter
 

BOOLEAN PacketSetMinToCopy LPADAPTER  AdapterObject,
int  nbytes
 

BOOLEAN PacketSetMode LPADAPTER  AdapterObject,
int  mode
 

BOOLEAN PacketSetNumWrites LPADAPTER  AdapterObject,
int  nwrites
 

BOOLEAN PacketSetReadTimeout LPADAPTER  AdapterObject,
int  timeout
 

INT PacketSetSnapLen LPADAPTER  AdapterObject,
int  snaplen
 

BOOL PacketStopDriver  ) 
 

BOOLEAN PacketUpdateAdInfo PCHAR  AdapterName  ) 
 

PWCHAR SChar2WChar PCHAR  string  ) 
 

PCHAR WChar2SChar PWCHAR  string  ) 
 


Generated on Sun May 14 14:51:29 2006 by  doxygen 1.4.2