What is PacketVB?
PacketVB is a ActiveX library for use with Visual Basic that wraps the function exported by the WinPcap API (packet.dll), developed by Politecnico di Torino. The methods used are closely related to the functions exported by the packet DLL.
PacketVB uses an internal buffer to capture network packets and then parses each packet from the buffer and sends the number of bytes parsed in an event. A method call is then used to copy the bytes from the internal buffer to a byte array. Currently, no protocols are parsed and it is up to the users to do.
The ActiveX is being written in C++ ALT and the most current release is fairly stable.
|PacketReceived(numerofbytes As Long)||This events is raised when the activex dll has a packet ready. Use GetRawPacketData method to get the bytes of the packet.|
|GetAdapterNames (AdapterNamesStr as String) as Long||Retrieves a list of
adapters installed on the system into an string
array. The size for the string
passed in this call must be defined.
(example: Dim AdapterNames As String * 1000)
|OpenAdapter(AdapterName as String) as Long||Opens adapter named AdapterName.|
|AllocatePacket() as Long||Allocates space for a packet.|
|InitPacket(BufferSize as Long) as Long||Sets up and Initializes the DLL's internal buffer.|
|GetRawPacketData(ArrayOfBytes() as Bytes)||Copies the raw byte data from internal buffer to the byte array.|
|FreePacket()||Releases the DLL's internal buffer.|
|StartCapture()||Starts capturing network traffic.|
|StopCapture()||Stops capturing network traffic.|
|CloseAdapter()||Closes the opened adapter.|
|GetNetInfo(AdapterName as string,netIP as long,netMask as long)||Returns the network IP and Mask for adaptername.|
|HWFilter||Sets/Reads the filter mode for an open adapter.|
|ReadTimeOut||Sets/Reads the read timeout.|
|BufferSize||Sets/Reads the adapters buffer size.|
|LinkSpeed||Returns the Link speed. (read only).|
|LinkType||Returns the Link type. (read only).|
|PacketsDropped||Returns the number of packets that were dropped. (read only).|
|PacketsReceived||Returns the number of packets received during capture. (read only).|
-Released ver 126.96.36.199. I was unable to add any extra functionality. I did finally track down the problem with the application some times crashing when stopping the capture. This is now fixed. Also fixed the parsing of MAC address in the vb module. Happy New Year!
Nov 27, 2003
-Sorry, my real job has been a bit busy and I have not had time to work on the project. Still would like to get some bug reports. Planning on adding sending packets in the next release.
Sept 05, 2003
- If you are getting a lot of dropped packets, try increasing the buffer size. There is internal buffer size limit of 280000. An error will return if you try to set the buffer size more than this.
> - The license and warning messages that pop up at registering will be removed.
Aug 29, 2003
- PacketVB has been re-written to C++ and as a result it is more stable. An event is now used to notify of received packets.
Last updated: Nov 27,2003