IPktXPacket Interface Reference
[PacketX]

Packet class default interface. More...

List of all members.

Properties

LONG OriginalSize [get, set]
 Original frame size.
LONG DataSize [get, set]
 Data buffer size.
VARIANT Data [get, set]
 Frame data.
DATE Date [get, set]
 Capture date.
LONG TimeSec [get, set]
 Capture time.
LONG TimeUSec [get, set]
 Capture microseconds.
SAFEARRAY DataArray [get]
 Data byte array.
PktXProtocolType Protocol [get]
 Protocol type.
BSTR SourceMacAddress [get]
 Source MAC address.
BSTR DestMacAddress [get]
 Destination MAC address.
BSTR SourceIpAddress [get]
 Source IP address.
BSTR DestIpAddress [get]
 Destination IP address.
LONG SourcePort [get]
 Source port.
LONG DestPort [get]
 Destination port.


Detailed Description

Packet class default interface.

This interface can be used to work with packet raw data and protocol information.

Examples:

Capture.cpp.


Property Documentation

HRESULT IPktXPacket::OriginalSize [get, set]

Original frame size.

Note:
The original frame size can be bigger than captured data size.
Returns:
HRESULT error code.

HRESULT IPktXPacket::DataSize [get, set]

Data buffer size.

The data buffer contains first N (or all) bytes of the captured network frame.

Returns:
HRESULT error code.

HRESULT IPktXPacket::Data [get, set]

Frame data.

Returns first N (or all) bytes of captured network frame.

Note:
The reason why this property returns array of variants instead of array of bytes is because VBScript supports only variant arrays.
Example:
 '// Create PackeX instance
 Set oPktX = WScript.CreateObject("PktX.PacketX","PacketX_")
 ...
 '// Packet handler
 Public Sub PacketX_OnPacket(ByRef oPacket)
   For Each bByte In oPacket.Data
   '// Do something
   Next
 End Sub 
Example:
  '// Create packet
  Set tmpPkt = New Packet

  '// Prepare VARIANT array
  Dim oData(2)
  oData(0) = 1
  oData(1) = 2
  oData(2) = 3

  '// Pass the array 
  tmpPkt.Data = oData 
See also:
IPktXPacket::DataArray to return data as byte array.
Returns:
HRESULT error code.

HRESULT IPktXPacket::Date [get, set]

Capture date.

Returns packet capture date and time information.

Returns:
HRESULT error code.

HRESULT IPktXPacket::TimeSec [get, set]

Capture time.

Returns capture time in the standard UNIX time format (number of seconds from 1/1/1970).

Returns:
HRESULT error code.

HRESULT IPktXPacket::TimeUSec [get, set]

Capture microseconds.

Returns the microseconds since system boot at the moment of capture.

Returns:
HRESULT error code.

HRESULT IPktXPacket::DataArray [get]

Data byte array.

Returns packet data as array of bytes.

Note:
Your programming environment has to support byte arrays. For example you can use this property from Visual Basic, C++, C# but not from VBScript.
Returns:
HRESULT error code.

HRESULT IPktXPacket::Protocol [get]

Protocol type.

Decodes frame and returns the "last" network protocol .

Note:
Currently only the Ethernet -> IP -> TCP or UDP protocol stack is supported.
Returns:
HRESULT error code.

HRESULT IPktXPacket::SourceMacAddress [get]

Source MAC address.

Returns frame source MAC address.

Returns:
HRESULT error code.

HRESULT IPktXPacket::DestMacAddress [get]

Destination MAC address.

Returns frame destination MAC address.

Returns:
HRESULT error code.

HRESULT IPktXPacket::SourceIpAddress [get]

Source IP address.

Returns packet source IP address.

Returns:
HRESULT error code.

HRESULT IPktXPacket::DestIpAddress [get]

Destination IP address.

Returns packet destination IP address.

Returns:
HRESULT error code.

HRESULT IPktXPacket::SourcePort [get]

Source port.

Returns source port number.

Note:
This property will be used for both TCP and UDP protocols.
See also:
IPktXPacket::Protocol to read protocol type information.
Returns:
HRESULT error code.

HRESULT IPktXPacket::DestPort [get]

Destination port.

Returns destination port number.

Note:
This property will be used for both TCP and UDP protocols.
See also:
IPktXPacket::Protocol to read protocol type information.
Returns:
HRESULT error code.


The documentation for this interface was generated from the following file:

Copyright © 2000-2007 beeSync. All rights reserved.