1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/boardsupport/emulator/emulatorbsp/wpdpack/include/packet32.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,405 @@
1.4 +/*
1.5 + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
1.6 + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
1.7 + * All rights reserved.
1.8 + *
1.9 + * Redistribution and use in source and binary forms, with or without
1.10 + * modification, are permitted provided that the following conditions
1.11 + * are met:
1.12 + *
1.13 + * 1. Redistributions of source code must retain the above copyright
1.14 + * notice, this list of conditions and the following disclaimer.
1.15 + * 2. Redistributions in binary form must reproduce the above copyright
1.16 + * notice, this list of conditions and the following disclaimer in the
1.17 + * documentation and/or other materials provided with the distribution.
1.18 + * 3. Neither the name of the Politecnico di Torino, CACE Technologies
1.19 + * nor the names of its contributors may be used to endorse or promote
1.20 + * products derived from this software without specific prior written
1.21 + * permission.
1.22 + *
1.23 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1.24 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1.25 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1.26 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1.27 + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1.28 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1.29 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1.30 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1.31 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1.32 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1.33 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.34 + *
1.35 + */
1.36 +
1.37 +/** @ingroup packetapi
1.38 + * @{
1.39 + */
1.40 +
1.41 +/** @defgroup packet32h Packet.dll definitions and data structures
1.42 + * Packet32.h contains the data structures and the definitions used by packet.dll.
1.43 + * The file is used both by the Win9x and the WinNTx versions of packet.dll, and can be included
1.44 + * by the applications that use the functions of this library
1.45 + * @{
1.46 + */
1.47 +
1.48 +#ifndef __PACKET32
1.49 +#define __PACKET32
1.50 +
1.51 +#include <winsock2.h>
1.52 +
1.53 +#include "devioctl.h"
1.54 +
1.55 +#ifdef HAVE_AIRPCAP_API
1.56 +#include <airpcap.h>
1.57 +#else
1.58 +#if !defined(AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_)
1.59 +#define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_
1.60 +typedef struct _AirpcapHandle *PAirpcapHandle;
1.61 +#endif /* AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_ */
1.62 +#endif /* HAVE_AIRPCAP_API */
1.63 +
1.64 +#ifdef HAVE_DAG_API
1.65 +#include <dagc.h>
1.66 +#endif /* HAVE_DAG_API */
1.67 +
1.68 +// Working modes
1.69 +#define PACKET_MODE_CAPT 0x0 ///< Capture mode
1.70 +#define PACKET_MODE_STAT 0x1 ///< Statistical mode
1.71 +#define PACKET_MODE_MON 0x2 ///< Monitoring mode
1.72 +#define PACKET_MODE_DUMP 0x10 ///< Dump mode
1.73 +#define PACKET_MODE_STAT_DUMP MODE_DUMP | MODE_STAT ///< Statistical dump Mode
1.74 +
1.75 +// ioctls
1.76 +#define FILE_DEVICE_PROTOCOL 0x8000
1.77 +
1.78 +#define IOCTL_PROTOCOL_STATISTICS CTL_CODE(FILE_DEVICE_PROTOCOL, 2 , METHOD_BUFFERED, FILE_ANY_ACCESS)
1.79 +#define IOCTL_PROTOCOL_RESET CTL_CODE(FILE_DEVICE_PROTOCOL, 3 , METHOD_BUFFERED, FILE_ANY_ACCESS)
1.80 +#define IOCTL_PROTOCOL_READ CTL_CODE(FILE_DEVICE_PROTOCOL, 4 , METHOD_BUFFERED, FILE_ANY_ACCESS)
1.81 +#define IOCTL_PROTOCOL_WRITE CTL_CODE(FILE_DEVICE_PROTOCOL, 5 , METHOD_BUFFERED, FILE_ANY_ACCESS)
1.82 +#define IOCTL_PROTOCOL_MACNAME CTL_CODE(FILE_DEVICE_PROTOCOL, 6 , METHOD_BUFFERED, FILE_ANY_ACCESS)
1.83 +#define IOCTL_OPEN CTL_CODE(FILE_DEVICE_PROTOCOL, 7 , METHOD_BUFFERED, FILE_ANY_ACCESS)
1.84 +#define IOCTL_CLOSE CTL_CODE(FILE_DEVICE_PROTOCOL, 8 , METHOD_BUFFERED, FILE_ANY_ACCESS)
1.85 +
1.86 +#define pBIOCSETBUFFERSIZE 9592 ///< IOCTL code: set kernel buffer size.
1.87 +#define pBIOCSETF 9030 ///< IOCTL code: set packet filtering program.
1.88 +#define pBIOCGSTATS 9031 ///< IOCTL code: get the capture stats.
1.89 +#define pBIOCSRTIMEOUT 7416 ///< IOCTL code: set the read timeout.
1.90 +#define pBIOCSMODE 7412 ///< IOCTL code: set working mode.
1.91 +#define pBIOCSWRITEREP 7413 ///< IOCTL code: set number of physical repetions of every packet written by the app.
1.92 +#define pBIOCSMINTOCOPY 7414 ///< IOCTL code: set minimum amount of data in the kernel buffer that unlocks a read call.
1.93 +#define pBIOCSETOID 2147483648U ///< IOCTL code: set an OID value.
1.94 +#define pBIOCQUERYOID 2147483652U ///< IOCTL code: get an OID value.
1.95 +#define pATTACHPROCESS 7117 ///< IOCTL code: attach a process to the driver. Used in Win9x only.
1.96 +#define pDETACHPROCESS 7118 ///< IOCTL code: detach a process from the driver. Used in Win9x only.
1.97 +#define pBIOCSETDUMPFILENAME 9029 ///< IOCTL code: set the name of a the file used by kernel dump mode.
1.98 +#define pBIOCEVNAME 7415 ///< IOCTL code: get the name of the event that the driver signals when some data is present in the buffer.
1.99 +#define pBIOCSENDPACKETSNOSYNC 9032 ///< IOCTL code: Send a buffer containing multiple packets to the network, ignoring the timestamps associated with the packets.
1.100 +#define pBIOCSENDPACKETSSYNC 9033 ///< IOCTL code: Send a buffer containing multiple packets to the network, respecting the timestamps associated with the packets.
1.101 +#define pBIOCSETDUMPLIMITS 9034 ///< IOCTL code: Set the dump file limits. See the PacketSetDumpLimits() function.
1.102 +#define pBIOCISDUMPENDED 7411 ///< IOCTL code: Get the status of the kernel dump process. See the PacketIsDumpEnded() function.
1.103 +#define pBIOCISETLOBBEH 7410 ///< IOCTL code: Set the loopback behavior of the driver with packets sent by itself: capture or drop.
1.104 +#define pBIOCSETEVENTHANDLE 7920 ///< IOCTL code: Passes the read event HANDLE allocated by the user (packet.dll) to the kernel level driver.
1.105 +
1.106 +#define pBIOCSTIMEZONE 7471 ///< IOCTL code: set time zone. Used in Win9x only.
1.107 +
1.108 +
1.109 +/// Alignment macro. Defines the alignment size.
1.110 +#define Packet_ALIGNMENT sizeof(int)
1.111 +/// Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT.
1.112 +#define Packet_WORDALIGN(x) (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1))
1.113 +
1.114 +#define NdisMediumNull -1 ///< Custom linktype: NDIS doesn't provide an equivalent
1.115 +#define NdisMediumCHDLC -2 ///< Custom linktype: NDIS doesn't provide an equivalent
1.116 +#define NdisMediumPPPSerial -3 ///< Custom linktype: NDIS doesn't provide an equivalent
1.117 +#define NdisMediumBare80211 -4 ///< Custom linktype: NDIS doesn't provide an equivalent
1.118 +#define NdisMediumRadio80211 -5 ///< Custom linktype: NDIS doesn't provide an equivalent
1.119 +
1.120 +// Loopback behaviour definitions
1.121 +#define NPF_DISABLE_LOOPBACK 1 ///< Drop the packets sent by the NPF driver
1.122 +#define NPF_ENABLE_LOOPBACK 2 ///< Capture the packets sent by the NPF driver
1.123 +
1.124 +/*!
1.125 + \brief Network type structure.
1.126 +
1.127 + This structure is used by the PacketGetNetType() function to return information on the current adapter's type and speed.
1.128 +*/
1.129 +typedef struct NetType
1.130 +{
1.131 + UINT LinkType; ///< The MAC of the current network adapter (see function PacketGetNetType() for more information)
1.132 + ULONGLONG LinkSpeed; ///< The speed of the network in bits per second
1.133 +}NetType;
1.134 +
1.135 +
1.136 +//some definitions stolen from libpcap
1.137 +
1.138 +#ifndef BPF_MAJOR_VERSION
1.139 +
1.140 +/*!
1.141 + \brief A BPF pseudo-assembly program.
1.142 +
1.143 + The program will be injected in the kernel by the PacketSetBPF() function and applied to every incoming packet.
1.144 +*/
1.145 +struct bpf_program
1.146 +{
1.147 + UINT bf_len; ///< Indicates the number of instructions of the program, i.e. the number of struct bpf_insn that will follow.
1.148 + struct bpf_insn *bf_insns; ///< A pointer to the first instruction of the program.
1.149 +};
1.150 +
1.151 +/*!
1.152 + \brief A single BPF pseudo-instruction.
1.153 +
1.154 + bpf_insn contains a single instruction for the BPF register-machine. It is used to send a filter program to the driver.
1.155 +*/
1.156 +struct bpf_insn
1.157 +{
1.158 + USHORT code; ///< Instruction type and addressing mode.
1.159 + UCHAR jt; ///< Jump if true
1.160 + UCHAR jf; ///< Jump if false
1.161 + int k; ///< Generic field used for various purposes.
1.162 +};
1.163 +
1.164 +/*!
1.165 + \brief Structure that contains a couple of statistics values on the current capture.
1.166 +
1.167 + It is used by packet.dll to return statistics about a capture session.
1.168 +*/
1.169 +struct bpf_stat
1.170 +{
1.171 + UINT bs_recv; ///< Number of packets that the driver received from the network adapter
1.172 + ///< from the beginning of the current capture. This value includes the packets
1.173 + ///< lost by the driver.
1.174 + UINT bs_drop; ///< number of packets that the driver lost from the beginning of a capture.
1.175 + ///< Basically, a packet is lost when the the buffer of the driver is full.
1.176 + ///< In this situation the packet cannot be stored and the driver rejects it.
1.177 + UINT ps_ifdrop; ///< drops by interface. XXX not yet supported
1.178 + UINT bs_capt; ///< number of packets that pass the filter, find place in the kernel buffer and
1.179 + ///< thus reach the application.
1.180 +};
1.181 +
1.182 +/*!
1.183 + \brief Packet header.
1.184 +
1.185 + This structure defines the header associated with every packet delivered to the application.
1.186 +*/
1.187 +struct bpf_hdr
1.188 +{
1.189 + struct timeval bh_tstamp; ///< The timestamp associated with the captured packet.
1.190 + ///< It is stored in a TimeVal structure.
1.191 + UINT bh_caplen; ///< Length of captured portion. The captured portion <b>can be different</b>
1.192 + ///< from the original packet, because it is possible (with a proper filter)
1.193 + ///< to instruct the driver to capture only a portion of the packets.
1.194 + UINT bh_datalen; ///< Original length of packet
1.195 + USHORT bh_hdrlen; ///< Length of bpf header (this struct plus alignment padding). In some cases,
1.196 + ///< a padding could be added between the end of this structure and the packet
1.197 + ///< data for performance reasons. This filed can be used to retrieve the actual data
1.198 + ///< of the packet.
1.199 +};
1.200 +
1.201 +/*!
1.202 + \brief Dump packet header.
1.203 +
1.204 + This structure defines the header associated with the packets in a buffer to be used with PacketSendPackets().
1.205 + It is simpler than the bpf_hdr, because it corresponds to the header associated by WinPcap and libpcap to a
1.206 + packet in a dump file. This makes straightforward sending WinPcap dump files to the network.
1.207 +*/
1.208 +struct dump_bpf_hdr{
1.209 + struct timeval ts; ///< Time stamp of the packet
1.210 + UINT caplen; ///< Length of captured portion. The captured portion can smaller than the
1.211 + ///< the original packet, because it is possible (with a proper filter) to
1.212 + ///< instruct the driver to capture only a portion of the packets.
1.213 + UINT len; ///< Length of the original packet (off wire).
1.214 +};
1.215 +
1.216 +
1.217 +#endif
1.218 +
1.219 +struct bpf_stat;
1.220 +
1.221 +#define DOSNAMEPREFIX TEXT("Packet_") ///< Prefix added to the adapters device names to create the WinPcap devices
1.222 +#define MAX_LINK_NAME_LENGTH 64 //< Maximum length of the devices symbolic links
1.223 +#define NMAX_PACKET 65535
1.224 +
1.225 +/*!
1.226 + \brief Addresses of a network adapter.
1.227 +
1.228 + This structure is used by the PacketGetNetInfoEx() function to return the IP addresses associated with
1.229 + an adapter.
1.230 +*/
1.231 +typedef struct npf_if_addr {
1.232 + struct sockaddr_storage IPAddress; ///< IP address.
1.233 + struct sockaddr_storage SubnetMask; ///< Netmask for that address.
1.234 + struct sockaddr_storage Broadcast; ///< Broadcast address.
1.235 +}npf_if_addr;
1.236 +
1.237 +
1.238 +#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.
1.239 +#define ADAPTER_DESC_LENGTH 128 ///< Maximum length for the description of an adapter. The value is the same used by the IP Helper API.
1.240 +#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.
1.241 +#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.
1.242 +
1.243 +
1.244 +typedef struct WAN_ADAPTER_INT WAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API
1.245 +typedef WAN_ADAPTER *PWAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API
1.246 +
1.247 +#define INFO_FLAG_NDIS_ADAPTER 0 ///< Flag for ADAPTER_INFO: this is a traditional ndis adapter
1.248 +#define INFO_FLAG_NDISWAN_ADAPTER 1 ///< Flag for ADAPTER_INFO: this is a NdisWan adapter, and it's managed by WANPACKET
1.249 +#define INFO_FLAG_DAG_CARD 2 ///< Flag for ADAPTER_INFO: this is a DAG card
1.250 +#define INFO_FLAG_DAG_FILE 6 ///< Flag for ADAPTER_INFO: this is a DAG file
1.251 +#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.
1.252 +#define INFO_FLAG_AIRPCAP_CARD 16 ///< Flag for ADAPTER_INFO: this is an airpcap card
1.253 +#define INFO_FLAG_NPFIM_DEVICE 32
1.254 +/*!
1.255 + \brief Contains comprehensive information about a network adapter.
1.256 +
1.257 + This structure is filled with all the accessory information that the user can need about an adapter installed
1.258 + on his system.
1.259 +*/
1.260 +typedef struct _ADAPTER_INFO
1.261 +{
1.262 + struct _ADAPTER_INFO *Next; ///< Pointer to the next adapter in the list.
1.263 + CHAR Name[ADAPTER_NAME_LENGTH + 1]; ///< Name of the device representing the adapter.
1.264 + CHAR Description[ADAPTER_DESC_LENGTH + 1]; ///< Human understandable description of the adapter
1.265 + UINT MacAddressLen; ///< Length of the link layer address.
1.266 + UCHAR MacAddress[MAX_MAC_ADDR_LENGTH]; ///< Link layer address.
1.267 + NetType LinkLayer; ///< Physical characteristics of this adapter. This NetType structure contains the link type and the speed of the adapter.
1.268 + INT NNetworkAddresses; ///< Number of network layer addresses of this adapter.
1.269 + npf_if_addr *NetworkAddresses; ///< Pointer to an array of npf_if_addr, each of which specifies a network address of this adapter.
1.270 + UINT Flags; ///< Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the dagc API.
1.271 +}
1.272 +ADAPTER_INFO, *PADAPTER_INFO;
1.273 +
1.274 +/*!
1.275 + \brief Describes an opened network adapter.
1.276 +
1.277 + This structure is the most important for the functioning of packet.dll, but the great part of its fields
1.278 + should be ignored by the user, since the library offers functions that avoid to cope with low-level parameters
1.279 +*/
1.280 +typedef struct _ADAPTER {
1.281 + HANDLE hFile; ///< \internal Handle to an open instance of the NPF driver.
1.282 + CHAR SymbolicLink[MAX_LINK_NAME_LENGTH]; ///< \internal A string containing the name of the network adapter currently opened.
1.283 + int NumWrites; ///< \internal Number of times a packets written on this adapter will be repeated
1.284 + ///< on the wire.
1.285 + HANDLE ReadEvent; ///< A notification event associated with the read calls on the adapter.
1.286 + ///< It can be passed to standard Win32 functions (like WaitForSingleObject
1.287 + ///< or WaitForMultipleObjects) to wait until the driver's buffer contains some
1.288 + ///< data. It is particularly useful in GUI applications that need to wait
1.289 + ///< concurrently on several events. In Windows NT/2000 the PacketSetMinToCopy()
1.290 + ///< function can be used to define the minimum amount of data in the kernel buffer
1.291 + ///< that will cause the event to be signalled.
1.292 +
1.293 + UINT ReadTimeOut; ///< \internal The amount of time after which a read on the driver will be released and
1.294 + ///< ReadEvent will be signaled, also if no packets were captured
1.295 + CHAR Name[ADAPTER_NAME_LENGTH];
1.296 + PWAN_ADAPTER pWanAdapter;
1.297 + UINT Flags; ///< Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the dagc API.
1.298 +
1.299 +#ifdef HAVE_AIRPCAP_API
1.300 + PAirpcapHandle AirpcapAd;
1.301 +#endif // HAVE_AIRPCAP_API
1.302 +
1.303 +#ifdef HAVE_NPFIM_API
1.304 + void* NpfImHandle;
1.305 +#endif // HAVE_NPFIM_API
1.306 +
1.307 +#ifdef HAVE_DAG_API
1.308 + dagc_t *pDagCard; ///< Pointer to the dagc API adapter descriptor for this adapter
1.309 + PCHAR DagBuffer; ///< Pointer to the buffer with the packets that is received from the DAG card
1.310 + struct timeval DagReadTimeout; ///< Read timeout. The dagc API requires a timeval structure
1.311 + unsigned DagFcsLen; ///< Length of the frame check sequence attached to any packet by the card. Obtained from the registry
1.312 + DWORD DagFastProcess; ///< True if the user requests fast capture processing on this card. Higher level applications can use this value to provide a faster but possibly unprecise capture (for example, libpcap doesn't convert the timestamps).
1.313 +#endif // HAVE_DAG_API
1.314 +} ADAPTER, *LPADAPTER;
1.315 +
1.316 +/*!
1.317 + \brief Structure that contains a group of packets coming from the driver.
1.318 +
1.319 + This structure defines the header associated with every packet delivered to the application.
1.320 +*/
1.321 +typedef struct _PACKET {
1.322 + HANDLE hEvent; ///< \deprecated Still present for compatibility with old applications.
1.323 + OVERLAPPED OverLapped; ///< \deprecated Still present for compatibility with old applications.
1.324 + PVOID Buffer; ///< Buffer with containing the packets. See the PacketReceivePacket() for
1.325 + ///< details about the organization of the data in this buffer
1.326 + UINT Length; ///< Length of the buffer
1.327 + DWORD ulBytesReceived; ///< Number of valid bytes present in the buffer, i.e. amount of data
1.328 + ///< received by the last call to PacketReceivePacket()
1.329 + BOOLEAN bIoComplete; ///< \deprecated Still present for compatibility with old applications.
1.330 +} PACKET, *LPPACKET;
1.331 +
1.332 +/*!
1.333 + \brief Structure containing an OID request.
1.334 +
1.335 + It is used by the PacketRequest() function to send an OID to the interface card driver.
1.336 + It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address,
1.337 + the list of the multicast groups defined on it, and so on.
1.338 +*/
1.339 +struct _PACKET_OID_DATA {
1.340 + ULONG Oid; ///< OID code. See the Microsoft DDK documentation or the file ntddndis.h
1.341 + ///< for a complete list of valid codes.
1.342 + ULONG Length; ///< Length of the data field
1.343 + UCHAR Data[1]; ///< variable-lenght field that contains the information passed to or received
1.344 + ///< from the adapter.
1.345 +};
1.346 +typedef struct _PACKET_OID_DATA PACKET_OID_DATA, *PPACKET_OID_DATA;
1.347 +
1.348 +#ifdef __cplusplus
1.349 +extern "C" {
1.350 +#endif
1.351 +
1.352 +/**
1.353 + * @}
1.354 + */
1.355 +
1.356 +/*
1.357 +BOOLEAN QueryWinPcapRegistryStringA(CHAR *SubKeyName,
1.358 + CHAR *Value,
1.359 + UINT *pValueLen,
1.360 + CHAR *DefaultVal);
1.361 +
1.362 +BOOLEAN QueryWinPcapRegistryStringW(WCHAR *SubKeyName,
1.363 + WCHAR *Value,
1.364 + UINT *pValueLen,
1.365 + WCHAR *DefaultVal);
1.366 +*/
1.367 +
1.368 +//---------------------------------------------------------------------------
1.369 +// EXPORTED FUNCTIONS
1.370 +//---------------------------------------------------------------------------
1.371 +
1.372 +PCHAR PacketGetVersion();
1.373 +PCHAR PacketGetDriverVersion();
1.374 +BOOLEAN PacketSetMinToCopy(LPADAPTER AdapterObject,int nbytes);
1.375 +BOOLEAN PacketSetNumWrites(LPADAPTER AdapterObject,int nwrites);
1.376 +BOOLEAN PacketSetMode(LPADAPTER AdapterObject,int mode);
1.377 +BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject,int timeout);
1.378 +BOOLEAN PacketSetBpf(LPADAPTER AdapterObject,struct bpf_program *fp);
1.379 +BOOLEAN PacketSetLoopbackBehavior(LPADAPTER AdapterObject, UINT LoopbackBehavior);
1.380 +INT PacketSetSnapLen(LPADAPTER AdapterObject,int snaplen);
1.381 +BOOLEAN PacketGetStats(LPADAPTER AdapterObject,struct bpf_stat *s);
1.382 +BOOLEAN PacketGetStatsEx(LPADAPTER AdapterObject,struct bpf_stat *s);
1.383 +BOOLEAN PacketSetBuff(LPADAPTER AdapterObject,int dim);
1.384 +BOOLEAN PacketGetNetType (LPADAPTER AdapterObject,NetType *type);
1.385 +LPADAPTER PacketOpenAdapter(PCHAR AdapterName);
1.386 +BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET pPacket,BOOLEAN Sync);
1.387 +INT PacketSendPackets(LPADAPTER AdapterObject,PVOID PacketBuff,ULONG Size, BOOLEAN Sync);
1.388 +LPPACKET PacketAllocatePacket(void);
1.389 +VOID PacketInitPacket(LPPACKET lpPacket,PVOID Buffer,UINT Length);
1.390 +VOID PacketFreePacket(LPPACKET lpPacket);
1.391 +BOOLEAN PacketReceivePacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync);
1.392 +BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject,ULONG Filter);
1.393 +BOOLEAN PacketGetAdapterNames(PTSTR pStr,PULONG BufferSize);
1.394 +BOOLEAN PacketGetNetInfoEx(PCHAR AdapterName, npf_if_addr* buffer, PLONG NEntries);
1.395 +BOOLEAN PacketRequest(LPADAPTER AdapterObject,BOOLEAN Set,PPACKET_OID_DATA OidData);
1.396 +HANDLE PacketGetReadEvent(LPADAPTER AdapterObject);
1.397 +BOOLEAN PacketSetDumpName(LPADAPTER AdapterObject, void *name, int len);
1.398 +BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks);
1.399 +BOOLEAN PacketIsDumpEnded(LPADAPTER AdapterObject, BOOLEAN sync);
1.400 +BOOL PacketStopDriver();
1.401 +VOID PacketCloseAdapter(LPADAPTER lpAdapter);
1.402 +BOOLEAN PacketStartOem(PCHAR errorString, UINT errorStringLength);
1.403 +PAirpcapHandle PacketGetAirPcapHandle(LPADAPTER AdapterObject);
1.404 +#ifdef __cplusplus
1.405 +}
1.406 +#endif
1.407 +
1.408 +#endif //__PACKET32