sth::hlapi_gen

Purpose

Provides the Command Line Interface (CLI) mode of the Save as HLTAPI function to generate Spirent HLTAPI script from the existing configuration file (in .xml or .tcc format). This is not a Spirent HLTAPI function, so it is only available in Tcl.

Synopsis

Note

M indicates that the argument is Mandatory .

sth::hlapi_gen
    [-config_file  <config file>  M]
    [-output <output file>
    [-output_type {tcl|perl|python}]
    [-test_config  {0|1}]
    [-test_control {0|1}]
    [-test_run     {0|1}]
    [-test_result  {0|1}]
    [-pkt_capture  {0|1}]
    [-device_info  {0|1}]
    [-default_value {0|1}]
    [-scaling_test {0|1}]

Arguments

-config_file

Specifies the name of the existing configuration file which will be used to generate the Spirent HLTAPI script. The file must be in .xml or .tcc format. This argument is Mandatory .

-output

Specifies the path, name or both for the output Spirent HLTAPI script file. If not specified, the output file will use the same name and path as the configuration file.

-output_type

Specifies the language of the output HLTAPI script. Possible values are tcl, perl and python. The default value is tcl.

-test_config

Determines whether to include the sth::test_config function in the generated script. Possible values are 0 and 1. The default value is 0, which means sth::test_config will not be included in the generated script.

-test_control

Determines whether to include the sth::test_control function in the generated script. Possible values are 0 and 1. The default value is 0.

-test_run

Determines whether to include the control command, such as sth::emulation_*_control -start/-stop, in the generated script. Possible values are 0 and 1. The default value is 0.

-test_result

Determines whether to include the result function in the generated script. Possible values are 0 and 1. The default value is 0.

-pkt_capture

Determines whether to include packet capture related functions in the generated script. Possible values are 0 and 1. The default value is 0.

-device_info

Determines whether to include the sth::device_info function in the generated script. Possible values are 0 and 1. The default value is 0.

-default_value

Determines whether to only output arguments with no default values. Possible values are 0 and 1. If it is set to 1, Save as HLTAPI will only output arguments with no default values. Arguments with default values will not be included in the generated scripts. The default value is 1.

-scaling_test

Determines whether to enable the Scaling test mode for the test. For a Scaling test, multiple device blocks will be created with only one Spirent HLTAPI function calling. Possible values are 0 and 1. The default value is 0, which means that one Spirent HLTAPI function can only create one device at a time in the generated script. For more information on Scaling mode, please refer to Options for the Save as HLTAPI Wizard in Appendix A.

Return Values

None.

Description

The sth::hlapi_gen function provides the command line mode for the Save as HLTAPI function. Before you use this function, you either have a previously saved configuration file (.xml or .tcc), or configure a test in Spirent TestCenter and save the configurations on the spot.

The output Spirent HLTAPI script file (.tcl) will be in the same directory with the same name as the source configuration file.

For more information of the Save as HLTAPI function, refer to Chapter 3 Save as HLTAPI in the Spirent HLTAPI Programmer’s Reference.

Examples

Sample Input:

::sth::hlapi_gen\
      -config_file D:/HLTAPI/scriptGen/CR/hltgen_IGMP.xml \
       -output       igmp.tcl\
       -test_config    1\
       -test_control   1\
       -test_run       1\
       -test_result    1\
       -pkt_capture    0\
       -default_value  0\
       -device_info    1\
       -scaling_test   1