関数 |
|
| PCHAR | PacketGetVersion () |
| dll形式で文字列を返す |
|
| BOOLEAN | PacketGetNetType (LPADAPTER AdapterObject, NetType *type) |
| アダプタのMAC型に関する情報を返す |
|
| BOOL | PacketStopDriver () |
| WinPcapデバイスドライバを止めて領域を解放する |
|
| LPADAPTER | PacketOpenAdapter (LPTSTR AdapterName) |
| アダプタをオープンする |
|
| VOID | PacketCloseAdapter (LPADAPTER lpAdapter) |
| アダプタをクローズする |
|
| LPPACKET | PacketAllocatePacket (void) |
| _PACKET
構造体を割り振る |
|
| VOID | PacketFreePacket (LPPACKET lpPacket) |
| _PACKET
構造体を開放する |
|
| VOID | PacketInitPacket (LPPACKET lpPacket, PVOID Buffer, UINT Length) |
| _PACKET 構造体を初期化する |
|
| BOOLEAN | PacketReceivePacket (LPADAPTER AdapterObject, LPPACKET lpPacket, BOOLEAN Sync) |
| NPFドライバからデータ(パケットまたは統計値)を読み込む |
|
| BOOLEAN | PacketSendPacket (LPADAPTER AdapterObject, LPPACKET pPacket, BOOLEAN Sync) |
| ネットワークに一つの(またはそれ以上の)パケットのコピーを送信する |
|
| INT | PacketSendPackets (LPADAPTER AdapterObject, PVOID PacketBuff, ULONG Size, BOOLEAN Sync) |
| ネットワークにパケットのバッファを送信する |
|
| BOOLEAN | PacketSetMinToCopy (LPADAPTER AdapterObject, int nbytes) |
| 読み込みで受け取られる最小のデータ量を特定する |
|
| BOOLEAN | PacketSetMode (LPADAPTER AdapterObject, int mode) |
| アダプタのワーキングモードをセットする |
|
| BOOLEAN | PacketSetDumpName (LPADAPTER AdapterObject, void *name, int len) |
| アダプタがダンプモードの時にパケットを受け取るファイル名をセットする |
|
| BOOLEAN | PacketSetDumpLimits (LPADAPTER AdapterObject, UINT maxfilesize, UINT maxnpacks) |
| ダンプモードの上限をセットする |
|
| BOOLEAN | PacketIsDumpEnded (LPADAPTER AdapterObject, BOOLEAN sync) |
| カーネルダンププロセスの状態を返す。すなわち、 PacketSetDumpLimits()
で設定した上限のうちの一つに到達したかどうかを返す。 |
|
| HANDLE | PacketGetReadEvent (LPADAPTER AdapterObject) |
| アダプタ上のリード呼び出しに関連した通知イベントを返す |
|
| BOOLEAN | PacketSetNumWrites (LPADAPTER AdapterObject, int nwrites) |
| PacketSendPacket()
で書かれたシングルパケットのネットワーク上で繰り返される回数をセットする |
|
| BOOLEAN | PacketSetReadTimeout (LPADAPTER AdapterObject, int timeout) |
| アダプタ上のリードが返すタイムアウトをセットする |
|
| BOOLEAN | PacketSetBuff (LPADAPTER AdapterObject, int dim) |
| キャプチャに関連したカーネルレベルのバッファサイズをセットする |
|
| BOOLEAN | PacketSetBpf (LPADAPTER AdapterObject, struct bpf_program *fp) |
| カーネルレベルのパケットフィルタをセットする |
|
| BOOLEAN | PacketGetStats (LPADAPTER AdapterObject, struct bpf_stat *s) |
| 現在のキャプチャセッションについての二つの統計値を返す |
|
| BOOLEAN | PacketGetStatsEx (LPADAPTER AdapterObject, struct bpf_stat *s) |
| 現在のキャプチャセッションの統計値を返す。 PacketGetStats() の拡張バージョン |
|
| BOOLEAN | PacketRequest (LPADAPTER AdapterObject, BOOLEAN Set, PPACKET_OID_DATA OidData) |
| ネットワークカードドライバの内部変数上の query/set
オペレーションを実行する |
|
| BOOLEAN | PacketSetHwFilter (LPADAPTER AdapterObject, ULONG Filter) |
| 入ってくるパケットにハードウェアフィルタをセットする |
|
| BOOLEAN | PacketGetAdapterNames (PTSTR pStr, PULONG BufferSize) |
| 利用可能なネットワークアダプタリストとその詳細を回収する |
|
| BOOLEAN | PacketGetNetInfoEx (LPTSTR AdapterName, npf_if_addr *buffer, PLONG NEntries) |
| Returns comprehensive information the
addresses of an adapter. |
|
| BOOLEAN | PacketGetNetInfo (LPTSTR AdapterName, PULONG netp, PULONG maskp) |
| アダプタのネットマスクとIPアドレスを返す |
|
Variables |
|
| char | PacketLibraryVersion [] = "3.0 alpha3" |
| 現在の packet.dll バージョン。直接取得されるか、 PacketGetVersion()
関数を通して取得される |
|
|
|
_PACKET 構造体を割り振ります。
ファイル Packet32.c の 686 行目の定義 参照 ODS. |
|
|
アダプタをクローズします。
ファイル Packet32.c の 666 行目の定義 参考 _ADAPTER::hFile, _ADAPTER::ReadEvent. 右より参照 main(), PacketGetAdapterNames(), pcap_close(), pcap_open_live(). |
|
|
_PACKET 構造体を解放します。
ファイル Packet32.cの 707 行目の定義 右より参照 main(), pcap_sendpacket(). |
|
||||||||||||
|
利用可能なアダプタリストとその詳細を回収します。
Warning: the result of this function is obtained querying the registry, therefore the format of the result in Windows NTx is different from the one in Windows 9x. Windows 9x uses the ASCII encoding method to store a string, while Windows NTx uses UNICODE. After a call to PacketGetAdapterNames in Windows 95x, pStr contains, in succession:
In Windows NTx, pStr contains: the names of the adapters, in UNICODE format, separated by a single UNICODE "" (i.e. 2 ASCII ""), a double UNICODE "", followed by the descriptions of the adapters, in ASCII format, separated by a single ASCII "" . The string is terminated by a double ASCII "".
Definition at line 1353 of file Packet32.c. References ODS, ODSEx, PacketCloseAdapter(), PacketOpenAdapter(), PacketRequest(), and PPACKET_OID_DATA. Referenced by main(). |
|
||||||||||||||||
|
Returns the IP address and the netmask of an adapter.
Definition at line 1936 of file Packet32.c. References inet_addrU(), maskp, netp, and SChar2WChar(). |
|
||||||||||||||||
|
Returns comprehensive information the addresses of an adapter.
Definition at line 1690 of file Packet32.c. References inet_addrU(), and SChar2WChar(). |
|
||||||||||||
|
Returns information about the MAC type of an adapter.
Definition at line 369 of file Packet32.c. References NetType::LinkSpeed, NetType::LinkType, ODS, ODSEx, PacketRequest(), and PPACKET_OID_DATA. Referenced by pcap_open_live(). |
|
|
Returns the notification event associated with the read calls on an adapter.
In every case, a call to PacketReceivePacket() will return immediately. The event can be passed to standard Win32 functions (like WaitForSingleObject or WaitForMultipleObjects) to wait until the driver's buffer contains some data. It is particularly useful in GUI applications that need to wait concurrently on several events. Definition at line 1100 of file Packet32.c. References _ADAPTER::ReadEvent. Referenced by pcap_getevent(). |
|
||||||||||||
|
Returns a couple of statistic values about the current capture session.
Definition at line 1202 of file Packet32.c. References bpf_stat::bs_drop, bpf_stat::bs_recv, and _ADAPTER::hFile. Referenced by main(), and pcap_stats(). |
|
||||||||||||
|
Returns statistic values about the current capture session. Enhanced version of PacketGetStats().
Definition at line 1236 of file Packet32.c. References bpf_stat::bs_capt, bpf_stat::bs_drop, bpf_stat::bs_recv, _ADAPTER::hFile, and bpf_stat::ps_ifdrop. Referenced by pcap_stats_ex(). |
|
|
Returns a string with the dll version.
Definition at line 349 of file Packet32.c. References PacketLibraryVersion. Referenced by main(). |
|
||||||||||||||||
|
Initializes a _PACKET structure.
Definition at line 729 of file Packet32.c. References _PACKET::bIoComplete, _PACKET::Buffer, _PACKET::Length, and _PACKET::ulBytesReceived. Referenced by main(), pcap_open_live(), pcap_sendpacket(), and pcap_setuserbuffer(). |
|
||||||||||||
|
Returns the status of the kernel dump process, i.e. tells if one of the limits defined with PacketSetDumpLimits() was reached.
Definition at line 1058 of file Packet32.c. References _ADAPTER::hFile, and _ADAPTER::ReadEvent. Referenced by pcap_live_dump_ended(). |
|
|
Opens an adapter.
Definition at line 468 of file Packet32.c. References _ADAPTER::hFile, _ADAPTER::NumWrites, ODS, ODSEx, PacketInstallDriver(), PacketSetMaxLookaheadsize(), PacketSetReadEvt(), SChar2WChar(), scmHandle, srvHandle, and _ADAPTER::SymbolicLink. Referenced by main(), PacketGetAdapterNames(), and pcap_open_live(). |
|
||||||||||||||||
|
Read data (packets or statistics) from the NPF driver.
The number of packets received with this function is variable. It depends on the number of packets currently stored in the driver’s buffer, on the size of these packets and on the size of the buffer associated to the lpPacket parameter. The following figure shows the format used by the driver to pass packets to the application.
method used to encode the packets Examples can be seen either in the TestApp sample application (see the Packet.dll samples page) provided in the developer's pack, or in the pcap_read() function of wpcap. Definition at line 768 of file Packet32.c. References _PACKET::Buffer, _ADAPTER::hFile, _PACKET::Length, _ADAPTER::ReadEvent, _ADAPTER::ReadTimeOut, and _PACKET::ulBytesReceived. Referenced by main(), and pcap_read(). |
|
||||||||||||||||
|
Performs a query/set operation on an internal variable of the network card driver.
Definition at line 1271 of file Packet32.c. References _ADAPTER::hFile, and ODSEx. Referenced by PacketGetAdapterNames(), PacketGetNetType(), PacketSetHwFilter(), and PacketSetMaxLookaheadsize(). |
|
||||||||||||||||
|
Sends one (or more) copies of a packet to the network.
The behavior of this function is influenced by the PacketSetNumWrites() function. With PacketSetNumWrites(), it is possible to change the number of times a single write must be repeated. The default is 1, i.e. every call to PacketSendPacket() will correspond to one packet sent to the network. If this number is greater than 1, for example 1000, every raw packet written by the application will be sent 1000 times on the network. This feature mitigates the overhead of the context switches and therefore can be used to generate high speed traffic. It is particularly useful for tools that test networks, routers, and servers and need to obtain high network loads. The optimized sending process is still limited to one packet at a time: for the moment it cannot be used to send a buffer with multiple packets.
Definition at line 809 of file Packet32.c. References _PACKET::Buffer, _ADAPTER::hFile, and _PACKET::Length. Referenced by main(), and pcap_sendpacket(). |
|
||||||||||||||||||||
|
Sends a buffer of packets to the network.
Definition at line 845 of file Packet32.c. References _ADAPTER::hFile, and ODS. Referenced by pcap_sendqueue_transmit(). |
|
||||||||||||
|
Sets a kernel-level packet filter.
A filter can be automatically created by using the pcap_compile() function of wpcap. This function converts a human readable text expression with the syntax of WinDump (see the manual of WinDump at http://netgroup.polito.it/windump for details) into a BPF program. If your program doesn't link wpcap, but you need to know the code of a particular filter, you can launch WinDump with the -d or -dd or -ddd flags to obtain the pseudocode. Definition at line 1183 of file Packet32.c. References bpf_program::bf_insns, bpf_program::bf_len, and _ADAPTER::hFile. Referenced by pcap_setfilter(). |
|
||||||||||||
|
Sets the size of the kernel-level buffer associated with a capture.
Note: the dimension of the kernel buffer affects heavily the performances of the capture process. An adequate buffer in the driver is able to keep the packets while the application is busy, compensating the delays of the application and avoiding the loss of packets during bursts or high network activity. The buffer size is set to 0 when an instance of the driver is opened: the programmer should remember to set it to a proper value. As an example, wpcap sets the buffer size to 1MB at the beginning of a capture. Definition at line 1157 of file Packet32.c. References _ADAPTER::hFile. Referenced by main(), pcap_open_live(), and pcap_setbuff(). |
|
||||||||||||||||
|
Set the dump mode limits.
Definition at line 1027 of file Packet32.c. References _ADAPTER::hFile. Referenced by pcap_live_dump(). |
|
||||||||||||||||
|
Sets the name of the file that will receive the packet when the adapter is in dump mode.
Definition at line 980 of file Packet32.c. References _ADAPTER::hFile, and SChar2WChar(). Referenced by pcap_live_dump(). |
|
||||||||||||
|
Sets a hardware filter on the incoming packets.
Definition at line 1305 of file Packet32.c. References ODS, PacketRequest(), and PPACKET_OID_DATA. Referenced by main(), and pcap_open_live(). |
|
||||||||||||
|
Defines the minimum amount of data that will be received in a read.
note: this function has effect only in Windows NTx. The driver for Windows 9x doesn't offer this possibility, therefore PacketSetMinToCopy is implemented under these systems only for compatibility. Definition at line 917 of file Packet32.c. References _ADAPTER::hFile. Referenced by pcap_open_live(), and pcap_setmintocopy(). |
|
||||||||||||
|
Sets the working mode of an adapter.
data structure returned by statistical mode
data structure returned by statistical dump mode Definition at line 959 of file Packet32.c. References _ADAPTER::hFile. Referenced by pcap_live_dump(), and pcap_setmode(). |
|
||||||||||||
|
Sets the number of times a single packet written with PacketSendPacket() will be repeated on the network.
Definition at line 1113 of file Packet32.c. References _ADAPTER::hFile. Referenced by main(). |
|
||||||||||||
|
Sets the timeout after which a read on an adapter returns.
Definition at line 1131 of file Packet32.c. References _ADAPTER::hFile, and _ADAPTER::ReadTimeOut. Referenced by main(), pcap_open_live(), and pcap_setnonblock(). |
|
|
Stops and unloads the WinPcap device driver.
Definition at line 407 of file Packet32.c. References scmHandle. |
|
|
Current packet.dll Version. It can be retrieved directly or through the PacketGetVersion() function. Definition at line 343 of file Packet32.c. Referenced by PacketGetVersion(). |
documentation. Copyright (c)2002-2003 Politecnico di Torino.
2005 translated by Telebusiness,Inc.
All rights reserved.