prstmidx.vbs
' 
' PRSTMIDX - Print the STREAM Index 
'

' -----------------------
' Check usage & arguments
' -----------------------
Set Stdout = WScript.StdOut
 
if WScript.Arguments.Count <> 1 then
	Stdout.WriteLine "Usage: prstmidx <filename>"
	WScript.Quit
end if
 
InputFile  = WScript.Arguments.Item(0)
Set UnsniffDB = CreateObject("Unsniff.Database")
 
UnsniffDB.Open(InputFile)
Stdout.WriteLine "Filename is " & InputFile
 
Dim STMIndex
Set STMIndex = UnsniffDB.StreamIndex
For Each STM In STMIndex
	StdOut.WriteLine STM.ID & vbTab & STM.StartTimestamp & vbTab &_
		 	 STM.SourceAddress & vbTab & STM.DestinationAddress &_
		 	 STM.InByteCount & vbTab & STM.OutByteCount & vbTab & STM.Description 
Next
 
UnsniffDB.Close()