PassThru (PackThru)
This
sample demonstrates the basic usage of active filtering modes. It
sets chosen network interface into the filtering mode (sent and
received packets queued), register Win32 event
(CNdisApi::SetPacketEvent) and start waiting for the new packets.
This samples functionality is close to Windows DDK PassThru
intermediate driver sample. PackThru is the same as PassThru but it
uses multiply packets sends/receives.
Notes:
- If you set adapter
into the filtering mode you should remember that the internal
helper driver packet queue size is limited (500 packets in current
version). If you don't read packets from the queue (with
CNdisApi::ReadPacket) or release the queued packets directly by
calling CNdisApi::FlushAdapterPacketQueue then after the queue
reaches it's maximum limit all network activities will be frozen.
Please be attentive, don't forget to release network interface
after you have finished reading packets from it (see
ReleaseInterface function in the PassThru.cpp).
- Use ListAdapters for
getting information about MSTCP network interfaces and for getting
network interface index for calling PacketSniffer
- Note that as far as
network interfaces can be enabled/disabled dynamically on Windows
2000/XP adapter list is also changed when these operations are
performed.
|