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  pBIOCISDUMPENDED 7411			///< IOCTL code: Get the status of the kernel dump process. See the PacketIsDumpEnded() function.
88 
89 #define  pBIOCSTIMEZONE 7471			///< IOCTL code: set time zone. Used in Win9x only.
90 
91 
92 /// Alignment macro. Defines the alignment size.
93 #define Packet_ALIGNMENT sizeof(int)
94 /// Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT.
95 #define Packet_WORDALIGN(x) (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1))
96 
97 
98 #define NdisMediumNull	-1		// Custom linktype: NDIS doesn't provide an equivalent
99 #define NdisMediumCHDLC	-2		// Custom linktype: NDIS doesn't provide an equivalent
100 #define NdisMediumPPPSerial	-3	// Custom linktype: NDIS doesn't provide an equivalent
101 
102 /*!
103   \brief Network type structure.
104 
105   This structure is used by the PacketGetNetType() function to return information on the current adapter's type and speed.
106 */
107 typedef struct NetType
108 {
109 	UINT LinkType;	///< The MAC of the current network adapter (see function PacketGetNetType() for more information)
110 	ULONGLONG LinkSpeed;	///< The speed of the network in bits per second
111 }NetType;
112 
113 
114 //some definitions stolen from libpcap
115 
116 #ifndef BPF_MAJOR_VERSION
117 
118 /*!
119   \brief A BPF pseudo-assembly program.
120 
121   The program will be injected in the kernel by the PacketSetBPF() function and applied to every incoming packet.
122 */
123 struct bpf_program
124 {
125 	UINT bf_len;				///< Indicates the number of instructions of the program, i.e. the number of struct bpf_insn that will follow.
126 	struct bpf_insn *bf_insns;	///< A pointer to the first instruction of the program.
127 };
128 
129 /*!
130   \brief A single BPF pseudo-instruction.
131 
132   bpf_insn contains a single instruction for the BPF register-machine. It is used to send a filter program to the driver.
133 */
134 struct bpf_insn
135 {
136 	USHORT	code;		///< Instruction type and addressing mode.
137 	UCHAR 	jt;			///< Jump if true
138 	UCHAR 	jf;			///< Jump if false
139 	int k;				///< Generic field used for various purposes.
140 };
141 
142 /*!
143   \brief Structure that contains a couple of statistics values on the current capture.
144 
145   It is used by packet.dll to return statistics about a capture session.
146 */
147 struct bpf_stat
148 {
149 	UINT bs_recv;		///< Number of packets that the driver received from the network adapter
150 						///< from the beginning of the current capture. This value includes the packets
151 						///< lost by the driver.
152 	UINT bs_drop;		///< number of packets that the driver lost from the beginning of a capture.
153 						///< Basically, a packet is lost when the the buffer of the driver is full.
154 						///< In this situation the packet cannot be stored and the driver rejects it.
155 	UINT ps_ifdrop;		///< drops by interface. XXX not yet supported
156 	UINT bs_capt;		///< number of packets that pass the filter, find place in the kernel buffer and
157 						///< thus reach the application.
158 };
159 
160 /*!
161   \brief Packet header.
162 
163   This structure defines the header associated with every packet delivered to the application.
164 */
165 struct bpf_hdr
166 {
167 	struct timeval	bh_tstamp;	///< The timestamp associated with the captured packet.
168 								///< It is stored in a TimeVal structure.
169 	UINT	bh_caplen;			///< Length of captured portion. The captured portion <b>can be different</b>
170 								///< from the original packet, because it is possible (with a proper filter)
171 								///< to instruct the driver to capture only a portion of the packets.
172 	UINT	bh_datalen;			///< Original length of packet
173 	USHORT		bh_hdrlen;		///< Length of bpf header (this struct plus alignment padding). In some cases,
174 								///< a padding could be added between the end of this structure and the packet
175 								///< data for performance reasons. This filed can be used to retrieve the actual data
176 								///< of the packet.
177 };
178 
179 /*!
180   \brief Dump packet header.
181 
182   This structure defines the header associated with the packets in a buffer to be used with PacketSendPackets().
183   It is simpler than the bpf_hdr, because it corresponds to the header associated by WinPcap and libpcap to a
184   packet in a dump file. This makes straightforward sending WinPcap dump files to the network.
185 */
186 struct dump_bpf_hdr{
187     struct timeval	ts;			///< Time stamp of the packet
188     UINT			caplen;		///< Length of captured portion. The captured portion can smaller than the
189 								///< the original packet, because it is possible (with a proper filter) to
190 								///< instruct the driver to capture only a portion of the packets.
191     UINT			len;		///< Length of the original packet (off wire).
192 };
193 
194 
195 #endif
196 
197 #define        DOSNAMEPREFIX   TEXT("Packet_")	///< Prefix added to the adapters device names to create the WinPcap devices
198 #define        MAX_LINK_NAME_LENGTH	64			//< Maximum length of the devices symbolic links
199 #define        NMAX_PACKET 65535
200 
201 /*!
202   \brief Addresses of a network adapter.
203 
204   This structure is used by the PacketGetNetInfoEx() function to return the IP addresses associated with
205   an adapter.
206 */
207 typedef struct npf_if_addr {
208 	struct sockaddr_storage IPAddress;	///< IP address.
209 	struct sockaddr_storage SubnetMask;	///< Netmask for that address.
210 	struct sockaddr_storage Broadcast;	///< Broadcast address.
211 }npf_if_addr;
212 
213 
214 #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.
215 #define ADAPTER_DESC_LENGTH 128			///<  Maximum length for the description of an adapter. The value is the same used by the IP Helper API.
216 #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.
217 #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.
218 
219 
220 typedef struct WAN_ADAPTER_INT WAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API
221 typedef WAN_ADAPTER *PWAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API
222 
223 #define INFO_FLAG_NDIS_ADAPTER		0	///< Flag for ADAPTER_INFO: this is a traditional ndis adapter
224 #define INFO_FLAG_NDISWAN_ADAPTER	1	///< Flag for ADAPTER_INFO: this is a NdisWan adapter
225 #define INFO_FLAG_DAG_CARD			2	///< Flag for ADAPTER_INFO: this is a DAG card
226 #define INFO_FLAG_DAG_FILE			6	///< Flag for ADAPTER_INFO: this is a DAG file
227 #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.
228 
229 /*!
230   \brief Contains comprehensive information about a network adapter.
231 
232   This structure is filled with all the accessory information that the user can need about an adapter installed
233   on his system.
234 */
235 typedef struct _ADAPTER_INFO
236 {
237 	struct _ADAPTER_INFO *Next;				///< Pointer to the next adapter in the list.
238 	CHAR Name[ADAPTER_NAME_LENGTH + 1];		///< Name of the device representing the adapter.
239 	CHAR Description[ADAPTER_DESC_LENGTH + 1];	///< Human understandable description of the adapter
240 	UINT MacAddressLen;						///< Length of the link layer address.
241 	UCHAR MacAddress[MAX_MAC_ADDR_LENGTH];	///< Link layer address.
242 	NetType LinkLayer;						///< Physical characteristics of this adapter. This NetType structure contains the link type and the speed of the adapter.
243 	INT NNetworkAddresses;					///< Number of network layer addresses of this adapter.
244 	npf_if_addr *NetworkAddresses;			///< Pointer to an array of npf_if_addr, each of which specifies a network address of this adapter.
245 	UINT Flags;								///< Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the dagc API.
246 }
247 ADAPTER_INFO, *PADAPTER_INFO;
248 
249 /*!
250   \brief Describes an opened network adapter.
251 
252   This structure is the most important for the functioning of packet.dll, but the great part of its fields
253   should be ignored by the user, since the library offers functions that avoid to cope with low-level parameters
254 */
255 typedef struct _ADAPTER  {
256 	HANDLE hFile;				///< \internal Handle to an open instance of the NPF driver.
257 	CHAR  SymbolicLink[MAX_LINK_NAME_LENGTH]; ///< \internal A string containing the name of the network adapter currently opened.
258 	int NumWrites;				///< \internal Number of times a packets written on this adapter will be repeated
259 								///< on the wire.
260 	HANDLE ReadEvent;			///< A notification event associated with the read calls on the adapter.
261 								///< It can be passed to standard Win32 functions (like WaitForSingleObject
262 								///< or WaitForMultipleObjects) to wait until the driver's buffer contains some
263 								///< data. It is particularly useful in GUI applications that need to wait
264 								///< concurrently on several events. In Windows NT/2000 the PacketSetMinToCopy()
265 								///< function can be used to define the minimum amount of data in the kernel buffer
266 								///< that will cause the event to be signalled.
267 
268 	UINT ReadTimeOut;			///< \internal The amount of time after which a read on the driver will be released and
269 								///< ReadEvent will be signaled, also if no packets were captured
270 	CHAR Name[ADAPTER_NAME_LENGTH];
271 	PWAN_ADAPTER pWanAdapter;
272 	UINT Flags;					///< Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the dagc API.
273 #ifdef HAVE_DAG_API
274 	dagc_t *pDagCard;			///< Pointer to the dagc API adapter descriptor for this adapter
275 	PCHAR DagBuffer;			///< Pointer to the buffer with the packets that is received from the DAG card
276 	struct timeval DagReadTimeout;	///< Read timeout. The dagc API requires a timeval structure
277 	unsigned DagFcsLen;			///< Length of the frame check sequence attached to any packet by the card. Obtained from the registry
278 	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).
279 #endif // HAVE_DAG_API
280 }  ADAPTER, *LPADAPTER;
281 
282 /*!
283   \brief Structure that contains a group of packets coming from the driver.
284 
285   This structure defines the header associated with every packet delivered to the application.
286 */
287 typedef struct _PACKET {
288 	HANDLE       hEvent;		///< \deprecated Still present for compatibility with old applications.
289 	OVERLAPPED   OverLapped;	///< \deprecated Still present for compatibility with old applications.
290 	PVOID        Buffer;		///< Buffer with containing the packets. See the PacketReceivePacket() for
291 								///< details about the organization of the data in this buffer
292 	UINT         Length;		///< Length of the buffer
293 	DWORD        ulBytesReceived;	///< Number of valid bytes present in the buffer, i.e. amount of data
294 									///< received by the last call to PacketReceivePacket()
295 	BOOLEAN      bIoComplete;	///< \deprecated Still present for compatibility with old applications.
296 }  PACKET, *LPPACKET;
297 
298 /*!
299   \brief Structure containing an OID request.
300 
301   It is used by the PacketRequest() function to send an OID to the interface card driver.
302   It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address,
303   the list of the multicast groups defined on it, and so on.
304 */
305 struct _PACKET_OID_DATA {
306     ULONG Oid;					///< OID code. See the Microsoft DDK documentation or the file ntddndis.h
307 								///< for a complete list of valid codes.
308     ULONG Length;				///< Length of the data field
309     UCHAR Data[1];				///< variable-length field that contains the information passed to or received
310 								///< from the adapter.
311 };
312 typedef struct _PACKET_OID_DATA PACKET_OID_DATA, *PPACKET_OID_DATA;
313 
314 
315 #if _DBG
316 #define ODS(_x) OutputDebugString(TEXT(_x))
317 #define ODSEx(_x, _y)
318 #else
319 #ifdef _DEBUG_TO_FILE
320 /*!
321   \brief Macro to print a debug string. The behavior differs depending on the debug level
322 */
323 #define ODS(_x) { \
324 	FILE *f; \
325 	f = fopen("winpcap_debug.txt", "a"); \
326 	fprintf(f, "%s", _x); \
327 	fclose(f); \
328 }
329 /*!
330   \brief Macro to print debug data with the printf convention. The behavior differs depending on
331   the debug level
332 */
333 #define ODSEx(_x, _y) { \
334 	FILE *f; \
335 	f = fopen("winpcap_debug.txt", "a"); \
336 	fprintf(f, _x, _y); \
337 	fclose(f); \
338 }
339 
340 
341 
342 LONG PacketDumpRegistryKey(PCHAR KeyName, PCHAR FileName);
343 #else
344 #define ODS(_x)
345 #define ODSEx(_x, _y)
346 #endif
347 #endif
348 
349 /* We load dynamically the dag library in order link it only when it's present on the system */
350 #ifdef HAVE_DAG_API
351 typedef dagc_t* (*dagc_open_handler)(const char *source, unsigned flags, char *ebuf);	///< prototype used to dynamically load the dag dll
352 typedef void (*dagc_close_handler)(dagc_t *dagcfd);										///< prototype used to dynamically load the dag dll
353 typedef int (*dagc_getlinktype_handler)(dagc_t *dagcfd);								///< prototype used to dynamically load the dag dll
354 typedef int (*dagc_getlinkspeed_handler)(dagc_t *dagcfd);								///< prototype used to dynamically load the dag dll
355 typedef int (*dagc_setsnaplen_handler)(dagc_t *dagcfd, unsigned snaplen);				///< prototype used to dynamically load the dag dll
356 typedef unsigned (*dagc_getfcslen_handler)(dagc_t *dagcfd);								///< prototype used to dynamically load the dag dll
357 typedef int (*dagc_receive_handler)(dagc_t *dagcfd, u_char **buffer, u_int *bufsize);	///< prototype used to dynamically load the dag dll
358 typedef int (*dagc_stats_handler)(dagc_t *dagcfd, dagc_stats_t *ps);					///< prototype used to dynamically load the dag dll
359 typedef int (*dagc_wait_handler)(dagc_t *dagcfd, struct timeval *timeout);				///< prototype used to dynamically load the dag dll
360 typedef int (*dagc_finddevs_handler)(dagc_if_t **alldevsp, char *ebuf);					///< prototype used to dynamically load the dag dll
361 typedef int (*dagc_freedevs_handler)(dagc_if_t *alldevsp);								///< prototype used to dynamically load the dag dll
362 #endif // HAVE_DAG_API
363 
364 #ifdef __cplusplus
365 extern "C" {
366 #endif
367 
368 /**
369  *  @}
370  */
371 
372 // The following is used to check the adapter name in PacketOpenAdapterNPF and prevent
373 // opening of firewire adapters
374 #define FIREWIRE_SUBSTR L"1394"
375 
376 void PacketPopulateAdaptersInfoList();
377 PWCHAR SChar2WChar(PCHAR string);
378 PCHAR WChar2SChar(PWCHAR string);
379 BOOL PacketGetFileVersion(LPTSTR FileName, PCHAR VersionBuff, UINT VersionBuffLen);
380 PADAPTER_INFO PacketFindAdInfo(PCHAR AdapterName);
381 BOOLEAN PacketUpdateAdInfo(PCHAR AdapterName);
382 BOOLEAN IsFireWire(TCHAR *AdapterDesc);
383 
384 
385 //---------------------------------------------------------------------------
386 // EXPORTED FUNCTIONS
387 //---------------------------------------------------------------------------
388 
389 PCHAR PacketGetVersion();
390 PCHAR PacketGetDriverVersion();
391 BOOLEAN PacketSetMinToCopy(LPADAPTER AdapterObject,int nbytes);
392 BOOLEAN PacketSetNumWrites(LPADAPTER AdapterObject,int nwrites);
393 BOOLEAN PacketSetMode(LPADAPTER AdapterObject,int mode);
394 BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject,int timeout);
395 BOOLEAN PacketSetBpf(LPADAPTER AdapterObject,struct bpf_program *fp);
396 INT PacketSetSnapLen(LPADAPTER AdapterObject,int snaplen);
397 BOOLEAN PacketGetStats(LPADAPTER AdapterObject,struct bpf_stat *s);
398 BOOLEAN PacketGetStatsEx(LPADAPTER AdapterObject,struct bpf_stat *s);
399 BOOLEAN PacketSetBuff(LPADAPTER AdapterObject,int dim);
400 BOOLEAN PacketGetNetType (LPADAPTER AdapterObject,NetType *type);
401 LPADAPTER PacketOpenAdapter(PCHAR AdapterName);
402 BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET pPacket,BOOLEAN Sync);
403 INT PacketSendPackets(LPADAPTER AdapterObject,PVOID PacketBuff,ULONG Size, BOOLEAN Sync);
404 LPPACKET PacketAllocatePacket(void);
405 VOID PacketInitPacket(LPPACKET lpPacket,PVOID  Buffer,UINT  Length);
406 VOID PacketFreePacket(LPPACKET lpPacket);
407 BOOLEAN PacketReceivePacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync);
408 BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject,ULONG Filter);
409 BOOLEAN PacketGetAdapterNames(PTSTR pStr,PULONG  BufferSize);
410 BOOLEAN PacketGetNetInfoEx(PCHAR AdapterName, npf_if_addr* buffer, PLONG NEntries);
411 BOOLEAN PacketRequest(LPADAPTER  AdapterObject,BOOLEAN Set,PPACKET_OID_DATA  OidData);
412 HANDLE PacketGetReadEvent(LPADAPTER AdapterObject);
413 BOOLEAN PacketSetDumpName(LPADAPTER AdapterObject, void *name, int len);
414 BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks);
415 BOOLEAN PacketIsDumpEnded(LPADAPTER AdapterObject, BOOLEAN sync);
416 BOOL PacketStopDriver();
417 VOID PacketCloseAdapter(LPADAPTER lpAdapter);
418 
419 #ifdef __cplusplus
420 }
421 #endif
422 
423 #endif //__PACKET32
424