question

udaya avatar image
udaya asked ericnute edited

Is there a way (API) to get all the attributes of a header under streamblock ?

There are many headers under a streamblock (e.g. EthernetII, ARP, IPv4 etc)and each one has separate attributes to configure them. Can we have API or any way so that we can get all the attribute of a header ? Please help!!
Spirent TestCenter (STC)apistreamblock
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mjefferson avatar image
mjefferson answered ericnute edited
foreach child [stc::get $streamblock -children] { puts "Object: $child" array set dummy [stc::get $child] parray dummy unset dummy puts "" } If you know the object type, you can just just grab directly. set pdu [stc::get $streamblock -children-ethernet:EthernetII] puts [stc::get $pdu]
1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

udaya avatar image udaya commented ·
Works super !!
0 Likes 0 ·
EricGregMiller avatar image
EricGregMiller answered EricGregMiller edited
Hi Udaya, Unfortunately I don't think the headers and attributes are shown in help. My suggestion is to use the TestCenter GUI to easily discover and manipulate headers and their attributes. When you have something close to what you want save the configuration as XML. Then load the XML in an API shell using stc::perform loadfromxml -filename . You can find the streamblocks under ports (stc::get project1 -children-ports, then stc::get port1 -children-streamblock). [EDIT: Removed reference to FrameConfig XML. Instead use PDU objects as presented by mjefferson]
2 comments
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mjefferson avatar image mjefferson commented ·
Hi Eric, Sorry, that's definitely not the way to do it. Each PDU is a child object of the StreamBlock. You can use the API to discover and view all of the current PDUs and their attributes. foreach child [stc::get $streamblock -children] { puts "Object: $child" array set dummy [stc::get $child] parray dummy unset dummy puts "" }
1 Like 1 ·
EricGregMiller avatar image EricGregMiller mjefferson commented ·
Thanks, Matt, I stand corrected. Learn something new every day. :-) So to be clear, it's still a good idea to play around in TestCenter GUI. After that please do NOT go into the XML like I did. Instead you can view and play around with the children of the streamblock.
0 Likes 0 ·
Yaseen avatar image
Yaseen answered
We can get all the children information of the streamblock using a help command i.e., stc::help streamblock Note: This returns only the name of the children but not the exact object name that you can use to create it. Hope this helps! Thanks!
1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

udaya avatar image udaya commented ·
NO Yaseen . It is not. Say ethernet header has attributes like srcMac , Name, ethertype etc. So I like to get all these attributes (attribute names) of a header.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.