1 /*
2  * Copyright (c) 1999 - 2003
3  * NetGroup, Politecnico di Torino (Italy)
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  * 3. Neither the name of the Politecnico di Torino nor the names of its
16  * contributors may be used to endorse or promote products derived from
17  * this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 
33 /** @ingroup packetapi
34  *  @{
35  */
36 
37 /** @defgroup packet32h Packet.dll definitions and data structures
38  *  Packet32.h contains the data structures and the definitions used by packet.dll.
39  *  The file is used both by the Win9x and the WinNTx versions of packet.dll, and can be included
40  *  by the applications that use the functions of this library
41  *  @{
42  */
43 
44 #ifndef __PACKET32
45 #define __PACKET32
46 
47 #include <winsock2.h>
48 #include "devioctl.h"
49 #ifdef HAVE_DAG_API
50 #include <dagc.h>
51 #endif /* HAVE_DAG_API */
52 
53 // Working modes
54 #define PACKET_MODE_CAPT 0x0 ///< Capture mode
55 #define PACKET_MODE_STAT 0x1 ///< Statistical mode
56 #define PACKET_MODE_MON 0x2 ///< Monitoring mode
57 #define PACKET_MODE_DUMP 0x10 ///< Dump mode
58 #define PACKET_MODE_STAT_DUMP MODE_DUMP | MODE_STAT ///< Statistical dump Mode
59 
60 // ioctls
61 #define FILE_DEVICE_PROTOCOL        0x8000
62 
63 #define IOCTL_PROTOCOL_STATISTICS   CTL_CODE(FILE_DEVICE_PROTOCOL, 2 , METHOD_BUFFERED, FILE_ANY_ACCESS)
64 #define IOCTL_PROTOCOL_RESET        CTL_CODE(FILE_DEVICE_PROTOCOL, 3 , METHOD_BUFFERED, FILE_ANY_ACCESS)
65 #define IOCTL_PROTOCOL_READ         CTL_CODE(FILE_DEVICE_PROTOCOL, 4 , METHOD_BUFFERED, FILE_ANY_ACCESS)
66 #define IOCTL_PROTOCOL_WRITE        CTL_CODE(FILE_DEVICE_PROTOCOL, 5 , METHOD_BUFFERED, FILE_ANY_ACCESS)
67 #define IOCTL_PROTOCOL_MACNAME      CTL_CODE(FILE_DEVICE_PROTOCOL, 6 , METHOD_BUFFERED, FILE_ANY_ACCESS)
68 #define IOCTL_OPEN                  CTL_CODE(FILE_DEVICE_PROTOCOL, 7 , METHOD_BUFFERED, FILE_ANY_ACCESS)
69 #define IOCTL_CLOSE                 CTL_CODE(FILE_DEVICE_PROTOCOL, 8 , METHOD_BUFFERED, FILE_ANY_ACCESS)
70 
71 #define	 pBIOCSETBUFFERSIZE 9592		///< IOCTL code: set kernel buffer size.
72 #define	 pBIOCSETF 9030					///< IOCTL code: set packet filtering program.
73 #define  pBIOCGSTATS 9031				///< IOCTL code: get the capture stats.
74 #define	 pBIOCSRTIMEOUT 7416			///< IOCTL code: set the read timeout.
75 #define	 pBIOCSMODE 7412				///< IOCTL code: set working mode.
76 #define	 pBIOCSWRITEREP 7413			///< IOCTL code: set number of physical repetions of every packet written by the app.
77 #define	 pBIOCSMINTOCOPY 7414			///< IOCTL code: set minimum amount of data in the kernel buffer that unlocks a read call.
78 #define	 pBIOCSETOID 2147483648			///< IOCTL code: set an OID value.
79 #define	 pBIOCQUERYOID 2147483652		///< IOCTL code: get an OID value.
80 #define	 pATTACHPROCESS 7117			///< IOCTL code: attach a process to the driver. Used in Win9x only.
81 #define	 pDETACHPROCESS 7118			///< IOCTL code: detach a process from the driver. Used in Win9x only.
82 #define  pBIOCSETDUMPFILENAME 9029		///< IOCTL code: set the name of a the file used by kernel dump mode.
83 #define  pBIOCEVNAME 7415				///< IOCTL code: get the name of the event that the driver signals when some data is present in the buffer.
84 #define  pBIOCSENDPACKETSNOSYNC 9032	///< IOCTL code: Send a buffer containing multiple packets to the network, ignoring the timestamps associated with the packets.
85 #define  pBIOCSENDPACKETSSYNC 9033		///< IOCTL code: Send a buffer containing multiple packets to the network, respecting the timestamps associated with the packets.
86 #define  pBIOCSETDUMPLIMITS 9034		///< IOCTL code: Set the dump file limits. See the PacketSetDumpLimits() function.
87 #define  pBIOCISETLOBBEH 7410
88 #define  pBIOCISDUMPENDED 7411			///< IOCTL code: Get the status of the kernel dump process. See the PacketIsDumpEnded() function.
89 
90 #define  pBIOCSTIMEZONE 7471			///< IOCTL code: set time zone. Used in Win9x only.
91 
92 
93 /// Alignment macro. Defines the alignment size.
94 #define Packet_ALIGNMENT sizeof(int)
95 /// Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT.
96 #define Packet_WORDALIGN(x) (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1))
97 
98 
99 #define NdisMediumNull	-1		// Custom linktype: NDIS doesn't provide an equivalent
100 #define NdisMediumCHDLC	-2		// Custom linktype: NDIS doesn't provide an equivalent
101 #define NdisMediumPPPSerial	-3	// Custom linktype: NDIS doesn't provide an equivalent
102 
103 /*!
104   \brief Network type structure.
105 
106   This structure is used by the PacketGetNetType() function to return information on the current adapter's type and speed.
107 */
108 typedef struct NetType
109 {
110 	UINT LinkType;	///< The MAC of the current network adapter (see function PacketGetNetType() for more information)
111 	ULONGLONG LinkSpeed;	///< The speed of the network in bits per second
112 }NetType;
113 
114 
115 //some definitions stolen from libpcap
116 
117 #ifndef BPF_MAJOR_VERSION
118 
119 /*!
120   \brief A BPF pseudo-assembly program.
121 
122   The program will be injected in the kernel by the PacketSetBPF() function and applied to every incoming packet.
123 */
124 struct bpf_program
125 {
126 	UINT bf_len;				///< Indicates the number of instructions of the program, i.e. the number of struct bpf_insn that will follow.
127 	struct bpf_insn *bf_insns;	///< A pointer to the first instruction of the program.
128 };
129 
130 /*!
131   \brief A single BPF pseudo-instruction.
132 
133   bpf_insn contains a single instruction for the BPF register-machine. It is used to send a filter program to the driver.
134 */
135 struct bpf_insn
136 {
137 	USHORT	code;		///< Instruction type and addressing mode.
138 	UCHAR 	jt;			///< Jump if true
139 	UCHAR 	jf;			///< Jump if false
140 	int k;				///< Generic field used for various purposes.
141 };
142 
143 /*!
144   \brief Structure that contains a couple of statistics values on the current capture.
145 
146   It is used by packet.dll to return statistics about a capture session.
147 */
148 struct bpf_stat
149 {
150 	UINT bs_recv;		///< Number of packets that the driver received from the network adapter
151 						///< from the beginning of the current capture. This value includes the packets
152 						///< lost by the driver.
153 	UINT bs_drop;		///< number of packets that the driver lost from the beginning of a capture.
154 						///< Basically, a packet is lost when the the buffer of the driver is full.
155 						///< In this situation the packet cannot be stored and the driver rejects it.
156 	UINT ps_ifdrop;		///< drops by interface. XXX not yet supported
157 	UINT bs_capt;		///< number of packets that pass the filter, find place in the kernel buffer and
158 						///< thus reach the application.
159 };
160 
161 /*!
162   \brief Packet header.
163 
164   This structure defines the header associated with every packet delivered to the application.
165 */
166 struct bpf_hdr
167 {
168 	struct timeval	bh_tstamp;	///< The timestamp associated with the captured packet.
169 								///< It is stored in a TimeVal structure.
170 	UINT	bh_caplen;			///< Length of captured portion. The captured portion <b>can be different</b>
171 								///< from the original packet, because it is possible (with a proper filter)
172 								///< to instruct the driver to capture only a portion of the packets.
173 	UINT	bh_datalen;			///< Original length of packet
174 	USHORT		bh_hdrlen;		///< Length of bpf header (this struct plus alignment padding). In some cases,
175 								///< a padding could be added between the end of this structure and the packet
176 								///< data for performance reasons. This filed can be used to retrieve the actual data
177 								///< of the packet.
178 };
179 
180 /*!
181   \brief Dump packet header.
182 
183   This structure defines the header associated with the packets in a buffer to be used with PacketSendPackets().
184   It is simpler than the bpf_hdr, because it corresponds to the header associated by WinPcap and libpcap to a
185   packet in a dump file. This makes straightforward sending WinPcap dump files to the network.
186 */
187 struct dump_bpf_hdr{
188     struct timeval	ts;			///< Time stamp of the packet
189     UINT			caplen;		///< Length of captured portion. The captured portion can smaller than the
190 								///< the original packet, because it is possible (with a proper filter) to
191 								///< instruct the driver to capture only a portion of the packets.
192     UINT			len;		///< Length of the original packet (off wire).
193 };
194 
195 
196 #endif
197 
198 #define        DOSNAMEPREFIX   TEXT("Packet_")	///< Prefix added to the adapters device names to create the WinPcap devices
199 #define        MAX_LINK_NAME_LENGTH	64			//< Maximum length of the devices symbolic links
200 #define        NMAX_PACKET 65535
201 
202 /*!
203   \brief Addresses of a network adapter.
204 
205   This structure is used by the PacketGetNetInfoEx() function to return the IP addresses associated with
206   an adapter.
207 */
208 typedef struct npf_if_addr {
209 	struct sockaddr_storage IPAddress;	///< IP address.
210 	struct sockaddr_storage SubnetMask;	///< Netmask for that address.
211 	struct sockaddr_storage Broadcast;	///< Broadcast address.
212 }npf_if_addr;
213 
214 
215 #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.
216 #define ADAPTER_DESC_LENGTH 128			///<  Maximum length for the description of an adapter. The value is the same used by the IP Helper API.
217 #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.
218 #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.
219 
220 
221 typedef struct WAN_ADAPTER_INT WAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API
222 typedef WAN_ADAPTER *PWAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API
223 
224 #define INFO_FLAG_NDIS_ADAPTER		0	///< Flag for ADAPTER_INFO: this is a traditional ndis adapter
225 #define INFO_FLAG_NDISWAN_ADAPTER	1	///< Flag for ADAPTER_INFO: this is a NdisWan adapter
226 #define INFO_FLAG_DAG_CARD			2	///< Flag for ADAPTER_INFO: this is a DAG card
227 #define INFO_FLAG_DAG_FILE			6	///< Flag for ADAPTER_INFO: this is a DAG file
228 #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.
229 
230 /*!
231   \brief Contains comprehensive information about a network adapter.
232 
233   This structure is filled with all the accessory information that the user can need about an adapter installed
234   on his system.
235 */
236 typedef struct _ADAPTER_INFO
237 {
238 	struct _ADAPTER_INFO *Next;				///< Pointer to the next adapter in the list.
239 	CHAR Name[ADAPTER_NAME_LENGTH + 1];		///< Name of the device representing the adapter.
240 	CHAR Description[ADAPTER_DESC_LENGTH + 1];	///< Human understandable description of the adapter
241 	UINT MacAddressLen;						///< Length of the link layer address.
242 	UCHAR MacAddress[MAX_MAC_ADDR_LENGTH];	///< Link layer address.
243 	NetType LinkLayer;						///< Physical characteristics of this adapter. This NetType structure contains the link type and the speed of the adapter.
244 	INT NNetworkAddresses;					///< Number of network layer addresses of this adapter.
245 	npf_if_addr *NetworkAddresses;			///< Pointer to an array of npf_if_addr, each of which specifies a network address of this adapter.
246 	UINT Flags;								///< Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the dagc API.
247 }
248 ADAPTER_INFO, *PADAPTER_INFO;
249 
250 /*!
251   \brief Describes an opened network adapter.
252 
253   This structure is the most important for the functioning of packet.dll, but the great part of its fields
254   should be ignored by the user, since the library offers functions that avoid to cope with low-level parameters
255 */
256 typedef struct _ADAPTER  {
257 	HANDLE hFile;				///< \internal Handle to an open instance of the NPF driver.
258 	CHAR  SymbolicLink[MAX_LINK_NAME_LENGTH]; ///< \internal A string containing the name of the network adapter currently opened.
259 	int NumWrites;				///< \internal Number of times a packets written on this adapter will be repeated
260 								///< on the wire.
261 	HANDLE ReadEvent;			///< A notification event associated with the read calls on the adapter.
262 								///< It can be passed to standard Win32 functions (like WaitForSingleObject
263 								///< or WaitForMultipleObjects) to wait until the driver's buffer contains some
264 								///< data. It is particularly useful in GUI applications that need to wait
265 								///< concurrently on several events. In Windows NT/2000 the PacketSetMinToCopy()
266 								///< function can be used to define the minimum amount of data in the kernel buffer
267 								///< that will cause the event to be signalled.
268 
269 	UINT ReadTimeOut;			///< \internal The amount of time after which a read on the driver will be released and
270 								///< ReadEvent will be signaled, also if no packets were captured
271 	CHAR Name[ADAPTER_NAME_LENGTH];
272 	PWAN_ADAPTER pWanAdapter;
273 	UINT Flags;					///< Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the dagc API.
274 #ifdef HAVE_DAG_API
275 	dagc_t *pDagCard;			///< Pointer to the dagc API adapter descriptor for this adapter
276 	PCHAR DagBuffer;			///< Pointer to the buffer with the packets that is received from the DAG card
277 	struct timeval DagReadTimeout;	///< Read timeout. The dagc API requires a timeval structure
278 	unsigned DagFcsLen;			///< Length of the frame check sequence attached to any packet by the card. Obtained from the registry
279 	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).
280 #endif // HAVE_DAG_API
281 }  ADAPTER, *LPADAPTER;
282 
283 /*!
284   \brief Structure that contains a group of packets coming from the driver.
285 
286   This structure defines the header associated with every packet delivered to the application.
287 */
288 typedef struct _PACKET {
289 	HANDLE       hEvent;		///< \deprecated Still present for compatibility with old applications.
290 	OVERLAPPED   OverLapped;	///< \deprecated Still present for compatibility with old applications.
291 	PVOID        Buffer;		///< Buffer with containing the packets. See the PacketReceivePacket() for
292 								///< details about the organization of the data in this buffer
293 	UINT         Length;		///< Length of the buffer
294 	DWORD        ulBytesReceived;	///< Number of valid bytes present in the buffer, i.e. amount of data
295 									///< received by the last call to PacketReceivePacket()
296 	BOOLEAN      bIoComplete;	///< \deprecated Still present for compatibility with old applications.
297 }  PACKET, *LPPACKET;
298 
299 /*!
300   \brief Structure containing an OID request.
301 
302   It is used by the PacketRequest() function to send an OID to the interface card driver.
303   It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address,
304   the list of the multicast groups defined on it, and so on.
305 */
306 struct _PACKET_OID_DATA {
307     ULONG Oid;					///< OID code. See the Microsoft DDK documentation or the file ntddndis.h
308 								///< for a complete list of valid codes.
309     ULONG Length;				///< Length of the data field
310     UCHAR Data[1];				///< variable-lenght field that contains the information passed to or received
311 								///< from the adapter.
312 };
313 typedef struct _PACKET_OID_DATA PACKET_OID_DATA, *PPACKET_OID_DATA;
314 
315 
316 #if _DBG
317 #define ODS(_x) OutputDebugString(TEXT(_x))
318 #define ODSEx(_x, _y)
319 #else
320 #ifdef _DEBUG_TO_FILE
321 /*!
322   \brief Macro to print a debug string. The behavior differs depending on the debug level
323 */
324 #define ODS(_x) { \
325 	FILE *f; \
326 	f = fopen("winpcap_debug.txt", "a"); \
327 	fprintf(f, "%s", _x); \
328 	fclose(f); \
329 }
330 /*!
331   \brief Macro to print debug data with the printf convention. The behavior differs depending on
332   the debug level
333 */
334 #define ODSEx(_x, _y) { \
335 	FILE *f; \
336 	f = fopen("winpcap_debug.txt", "a"); \
337 	fprintf(f, _x, _y); \
338 	fclose(f); \
339 }
340 
341 
342 
343 LONG PacketDumpRegistryKey(PCHAR KeyName, PCHAR FileName);
344 #else
345 #define ODS(_x)
346 #define ODSEx(_x, _y)
347 #endif
348 #endif
349 
350 /* We load dinamically the dag library in order link it only when it's present on the system */
351 #ifdef HAVE_DAG_API
352 typedef dagc_t* (*dagc_open_handler)(const char *source, unsigned flags, char *ebuf);	///< prototype used to dynamically load the dag dll
353 typedef void (*dagc_close_handler)(dagc_t *dagcfd);										///< prototype used to dynamically load the dag dll
354 typedef int (*dagc_getlinktype_handler)(dagc_t *dagcfd);								///< prototype used to dynamically load the dag dll
355 typedef int (*dagc_getlinkspeed_handler)(dagc_t *dagcfd);								///< prototype used to dynamically load the dag dll
356 typedef int (*dagc_setsnaplen_handler)(dagc_t *dagcfd, unsigned snaplen);				///< prototype used to dynamically load the dag dll
357 typedef unsigned (*dagc_getfcslen_handler)(dagc_t *dagcfd);								///< prototype used to dynamically load the dag dll
358 typedef int (*dagc_receive_handler)(dagc_t *dagcfd, u_char **buffer, u_int *bufsize);	///< prototype used to dynamically load the dag dll
359 typedef int (*dagc_stats_handler)(dagc_t *dagcfd, dagc_stats_t *ps);					///< prototype used to dynamically load the dag dll
360 typedef int (*dagc_wait_handler)(dagc_t *dagcfd, struct timeval *timeout);				///< prototype used to dynamically load the dag dll
361 typedef int (*dagc_finddevs_handler)(dagc_if_t **alldevsp, char *ebuf);					///< prototype used to dynamically load the dag dll
362 typedef int (*dagc_freedevs_handler)(dagc_if_t *alldevsp);								///< prototype used to dynamically load the dag dll
363 #endif // HAVE_DAG_API
364 
365 #ifdef __cplusplus
366 extern "C" {
367 #endif
368 
369 /**
370  *  @}
371  */
372 
373 // The following is used to check the adapter name in PacketOpenAdapterNPF and prevent
374 // opening of firewire adapters
375 #define FIREWIRE_SUBSTR L"1394"
376 
377 void PacketPopulateAdaptersInfoList();
378 PWCHAR SChar2WChar(PCHAR string);
379 PCHAR WChar2SChar(PWCHAR string);
380 BOOL PacketGetFileVersion(LPTSTR FileName, PCHAR VersionBuff, UINT VersionBuffLen);
381 PADAPTER_INFO PacketFindAdInfo(PCHAR AdapterName);
382 BOOLEAN PacketUpdateAdInfo(PCHAR AdapterName);
383 BOOLEAN IsFireWire(TCHAR *AdapterDesc);
384 
385 
386 //---------------------------------------------------------------------------
387 // EXPORTED FUNCTIONS
388 //---------------------------------------------------------------------------
389 
390 PCHAR PacketGetVersion();
391 PCHAR PacketGetDriverVersion();
392 BOOLEAN PacketSetMinToCopy(LPADAPTER AdapterObject,int nbytes);
393 BOOLEAN PacketSetNumWrites(LPADAPTER AdapterObject,int nwrites);
394 BOOLEAN PacketSetMode(LPADAPTER AdapterObject,int mode);
395 BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject,int timeout);
396 BOOLEAN PacketSetBpf(LPADAPTER AdapterObject,struct bpf_program *fp);
397 INT PacketSetSnapLen(LPADAPTER AdapterObject,int snaplen);
398 BOOLEAN PacketGetStats(LPADAPTER AdapterObject,struct bpf_stat *s);
399 BOOLEAN PacketGetStatsEx(LPADAPTER AdapterObject,struct bpf_stat *s);
400 BOOLEAN PacketSetBuff(LPADAPTER AdapterObject,int dim);
401 BOOLEAN PacketGetNetType (LPADAPTER AdapterObject,NetType *type);
402 LPADAPTER PacketOpenAdapter(PCHAR AdapterName);
403 BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET pPacket,BOOLEAN Sync);
404 INT PacketSendPackets(LPADAPTER AdapterObject,PVOID PacketBuff,ULONG Size, BOOLEAN Sync);
405 LPPACKET PacketAllocatePacket(void);
406 VOID PacketInitPacket(LPPACKET lpPacket,PVOID  Buffer,UINT  Length);
407 VOID PacketFreePacket(LPPACKET lpPacket);
408 BOOLEAN PacketReceivePacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync);
409 BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject,ULONG Filter);
410 BOOLEAN PacketGetAdapterNames(PTSTR pStr,PULONG  BufferSize);
411 BOOLEAN PacketGetNetInfoEx(PCHAR AdapterName, npf_if_addr* buffer, PLONG NEntries);
412 BOOLEAN PacketRequest(LPADAPTER  AdapterObject,BOOLEAN Set,PPACKET_OID_DATA  OidData);
413 HANDLE PacketGetReadEvent(LPADAPTER AdapterObject);
414 BOOLEAN PacketSetDumpName(LPADAPTER AdapterObject, void *name, int len);
415 BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks);
416 BOOLEAN PacketIsDumpEnded(LPADAPTER AdapterObject, BOOLEAN sync);
417 BOOL PacketStopDriver();
418 VOID PacketCloseAdapter(LPADAPTER lpAdapter);
419 
420 #ifdef __cplusplus
421 }
422 #endif
423 
424 #endif //__PACKET32
425