Frame class

The Frame class represents all the data in one record, or frame, in a communications trace for a LAN line description. Each Frame contains three main sections of data that appear in the following order:

  1. An initial 24-byte section that contains general information about the frame
  2. General information about the frame (represented by the LanHeader class)
  3. The packet data (represented by subclasses of the IPacket abstract class)

Use the Frame class to parse and create a printable representation the data in the frame. The Frame class maintains the packet data in a linked list-like structure that uses specific formats. For specific information about the possible formats for packet data in a frame and for general information about the structure of a frame, see the following:

Commtrace model

The Frame class provides methods that allow you to perform a variety of actions that include the following:

You can use the following process to access the data in a packet:

  1. Use Frame.getPacket() to retrieve the packet
  2. Access the data in the header by calling Packet.getHeader()
  3. After you retrieve the header, call Header.getType() to find the type
  4. Use the specific Header subclass to to access the data associated with that header (the payload) and any additional headers

Example

The following example shows how you can use many of the commtrace classes, including the Format and FormatProperties classes, to display trace information to your monitor:

Example: Using the commtrace classes