Spirent TestCenter: How to read a .pcap file and store it in a variabe Native API


Doc ID    KNI15047
Version:    2.0
Status:    Published
Published date:    08/31/2017
Created Date:    08/31/2017
 

Symptoms

Customer wanted to use Native API to save a .pacp file in a variable and manipulate it as desire,

Environment

Spirent TestCenter Native API

Explanation/Resolution

To save frames into variables, you can CaptureGetFrame in loop after stopping capture(same way as HLTAPI sth.packet_stats), below is an example in Tcl format:

 set captureid [stc::get $porthandle -children-capture]
              set num_frames [stc::get $captureid -PktCount]
 
               for {set frameindex 0} {$frameindex < $num_frames} {incr frameindex} {
                    array set frameinfo [stc::perform CaptureGetFrame -captureproxyid $captureid -frameindex $frameindex]
                     parray frameinfo
               }

Find Answers

Specified Languages
English
中文

Please Sign In

Username
Password

Did you forget your password?
Click here for assistance

New user? Start here.