Doc version
Last revised 07/25/2005


For AiroPeek 3.0


Peek's COM interface now supports the following operations:


  • Open a packet list file

  • Create a new capture window by opening a capture template file

  • Start/stop a capture

  • Save a capture window or packet list file to a file and format of your choice

  • Save a report

  • Load a filter file

  • Load a nametable file

  • Load an alarm file

  • Load and Start an AutoCapture file

  • Get a Summary Statistic

COM Application Object Reference

Read-Only Properties
Name BSTR Application name
Application IDispatch* the application object
Parent IDispatch* the application object
Documents IDispatch* the object that knows how to open documents
ActiveDocument IDispatch* NULL (not implemented)
Windows IDispatch* NULL (not implemented)
ActiveWindow IDispatch* NULL
FullName BSTR same as Name
Path BSTR empty string (not implemented)
Settable Properties
Caption BSTR title of main window (usually the application name)
Interactive BOOL always TRUE. Setting does nothing.
Visible BOOL shows/hides the application
Left LONG moves the app window
Top LONG moves the app window
Width LONG resizes the app window
Height LONG resizes the app window
Minimized BOOL shrinks/expands the app window
Maximized BOOL zooms/restores the app window
void Beep() makes noise
void Quit() exits the app
void Minimize() shrinks the app. Same as setting Minimized = True
void Maximize() zooms the app. Same as setting Maximized = True
void Restore() makes the app a movable window
void CloseAll() closes all open windows
void CascadeWindows() stacks all open windows
void TileVertically() tall skinny windows
void TileHorizontally() short wide windows
void ArrangeIcons() rearranges deck chairs on your MDI Titanic
void NextWindow() flips to the next open window
void PreviousWindow() flips to the previous open window
void ViewFilters() opens Filters window
void ViewNameTable() opens Name Table window
void ViewLog() opens Log window
void ViewAlarms() opens Alarms window

COM Documents Object Reference

The Documents object exists only to open files. All other properties and methods are unimplemented.

IDispatch* Open(
     BSTR File)
Opens the given file. If the given file is a packet trace file, returns an IDispatch* reference to the Document object that file window. If the file is a capture template file, returns an IDispatch* reference to the Document object for that capture window. 

If the given file is a name table file, an alarm file, or a filter file then it is loaded into Peek.

COM Document Object Reference

The Document class represents a capture or file window. You acquire a reference to a document object through app.Documents.Open(BSTR File).

Read-Only Properties
Application IDispatch* NULL (not implemented)
Parent IDispatch* NULL (not implemented)
Name BSTR window title
Settable Properties
IsCapturing BOOL set to True to start capture, set to False to stop capture
void Close() Closes the window
void Save(
    BSTR FilePath,
    INT formatIndex)
Saves all packets to a file. The formatIndex is the index into the format combo box in Peek's Save dialog:
  1. .apc/.pkt Peek Packet File (new tagged format)
  2. .apc/.pkt Peek Classic Packet File
  3. .wpz Peek Packet File Compressed
  4. .txt Packet List (tab delimited)
  5. .csv Packet List (comma separated value)
  6. .txt Decoded Packets
  7. .rtf Decoded Packets
  8. .htm Decoded Packets

void SummaryGetEntry(
    BSTR Label,
    BSTR Group)
Get a Summary Statistics entry.  Summary Statistics can be seen in the Summary Tab of a Capture Window
void SaveReport(
    BSTR ReportName,
    BSTR ReportFolder)

Saves a report specified by ReportName to a directory specified by ReportFolder.   The available reports can be seen using the Peek GUI and selecting Save Report.  "HTML Report" is a report name


To specify a capture template, use the Peek GUI to create one and save it.   Capture templates are XML files so they can also be modified by your program as well as by hand.

To specify a set of filters, use the Peek GUI to define them and save them as part of your capture template file.

To extract information out of a capture, save the capture to a file and then parse the file. Text packet lists are especially good for extracting summary strings and addresses.

Visual Basic Sample Code

' acquire connection to app
Dim myApp
On Error Resume Next
myApp = GetObject(, "EtherPeek.Application")
If myApp Is Nothing Then
myApp = CreateObject("EtherPeek.Application")
End If

' create  a new capture window, using an existing capture template
Dim myDoc
myDoc = myApp.Documents.Open("C:\\foo\\Template.ctf")

' start capture
myDoc.IsCapturing = True

' wait a while
' ...

' stop capture
myDoc.IsCapturing = False

' save the captured packets
myDoc.Save("C:\\foo\\PacketList.txt", 4)