50 #ifdef HAVE_AIRPCAP_API 53 #if !defined(AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_) 54 #define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_ 64 #define PACKET_MODE_CAPT 0x0 65 #define PACKET_MODE_STAT 0x1 66 #define PACKET_MODE_MON 0x2 67 #define PACKET_MODE_DUMP 0x10 68 #define PACKET_MODE_STAT_DUMP MODE_DUMP | MODE_STAT 72 #define Packet_ALIGNMENT sizeof(int) 73 #define Packet_WORDALIGN(x) (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1)) 76 #define NdisMediumNull -1 77 #define NdisMediumCHDLC -2 78 #define NdisMediumPPPSerial -3 79 #define NdisMediumBare80211 -4 80 #define NdisMediumRadio80211 -5 81 #define NdisMediumPpi -6 84 #define NPF_DISABLE_LOOPBACK 1 85 #define NPF_ENABLE_LOOPBACK 2 101 #ifndef BPF_MAJOR_VERSION 152 struct timeval bh_tstamp;
184 #define DOSNAMEPREFIX TEXT("Packet_") 185 #define MAX_LINK_NAME_LENGTH 64 //< Maximum length of the devices symbolic links 186 #define NMAX_PACKET 65535 195 struct sockaddr_storage IPAddress;
196 struct sockaddr_storage SubnetMask;
197 struct sockaddr_storage Broadcast;
201 #define ADAPTER_NAME_LENGTH 256 + 12 202 #define ADAPTER_DESC_LENGTH 128 203 #define MAX_MAC_ADDR_LENGTH 8 204 #define MAX_NETWORK_ADDRESSES 16 210 #define INFO_FLAG_NDIS_ADAPTER 0 211 #define INFO_FLAG_NDISWAN_ADAPTER 1 212 #define INFO_FLAG_DAG_CARD 2 213 #define INFO_FLAG_DAG_FILE 6 214 #define INFO_FLAG_DONT_EXPORT 8 215 #define INFO_FLAG_AIRPCAP_CARD 16 216 #define INFO_FLAG_NPFIM_DEVICE 32 243 #ifdef HAVE_AIRPCAP_API 245 #endif // HAVE_AIRPCAP_API 247 #ifdef HAVE_NPFIM_API 249 #endif // HAVE_NPFIM_API 254 struct timeval DagReadTimeout;
256 DWORD DagFastProcess;
257 #endif // HAVE_DAG_API 330 BOOLEAN
PacketSendPacket(LPADAPTER AdapterObject,LPPACKET pPacket,BOOLEAN Sync);
331 INT
PacketSendPackets(LPADAPTER AdapterObject,PVOID PacketBuff,ULONG Size, BOOLEAN Sync);
339 BOOLEAN
PacketRequest(LPADAPTER AdapterObject,BOOLEAN Set,PPACKET_OID_DATA OidData);
346 BOOLEAN
PacketStartOem(PCHAR errorString, UINT errorStringLength);
347 BOOLEAN
PacketStartOemEx(PCHAR errorString, UINT errorStringLength, ULONG flags);
353 #define PACKET_START_OEM_NO_NETMON 0x00000001 PCHAR PacketGetDriverVersion()
struct _ADAPTER ADAPTER
Describes an opened network adapter.
A single BPF pseudo-instruction.
Describes an opened network adapter.
Structure that contains a couple of statistics values on the current capture.
VOID PacketFreePacket(LPPACKET lpPacket)
BOOLEAN PacketSetDumpName(LPADAPTER AdapterObject, void *name, int len)
USHORT code
Instruction type and addressing mode.
ULONG Oid
for a complete list of valid codes.
Addresses of a network adapter.
BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject, ULONG Filter)
BOOLEAN PacketGetStats(LPADAPTER AdapterObject, struct bpf_stat *s)
BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject, int timeout)
BOOLEAN PacketSetBuff(LPADAPTER AdapterObject, int dim)
INT PacketSendPackets(LPADAPTER AdapterObject, PVOID PacketBuff, ULONG Size, BOOLEAN Sync)
int NumWrites
on the wire.
Structure that contains a group of packets coming from the driver.
WAN_ADAPTER * PWAN_ADAPTER
Describes an opened wan (dialup, VPN...) network adapter using the NetMon API.
UINT Flags
Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the...
BOOLEAN PacketSetMode(LPADAPTER AdapterObject, int mode)
BOOLEAN PacketSetBpf(LPADAPTER AdapterObject, struct bpf_program *fp)
DWORD ulBytesReceived
received by the last call to PacketReceivePacket()
#define MAX_LINK_NAME_LENGTH
BOOLEAN PacketStartOemEx(PCHAR errorString, UINT errorStringLength, ULONG flags)
A BPF pseudo-assembly program.
struct _PACKET_OID_DATA * PPACKET_OID_DATA
Structure containing an OID request.
VOID PacketCloseAdapter(LPADAPTER lpAdapter)
LPPACKET PacketAllocatePacket(void)
struct _AirpcapHandle * PAirpcapHandle
UINT bf_len
Indicates the number of instructions of the program, i.e. the number of struct bpf_insn that will fol...
#define ADAPTER_NAME_LENGTH
Maximum length for the name of an adapter. The value is the same used by the IP Helper API...
UINT ReadTimeOut
ReadEvent will be signaled, also if no packets were captured.
LPADAPTER PacketOpenAdapter(PCHAR AdapterName)
struct _ADAPTER * LPADAPTER
struct npf_if_addr npf_if_addr
Addresses of a network adapter.
BOOLEAN PacketStartOem(PCHAR errorString, UINT errorStringLength)
BOOLEAN PacketSetMinToCopy(LPADAPTER AdapterObject, int nbytes)
BOOLEAN PacketSetNumWrites(LPADAPTER AdapterObject, int nwrites)
struct bpf_insn * bf_insns
A pointer to the first instruction of the program.
struct NetType NetType
Network type structure.
BOOLEAN PacketSetLoopbackBehavior(LPADAPTER AdapterObject, UINT LoopbackBehavior)
BOOLEAN PacketGetAdapterNames(PTSTR pStr, PULONG BufferSize)
BOOLEAN PacketRequest(LPADAPTER AdapterObject, BOOLEAN Set, PPACKET_OID_DATA OidData)
BOOLEAN PacketSendPacket(LPADAPTER AdapterObject, LPPACKET pPacket, BOOLEAN Sync)
BOOLEAN PacketIsDumpEnded(LPADAPTER AdapterObject, BOOLEAN sync)
INT PacketSetSnapLen(LPADAPTER AdapterObject, int snaplen)
struct _PACKET * LPPACKET
struct WAN_ADAPTER_INT WAN_ADAPTER
Describes an opened wan (dialup, VPN...) network adapter using the NetMon API.
UINT bs_capt
thus reach the application.
PVOID Buffer
details about the organization of the data in this buffer
HANDLE PacketGetReadEvent(LPADAPTER AdapterObject)
VOID PacketInitPacket(LPPACKET lpPacket, PVOID Buffer, UINT Length)
BOOLEAN PacketGetNetInfoEx(PCHAR AdapterName, npf_if_addr *buffer, PLONG NEntries)
BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks)
BOOLEAN PacketGetStatsEx(LPADAPTER AdapterObject, struct bpf_stat *s)
struct _PACKET PACKET
Structure that contains a group of packets coming from the driver.
BOOLEAN PacketGetNetType(LPADAPTER AdapterObject, NetType *type)
UINT LinkType
The MAC of the current network adapter (see function PacketGetNetType() for more information) ...
int k
Generic field used for various purposes.
ULONG Length
Length of the data field.
BOOLEAN PacketReceivePacket(LPADAPTER AdapterObject, LPPACKET lpPacket, BOOLEAN Sync)
ULONGLONG LinkSpeed
The speed of the network in bits per second.
PAirpcapHandle PacketGetAirPcapHandle(LPADAPTER AdapterObject)