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

Packet32.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1999 - 2003
00003  * NetGroup, Politecnico di Torino (Italy)
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  *
00010  * 1. Redistributions of source code must retain the above copyright
00011  * notice, this list of conditions and the following disclaimer.
00012  * 2. Redistributions in binary form must reproduce the above copyright
00013  * notice, this list of conditions and the following disclaimer in the
00014  * documentation and/or other materials provided with the distribution.
00015  * 3. Neither the name of the Politecnico di Torino nor the names of its
00016  * contributors may be used to endorse or promote products derived from
00017  * this software without specific prior written permission.
00018  *
00019  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00020  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00021  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00022  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00023  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00024  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00025  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00026  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00027  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00028  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00029  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030  *
00031  */
00032 
00033 /** @ingroup packetapi
00034  *  @{ 
00035  */
00036 
00037 /** @defgroup packet32h Packet.dll definitions and data structures
00038  *  Packet32.h contains the data structures and the definitions used by packet.dll.
00039  *  The file is used both by the Win9x and the WinNTx versions of packet.dll, and can be included
00040  *  by the applications that use the functions of this library
00041  *  @{
00042  */
00043 
00044 #ifndef __PACKET32
00045 #define __PACKET32
00046 
00047 #include <winsock2.h>
00048 #include "devioctl.h"
00049 #ifdef HAVE_DAG_API
00050 #include <dagc.h>
00051 #endif /* HAVE_DAG_API */
00052 
00053 // Working modes
00054 #define PACKET_MODE_CAPT 0x0 ///< Capture mode
00055 #define PACKET_MODE_STAT 0x1 ///< Statistical mode
00056 #define PACKET_MODE_MON 0x2 ///< Monitoring mode
00057 #define PACKET_MODE_DUMP 0x10 ///< Dump mode
00058 #define PACKET_MODE_STAT_DUMP MODE_DUMP | MODE_STAT ///< Statistical dump Mode
00059 
00060 // ioctls
00061 #define FILE_DEVICE_PROTOCOL        0x8000
00062 
00063 #define IOCTL_PROTOCOL_STATISTICS   CTL_CODE(FILE_DEVICE_PROTOCOL, 2 , METHOD_BUFFERED, FILE_ANY_ACCESS)
00064 #define IOCTL_PROTOCOL_RESET        CTL_CODE(FILE_DEVICE_PROTOCOL, 3 , METHOD_BUFFERED, FILE_ANY_ACCESS)
00065 #define IOCTL_PROTOCOL_READ         CTL_CODE(FILE_DEVICE_PROTOCOL, 4 , METHOD_BUFFERED, FILE_ANY_ACCESS)
00066 #define IOCTL_PROTOCOL_WRITE        CTL_CODE(FILE_DEVICE_PROTOCOL, 5 , METHOD_BUFFERED, FILE_ANY_ACCESS)
00067 #define IOCTL_PROTOCOL_MACNAME      CTL_CODE(FILE_DEVICE_PROTOCOL, 6 , METHOD_BUFFERED, FILE_ANY_ACCESS)
00068 #define IOCTL_OPEN                  CTL_CODE(FILE_DEVICE_PROTOCOL, 7 , METHOD_BUFFERED, FILE_ANY_ACCESS)
00069 #define IOCTL_CLOSE                 CTL_CODE(FILE_DEVICE_PROTOCOL, 8 , METHOD_BUFFERED, FILE_ANY_ACCESS)
00070 
00071 #define  pBIOCSETBUFFERSIZE 9592                ///< IOCTL code: set kernel buffer size.
00072 #define  pBIOCSETF 9030                                 ///< IOCTL code: set packet filtering program.
00073 #define  pBIOCGSTATS 9031                               ///< IOCTL code: get the capture stats.
00074 #define  pBIOCSRTIMEOUT 7416                    ///< IOCTL code: set the read timeout.
00075 #define  pBIOCSMODE 7412                                ///< IOCTL code: set working mode.
00076 #define  pBIOCSWRITEREP 7413                    ///< IOCTL code: set number of physical repetions of every packet written by the app.
00077 #define  pBIOCSMINTOCOPY 7414                   ///< IOCTL code: set minimum amount of data in the kernel buffer that unlocks a read call.
00078 #define  pBIOCSETOID 2147483648                 ///< IOCTL code: set an OID value.
00079 #define  pBIOCQUERYOID 2147483652               ///< IOCTL code: get an OID value.
00080 #define  pATTACHPROCESS 7117                    ///< IOCTL code: attach a process to the driver. Used in Win9x only.
00081 #define  pDETACHPROCESS 7118                    ///< IOCTL code: detach a process from the driver. Used in Win9x only.
00082 #define  pBIOCSETDUMPFILENAME 9029              ///< IOCTL code: set the name of a the file used by kernel dump mode.
00083 #define  pBIOCEVNAME 7415                               ///< IOCTL code: get the name of the event that the driver signals when some data is present in the buffer.
00084 #define  pBIOCSENDPACKETSNOSYNC 9032    ///< IOCTL code: Send a buffer containing multiple packets to the network, ignoring the timestamps associated with the packets.
00085 #define  pBIOCSENDPACKETSSYNC 9033              ///< IOCTL code: Send a buffer containing multiple packets to the network, respecting the timestamps associated with the packets.
00086 #define  pBIOCSETDUMPLIMITS 9034                ///< IOCTL code: Set the dump file limits. See the PacketSetDumpLimits() function.
00087 #define  pBIOCISDUMPENDED 7411                  ///< IOCTL code: Get the status of the kernel dump process. See the PacketIsDumpEnded() function.
00088 
00089 #define  pBIOCSTIMEZONE 7471                    ///< IOCTL code: set time zone. Used in Win9x only.
00090 
00091 
00092 /// Alignment macro. Defines the alignment size.
00093 #define Packet_ALIGNMENT sizeof(int)
00094 /// Alignment macro. Rounds up to the next even multiple of Packet_ALIGNMENT. 
00095 #define Packet_WORDALIGN(x) (((x)+(Packet_ALIGNMENT-1))&~(Packet_ALIGNMENT-1))
00096 
00097 
00098 #define NdisMediumNull  -1              // Custom linktype: NDIS doesn't provide an equivalent
00099 #define NdisMediumCHDLC -2              // Custom linktype: NDIS doesn't provide an equivalent
00100 #define NdisMediumPPPSerial     -3      // Custom linktype: NDIS doesn't provide an equivalent
00101 
00102 /*!
00103   \brief Network type structure.
00104 
00105   This structure is used by the PacketGetNetType() function to return information on the current adapter's type and speed.
00106 */
00107 typedef struct NetType
00108 {
00109         UINT LinkType;  ///< The MAC of the current network adapter (see function PacketGetNetType() for more information)
00110         ULONGLONG LinkSpeed;    ///< The speed of the network in bits per second
00111 }NetType;
00112 
00113 
00114 //some definitions stolen from libpcap
00115 
00116 #ifndef BPF_MAJOR_VERSION
00117 
00118 /*!
00119   \brief A BPF pseudo-assembly program.
00120 
00121   The program will be injected in the kernel by the PacketSetBPF() function and applied to every incoming packet. 
00122 */
00123 struct bpf_program 
00124 {
00125         UINT bf_len;                            ///< Indicates the number of instructions of the program, i.e. the number of struct bpf_insn that will follow.
00126         struct bpf_insn *bf_insns;      ///< A pointer to the first instruction of the program.
00127 };
00128 
00129 /*!
00130   \brief A single BPF pseudo-instruction.
00131 
00132   bpf_insn contains a single instruction for the BPF register-machine. It is used to send a filter program to the driver.
00133 */
00134 struct bpf_insn 
00135 {
00136         USHORT  code;           ///< Instruction type and addressing mode.
00137         UCHAR   jt;                     ///< Jump if true
00138         UCHAR   jf;                     ///< Jump if false
00139         int k;                          ///< Generic field used for various purposes.
00140 };
00141 
00142 /*!
00143   \brief Structure that contains a couple of statistics values on the current capture.
00144 
00145   It is used by packet.dll to return statistics about a capture session.
00146 */
00147 struct bpf_stat 
00148 {
00149         UINT bs_recv;           ///< Number of packets that the driver received from the network adapter 
00150                                                 ///< from the beginning of the current capture. This value includes the packets 
00151                                                 ///< lost by the driver.
00152         UINT bs_drop;           ///< number of packets that the driver lost from the beginning of a capture. 
00153                                                 ///< Basically, a packet is lost when the the buffer of the driver is full. 
00154                                                 ///< In this situation the packet cannot be stored and the driver rejects it.
00155         UINT ps_ifdrop;         ///< drops by interface. XXX not yet supported
00156         UINT bs_capt;           ///< number of packets that pass the filter, find place in the kernel buffer and
00157                                                 ///< thus reach the application.
00158 };
00159 
00160 /*!
00161   \brief Packet header.
00162 
00163   This structure defines the header associated with every packet delivered to the application.
00164 */
00165 struct bpf_hdr 
00166 {
00167         struct timeval  bh_tstamp;      ///< The timestamp associated with the captured packet. 
00168                                                                 ///< It is stored in a TimeVal structure.
00169         UINT    bh_caplen;                      ///< Length of captured portion. The captured portion <b>can be different</b>
00170                                                                 ///< from the original packet, because it is possible (with a proper filter)
00171                                                                 ///< to instruct the driver to capture only a portion of the packets.
00172         UINT    bh_datalen;                     ///< Original length of packet
00173         USHORT          bh_hdrlen;              ///< Length of bpf header (this struct plus alignment padding). In some cases,
00174                                                                 ///< a padding could be added between the end of this structure and the packet
00175                                                                 ///< data for performance reasons. This filed can be used to retrieve the actual data 
00176                                                                 ///< of the packet.
00177 };
00178 
00179 /*!
00180   \brief Dump packet header.
00181 
00182   This structure defines the header associated with the packets in a buffer to be used with PacketSendPackets().
00183   It is simpler than the bpf_hdr, because it corresponds to the header associated by WinPcap and libpcap to a
00184   packet in a dump file. This makes straightforward sending WinPcap dump files to the network.
00185 */
00186 struct dump_bpf_hdr{
00187     struct timeval      ts;                     ///< Time stamp of the packet
00188     UINT                        caplen;         ///< Length of captured portion. The captured portion can smaller than the 
00189                                                                 ///< the original packet, because it is possible (with a proper filter) to 
00190                                                                 ///< instruct the driver to capture only a portion of the packets. 
00191     UINT                        len;            ///< Length of the original packet (off wire).
00192 };
00193 
00194 
00195 #endif
00196 
00197 #define        DOSNAMEPREFIX   TEXT("Packet_")  ///< Prefix added to the adapters device names to create the WinPcap devices
00198 #define        MAX_LINK_NAME_LENGTH     64                      //< Maximum length of the devices symbolic links
00199 #define        NMAX_PACKET 65535
00200 
00201 /*!
00202   \brief Addresses of a network adapter.
00203 
00204   This structure is used by the PacketGetNetInfoEx() function to return the IP addresses associated with 
00205   an adapter.
00206 */
00207 typedef struct npf_if_addr {
00208         struct sockaddr_storage IPAddress;      ///< IP address.
00209         struct sockaddr_storage SubnetMask;     ///< Netmask for that address.
00210         struct sockaddr_storage Broadcast;      ///< Broadcast address.
00211 }npf_if_addr;
00212 
00213 
00214 #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.
00215 #define ADAPTER_DESC_LENGTH 128                 ///<  Maximum length for the description of an adapter. The value is the same used by the IP Helper API.
00216 #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.
00217 #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.
00218 
00219 
00220 typedef struct WAN_ADAPTER_INT WAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API
00221 typedef WAN_ADAPTER *PWAN_ADAPTER; ///< Describes an opened wan (dialup, VPN...) network adapter using the NetMon API
00222 
00223 #define INFO_FLAG_NDIS_ADAPTER          0       ///< Flag for ADAPTER_INFO: this is a traditional ndis adapter
00224 #define INFO_FLAG_NDISWAN_ADAPTER       1       ///< Flag for ADAPTER_INFO: this is a NdisWan adapter
00225 #define INFO_FLAG_DAG_CARD                      2       ///< Flag for ADAPTER_INFO: this is a DAG card
00226 #define INFO_FLAG_DAG_FILE                      6       ///< Flag for ADAPTER_INFO: this is a DAG file
00227 #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.
00228 
00229 /*!
00230   \brief Contains comprehensive information about a network adapter.
00231 
00232   This structure is filled with all the accessory information that the user can need about an adapter installed
00233   on his system.
00234 */
00235 typedef struct _ADAPTER_INFO  
00236 {
00237         struct _ADAPTER_INFO *Next;                             ///< Pointer to the next adapter in the list.
00238         CHAR Name[ADAPTER_NAME_LENGTH + 1];             ///< Name of the device representing the adapter.
00239         CHAR Description[ADAPTER_DESC_LENGTH + 1];      ///< Human understandable description of the adapter
00240         UINT MacAddressLen;                                             ///< Length of the link layer address.
00241         UCHAR MacAddress[MAX_MAC_ADDR_LENGTH];  ///< Link layer address.
00242         NetType LinkLayer;                                              ///< Physical characteristics of this adapter. This NetType structure contains the link type and the speed of the adapter.
00243         INT NNetworkAddresses;                                  ///< Number of network layer addresses of this adapter.
00244         npf_if_addr *NetworkAddresses;                  ///< Pointer to an array of npf_if_addr, each of which specifies a network address of this adapter.
00245         UINT Flags;                                                             ///< Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the dagc API.
00246 }
00247 ADAPTER_INFO, *PADAPTER_INFO;
00248 
00249 /*!
00250   \brief Describes an opened network adapter.
00251 
00252   This structure is the most important for the functioning of packet.dll, but the great part of its fields
00253   should be ignored by the user, since the library offers functions that avoid to cope with low-level parameters
00254 */
00255 typedef struct _ADAPTER  { 
00256         HANDLE hFile;                           ///< \internal Handle to an open instance of the NPF driver.
00257         CHAR  SymbolicLink[MAX_LINK_NAME_LENGTH]; ///< \internal A string containing the name of the network adapter currently opened.
00258         int NumWrites;                          ///< \internal Number of times a packets written on this adapter will be repeated 
00259                                                                 ///< on the wire.
00260         HANDLE ReadEvent;                       ///< A notification event associated with the read calls on the adapter.
00261                                                                 ///< It can be passed to standard Win32 functions (like WaitForSingleObject
00262                                                                 ///< or WaitForMultipleObjects) to wait until the driver's buffer contains some 
00263                                                                 ///< data. It is particularly useful in GUI applications that need to wait 
00264                                                                 ///< concurrently on several events. In Windows NT/2000 the PacketSetMinToCopy()
00265                                                                 ///< function can be used to define the minimum amount of data in the kernel buffer
00266                                                                 ///< that will cause the event to be signalled. 
00267         
00268         UINT ReadTimeOut;                       ///< \internal The amount of time after which a read on the driver will be released and 
00269                                                                 ///< ReadEvent will be signaled, also if no packets were captured
00270         CHAR Name[ADAPTER_NAME_LENGTH];
00271         PWAN_ADAPTER pWanAdapter;
00272         UINT Flags;                                     ///< Adapter's flags. Tell if this adapter must be treated in a different way, using the Netmon API or the dagc API.
00273 #ifdef HAVE_DAG_API
00274         dagc_t *pDagCard;                       ///< Pointer to the dagc API adapter descriptor for this adapter
00275         PCHAR DagBuffer;                        ///< Pointer to the buffer with the packets that is received from the DAG card
00276         struct timeval DagReadTimeout;  ///< Read timeout. The dagc API requires a timeval structure
00277         unsigned DagFcsLen;                     ///< Length of the frame check sequence attached to any packet by the card. Obtained from the registry
00278         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).
00279 #endif // HAVE_DAG_API
00280 }  ADAPTER, *LPADAPTER;
00281 
00282 /*!
00283   \brief Structure that contains a group of packets coming from the driver.
00284 
00285   This structure defines the header associated with every packet delivered to the application.
00286 */
00287 typedef struct _PACKET {  
00288         HANDLE       hEvent;            ///< \deprecated Still present for compatibility with old applications.
00289         OVERLAPPED   OverLapped;        ///< \deprecated Still present for compatibility with old applications.
00290         PVOID        Buffer;            ///< Buffer with containing the packets. See the PacketReceivePacket() for
00291                                                                 ///< details about the organization of the data in this buffer
00292         UINT         Length;            ///< Length of the buffer
00293         DWORD        ulBytesReceived;   ///< Number of valid bytes present in the buffer, i.e. amount of data
00294                                                                         ///< received by the last call to PacketReceivePacket()
00295         BOOLEAN      bIoComplete;       ///< \deprecated Still present for compatibility with old applications.
00296 }  PACKET, *LPPACKET;
00297 
00298 /*!
00299   \brief Structure containing an OID request.
00300 
00301   It is used by the PacketRequest() function to send an OID to the interface card driver. 
00302   It can be used, for example, to retrieve the status of the error counters on the adapter, its MAC address, 
00303   the list of the multicast groups defined on it, and so on.
00304 */
00305 struct _PACKET_OID_DATA {
00306     ULONG Oid;                                  ///< OID code. See the Microsoft DDK documentation or the file ntddndis.h
00307                                                                 ///< for a complete list of valid codes.
00308     ULONG Length;                               ///< Length of the data field
00309     UCHAR Data[1];                              ///< variable-lenght field that contains the information passed to or received 
00310                                                                 ///< from the adapter.
00311 }; 
00312 typedef struct _PACKET_OID_DATA PACKET_OID_DATA, *PPACKET_OID_DATA;
00313 
00314 
00315 #if _DBG
00316 #define ODS(_x) OutputDebugString(TEXT(_x))
00317 #define ODSEx(_x, _y)
00318 #else
00319 #ifdef _DEBUG_TO_FILE
00320 /*! 
00321   \brief Macro to print a debug string. The behavior differs depending on the debug level
00322 */
00323 #define ODS(_x) { \
00324         FILE *f; \
00325         f = fopen("winpcap_debug.txt", "a"); \
00326         fprintf(f, "%s", _x); \
00327         fclose(f); \
00328 }
00329 /*! 
00330   \brief Macro to print debug data with the printf convention. The behavior differs depending on 
00331   the debug level
00332 */
00333 #define ODSEx(_x, _y) { \
00334         FILE *f; \
00335         f = fopen("winpcap_debug.txt", "a"); \
00336         fprintf(f, _x, _y); \
00337         fclose(f); \
00338 }
00339 
00340 
00341 
00342 LONG PacketDumpRegistryKey(PCHAR KeyName, PCHAR FileName);
00343 #else
00344 #define ODS(_x)         
00345 #define ODSEx(_x, _y)
00346 #endif
00347 #endif
00348 
00349 /* We load dinamically the dag library in order link it only when it's present on the system */
00350 #ifdef HAVE_DAG_API
00351 typedef dagc_t* (*dagc_open_handler)(const char *source, unsigned flags, char *ebuf);   ///< prototype used to dynamically load the dag dll
00352 typedef void (*dagc_close_handler)(dagc_t *dagcfd);                                                                             ///< prototype used to dynamically load the dag dll
00353 typedef int (*dagc_getlinktype_handler)(dagc_t *dagcfd);                                                                ///< prototype used to dynamically load the dag dll
00354 typedef int (*dagc_getlinkspeed_handler)(dagc_t *dagcfd);                                                               ///< prototype used to dynamically load the dag dll
00355 typedef int (*dagc_setsnaplen_handler)(dagc_t *dagcfd, unsigned snaplen);                               ///< prototype used to dynamically load the dag dll
00356 typedef unsigned (*dagc_getfcslen_handler)(dagc_t *dagcfd);                                                             ///< prototype used to dynamically load the dag dll
00357 typedef int (*dagc_receive_handler)(dagc_t *dagcfd, u_char **buffer, u_int *bufsize);   ///< prototype used to dynamically load the dag dll
00358 typedef int (*dagc_stats_handler)(dagc_t *dagcfd, dagc_stats_t *ps);                                    ///< prototype used to dynamically load the dag dll
00359 typedef int (*dagc_wait_handler)(dagc_t *dagcfd, struct timeval *timeout);                              ///< prototype used to dynamically load the dag dll
00360 typedef int (*dagc_finddevs_handler)(dagc_if_t **alldevsp, char *ebuf);                                 ///< prototype used to dynamically load the dag dll
00361 typedef int (*dagc_freedevs_handler)(dagc_if_t *alldevsp);                                                              ///< prototype used to dynamically load the dag dll
00362 #endif // HAVE_DAG_API
00363 
00364 #ifdef __cplusplus
00365 extern "C" {
00366 #endif
00367 
00368 /**
00369  *  @}
00370  */
00371 
00372 // The following is used to check the adapter name in PacketOpenAdapterNPF and prevent 
00373 // opening of firewire adapters 
00374 #define FIREWIRE_SUBSTR L"1394"
00375 
00376 void PacketPopulateAdaptersInfoList();
00377 PWCHAR SChar2WChar(PCHAR string);
00378 PCHAR WChar2SChar(PWCHAR string);
00379 BOOL PacketGetFileVersion(LPTSTR FileName, PCHAR VersionBuff, UINT VersionBuffLen);
00380 PADAPTER_INFO PacketFindAdInfo(PCHAR AdapterName);
00381 BOOLEAN PacketUpdateAdInfo(PCHAR AdapterName);
00382 BOOLEAN IsFireWire(TCHAR *AdapterDesc);
00383 
00384 
00385 //---------------------------------------------------------------------------
00386 // EXPORTED FUNCTIONS
00387 //---------------------------------------------------------------------------
00388 
00389 PCHAR PacketGetVersion();
00390 PCHAR PacketGetDriverVersion();
00391 BOOLEAN PacketSetMinToCopy(LPADAPTER AdapterObject,int nbytes);
00392 BOOLEAN PacketSetNumWrites(LPADAPTER AdapterObject,int nwrites);
00393 BOOLEAN PacketSetMode(LPADAPTER AdapterObject,int mode);
00394 BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject,int timeout);
00395 BOOLEAN PacketSetBpf(LPADAPTER AdapterObject,struct bpf_program *fp);
00396 INT PacketSetSnapLen(LPADAPTER AdapterObject,int snaplen);
00397 BOOLEAN PacketGetStats(LPADAPTER AdapterObject,struct bpf_stat *s);
00398 BOOLEAN PacketGetStatsEx(LPADAPTER AdapterObject,struct bpf_stat *s);
00399 BOOLEAN PacketSetBuff(LPADAPTER AdapterObject,int dim);
00400 BOOLEAN PacketGetNetType (LPADAPTER AdapterObject,NetType *type);
00401 LPADAPTER PacketOpenAdapter(PCHAR AdapterName);
00402 BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET pPacket,BOOLEAN Sync);
00403 INT PacketSendPackets(LPADAPTER AdapterObject,PVOID PacketBuff,ULONG Size, BOOLEAN Sync);
00404 LPPACKET PacketAllocatePacket(void);
00405 VOID PacketInitPacket(LPPACKET lpPacket,PVOID  Buffer,UINT  Length);
00406 VOID PacketFreePacket(LPPACKET lpPacket);
00407 BOOLEAN PacketReceivePacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync);
00408 BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject,ULONG Filter);
00409 BOOLEAN PacketGetAdapterNames(PTSTR pStr,PULONG  BufferSize);
00410 BOOLEAN PacketGetNetInfoEx(PCHAR AdapterName, npf_if_addr* buffer, PLONG NEntries);
00411 BOOLEAN PacketRequest(LPADAPTER  AdapterObject,BOOLEAN Set,PPACKET_OID_DATA  OidData);
00412 HANDLE PacketGetReadEvent(LPADAPTER AdapterObject);
00413 BOOLEAN PacketSetDumpName(LPADAPTER AdapterObject, void *name, int len);
00414 BOOLEAN PacketSetDumpLimits(LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks);
00415 BOOLEAN PacketIsDumpEnded(LPADAPTER AdapterObject, BOOLEAN sync);
00416 BOOL PacketStopDriver();
00417 VOID PacketCloseAdapter(LPADAPTER lpAdapter);
00418 
00419 #ifdef __cplusplus
00420 }
00421 #endif 
00422 
00423 #endif //__PACKET32

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