Public Member Functions | |
| HRESULT | SendPacket ([in] VARIANT Buffer,[in, optional] VARIANT lNumWrites) |
| Send raw network frames. | |
Properties | |
| BSTR | Device [get, set] |
| Network interface name. | |
| BSTR | Description [get, set] |
| Network interface description. | |
| LONG | BuffMinToCopy [get, set] |
| Minimum number of bytes to copy from capture buffer. | |
| LONG | BuffSize [get, set] |
| Kernel mode capture buffer size in bytes. | |
| PktXPacketType | HWFilter [get, set] |
| Hardware filter flags. | |
| BSTR | BPFilter [get, set] |
| Berkley packet filter string. | |
| LONG | BPFSnapLen [get, set] |
| Berkley packet filter snap length. | |
| PktXMode | Mode [get, set] |
| Working mode . | |
| LONG | ReadTimeout [get, set] |
| Read timeout. | |
| PktXLinkType | LinkType [get] |
| Network link type . | |
| LONG | LinkSpeed [get] |
| Network link speed. | |
| BSTR | NetIP [get] |
| Network IP address. | |
| BSTR | NetMask [get] |
| Network mask. | |
| LONG | PacketsRecv [get, set] |
| Total number of packets received. | |
| LONG | PacketsLost [get, set] |
| Total number of packets lost. | |
| BSTR | HWAddress [get] |
| Adapter MAC address. | |
| IDispatch | Clone [get] |
| Clone adapter. | |
| LONG | IsGood [get] |
| Test network interface. | |
This interface groups different kind of settings related to one network interface.
| HRESULT IPktXAdapter::SendPacket | ( | [in] VARIANT | Buffer, | |
| [in, optional] VARIANT | lNumWrites | |||
| ) |
Send raw network frames.
Sends buffer contents by specified number of times.
| Buffer | an array of VARINAT's or BYTE's. | |
| lNumWrites | a number of times to repeat the send. |
'// Create variant array and fill it Dim oPacket(n) oPacket(0)=1 oPacket(1)=2 oPacket(2)=3 ... '// Create PacketX instance Set oPktX = CreateObject("PktX.PacketX") '// Send packet by reference (VT_BYREF|VT_VARIANT) as array of variants oPktX.Adapter.SendPacket oPacket, 1 '// Send packet by value (VT_BYREF|VT_VARIANT|VT_ARRAY) as array of variants oPktX.Adapter.SendPacket(oPacket) '// Send packet directly (VT_VARIANT|VT_ARRAY) as array of variants oPktX.Adapter.SendPacket Array(1,2,3) '// Send packet directly (VT_VARIANT|VT_ARRAY) as array of variants, repeat 100 times oPktX.Adapter.SendPacket _ Array(&hFF, &hFF, &hFF, &hFF, &hFF, &hFF, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, _ &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, _ &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00), 100
HRESULT IPktXAdapter::Device [get, set] |
Network interface name.
Network interface is represented by unique device name assigned by operating system.
HRESULT IPktXAdapter::Description [get, set] |
Network interface description.
The device description string contains manufacturer and model related information about the physical network adapter.
HRESULT IPktXAdapter::BuffMinToCopy [get, set] |
Minimum number of bytes to copy from capture buffer.
The minimum amount of data in the kernel buffer that will cause the WinPcap driver to release a read in progress.
HRESULT IPktXAdapter::BuffSize [get, set] |
Kernel mode capture buffer size in bytes.
Kernel buffer is used store network frames before they are passed to user mode application.
This parameter affects heavily the perfomance of the capture process. Therefore we discourage to set this parameter to very low or very high values. The optimal buffer size depends on the amount of network traffic in LAN segment and amount of RAM installed on your computer.
HRESULT IPktXAdapter::HWFilter [get, set] |
Hardware filter flags.
Hardware filter is a combination of PacketType flags.
If hardware filter is defined only network frames passing the filter will be returned to user mode application.
'// Create PacketX Set oPktX = CreateObject("PktX.PacketX") ... '// All network frames oPktX.Adapter.HWFilter = PktXPacketTypePromiscuous ... '// Packets sent/received by this computer only oPktX.Adapter.HWFilter = PktXPacketTypeDirected Or PktXPacketTypeAllLocal
HRESULT IPktXAdapter::BPFilter [get, set] |
Berkley packet filter string.
Berkley packet filter (BPF) uses same syntax as tcpdump filter expression.
If packet filter is defined only network frames passing the filter will be returned to user mode application.
'// Create PacketX Set oPktX = CreateObject("PktX.PacketX") ... '// To capture all packets arriving at or departing from sun down oPktX.Adapter.BPFilter = "host sundown" ... '// To capture traffic between helios and either hot or ace oPktX.Adapter.BPFilter = "host helios and ( hot or ace )" ... '// To capture all IP packets between ace and any host except helios oPktX.Adapter.BPFilter = "ip host ace and not helios" ... '// To capture all traffic between local hosts and hosts at Berkeley oPktX.Adapter.BPFilter = "net ucb-ether" ... '// To capture all ftp traffic oPktX.Adapter.BPFilter = "port ftp or ftp-data" ... '// To capture traffic neither sourced from nor destined for local hosts (if you gateway to one other net, this stuff should never make it onto your local net) oPktX.Adapter.BPFilter = "ip and not net localnet" ... '// To capture the start and end packets (the SYN and FIN packets) of each TCP conversation oPktX.Adapter.BPFilter = "tcp[13] & (0x02|0x04) != 0" ... '// To capture IP packets longer than 576 bytes oPktX.Adapter.BPFilter = "ip[2:2] > 576" ... '// To capture IP broadcast or multicast packets that were not sent via ethernet broadcast or multicast oPktX.Adapter.BPFilter = "ether[0] & 1 = 0 and ip[16] >= 224" ... '// To capture all ICMP packets that are not echo requests/replies (i.e., not ping packets) oPktX.Adapter.BPFilter = "icmp[0] != 8 and icmp[0] != 0"
HRESULT IPktXAdapter::BPFSnapLen [get, set] |
Berkley packet filter snap length.
The snap length defines the maximum number of frame bytes to be captured.
HRESULT IPktXAdapter::Mode [get, set] |
HRESULT IPktXAdapter::ReadTimeout [get, set] |
Read timeout.
The read timeout determines how long one read request can be pending.
HRESULT IPktXAdapter::LinkType [get] |
HRESULT IPktXAdapter::LinkSpeed [get] |
HRESULT IPktXAdapter::NetIP [get] |
HRESULT IPktXAdapter::NetMask [get] |
HRESULT IPktXAdapter::PacketsRecv [get, set] |
Total number of packets received.
This value reflects total number of packets processed during the last capture session.
HRESULT IPktXAdapter::PacketsLost [get, set] |
Total number of packets lost.
This value reflects total number of packets lost during the last capture session.
HRESULT IPktXAdapter::HWAddress [get] |
HRESULT IPktXAdapter::Clone [get] |
HRESULT IPktXAdapter::IsGood [get] |
Test network interface.
Probes adapter by issuing open and close request to network interface. The returned boolean value indicates success or failure of the operations perfomed.