Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[blue]Option Explicit
Private Sub Form_Load()
PacketXCtrl1.Adapter = PacketXCtrl1.Adapters(1) [green]' Assuming only one adapter, and that this is the one we want to monitor[/green]
[green]' Following 4 lines from PacketX example code
'// Capture buffer parameters[/green]
PacketXCtrl1.Adapter.BuffSize = 256& * 1024 [green]'// 256 KB[/green]
PacketXCtrl1.Adapter.BuffMinToCopy = 0
[green]'// Hardware filter and capture mode[/green]
PacketXCtrl1.Adapter.HWFilter = PktXPacketTypePromiscuous
PacketXCtrl1.Adapter.Mode = PktXModeCapture
[green]' Start monitoring[/green]
PacketXCtrl1.Start
End Sub
Private Sub Form_Unload(Cancel As Integer)
PacketXCtrl1.Stop
End Sub
Private Sub PacketXCtrl1_OnPacket(ByVal pPacket As PacketXLibCtl.IPktXPacket)
[green]' if the source of the packet is our adapter[/green]
If pPacket.SourceIpAddress = PacketXCtrl1.Adapter.NetIP Then
Debug.Print pPacket.SourceIpAddress, pPacket.SourcePort, pPacket.DestPort
End If
End Sub[/blue]