:orphan: .. index:: pair: group; TAPI to manage Cisco TRex .. _doxid-group__tapi__trex: TAPI to manage Cisco TRex ========================= .. toctree:: :hidden: enum_tapi_trex_iom.rst enum_tapi_trex_port_stat_enum.rst enum_tapi_trex_so.rst enum_tapi_trex_verbose.rst struct_tapi_trex_app.rst struct_tapi_trex_client_config.rst struct_tapi_trex_common_config.rst struct_tapi_trex_opt.rst struct_tapi_trex_per_port_stat.rst struct_tapi_trex_per_port_stat_flts.rst struct_tapi_trex_port_stat.rst struct_tapi_trex_port_stat_flt.rst struct_tapi_trex_report.rst struct_tapi_trex_server_config.rst Overview ~~~~~~~~ TAPI to manage *Cisco TRex*. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // typedefs typedef enum :ref:`tapi_trex_port_stat_enum` :ref:`tapi_trex_port_stat_enum`; typedef struct :ref:`tapi_trex_port_stat_flt` :ref:`tapi_trex_port_stat_flt`; typedef struct :ref:`tapi_trex_per_port_stat_flts` :ref:`tapi_trex_per_port_stat_flts`; typedef struct :ref:`tapi_trex_port_stat` :ref:`tapi_trex_port_stat`; typedef struct :ref:`tapi_trex_per_port_stat` :ref:`tapi_trex_per_port_stat`; typedef struct :ref:`tapi_trex_app` :ref:`tapi_trex_app`; typedef enum :ref:`tapi_trex_verbose` :ref:`tapi_trex_verbose_t`; typedef enum :ref:`tapi_trex_iom` :ref:`tapi_trex_iom_t`; typedef enum :ref:`tapi_trex_so` :ref:`tapi_trex_so_t`; typedef struct :ref:`tapi_trex_interface` :ref:`tapi_trex_interface`; typedef struct :ref:`tapi_trex_common_config` :ref:`tapi_trex_common_config`; typedef struct :ref:`tapi_trex_client_config` :ref:`tapi_trex_client_config`; typedef struct :ref:`tapi_trex_server_config` :ref:`tapi_trex_server_config`; typedef struct :ref:`tapi_trex_opt` :ref:`tapi_trex_opt`; typedef struct :ref:`tapi_trex_report` :ref:`tapi_trex_report`; // enums enum :ref:`tapi_trex_iom`; enum :ref:`tapi_trex_port_stat_enum`; enum :ref:`tapi_trex_so`; enum :ref:`tapi_trex_verbose`; // structs struct :ref:`tapi_trex_app`; struct :ref:`tapi_trex_client_config`; struct :ref:`tapi_trex_common_config`; struct :ref:`tapi_trex_opt`; struct :ref:`tapi_trex_per_port_stat`; struct :ref:`tapi_trex_per_port_stat_flts`; struct :ref:`tapi_trex_port_stat`; struct :ref:`tapi_trex_port_stat_flt`; struct :ref:`tapi_trex_report`; struct :ref:`tapi_trex_server_config`; // global variables const :ref:`tapi_trex_client_config` :ref:`tapi_trex_client_config_default`; const :ref:`tapi_trex_server_config` :ref:`tapi_trex_server_config_default`; const :ref:`tapi_trex_opt` :ref:`tapi_trex_default_opt`; // global functions :ref:`te_errno` :ref:`tapi_trex_create`(:ref:`tapi_job_factory_t`* factory, const :ref:`tapi_trex_opt`* opt, :ref:`tapi_trex_app`** app); :ref:`te_errno` :ref:`tapi_trex_start`(const :ref:`tapi_trex_app`* app); :ref:`te_errno` :ref:`tapi_trex_wait`(const :ref:`tapi_trex_app`* app, int timeout_ms); :ref:`te_errno` :ref:`tapi_trex_stop`(const :ref:`tapi_trex_app`* app); :ref:`te_errno` :ref:`tapi_trex_kill`(const :ref:`tapi_trex_app`* app, int signum); :ref:`te_errno` :ref:`tapi_trex_destroy`(const char* ta, :ref:`tapi_trex_app`* app, :ref:`tapi_trex_opt`* opt); :ref:`te_errno` :ref:`tapi_trex_get_report`(:ref:`tapi_trex_app`* app, :ref:`tapi_trex_report`* report); :ref:`te_errno` :ref:`tapi_trex_report_mi_log`(const :ref:`tapi_trex_report`* report); :ref:`te_errno` :ref:`tapi_trex_destroy_report`(:ref:`tapi_trex_report`* report); void :ref:`tapi_trex_port_stat_param_series_get`(:ref:`tapi_trex_report`* report, :ref:`tapi_trex_port_stat_enum` param, unsigned int index, bool absolute_value, bool by_time, double** vals, unsigned int* n_vals); static void :ref:`tapi_trex_port_stat_time_series_get`(:ref:`tapi_trex_report`* report, double** vals, unsigned int* n_vals); static void :ref:`tapi_trex_port_stat_param_series_by_time_get`(:ref:`tapi_trex_report`* report, :ref:`tapi_trex_port_stat_enum` param, unsigned int index, double** vals, unsigned int* n_vals); :ref:`te_errno` :ref:`tapi_trex_port_stat_data_get`(:ref:`tapi_trex_report`* report, :ref:`tapi_trex_port_stat_enum` param, unsigned int index, double time_start, double time_end, double* min, double* avg, double* median, double* max); :ref:`tapi_trex_interface`* :ref:`tapi_trex_interface_init_oid`(bool use_kernel_interface, const char* oid_fmt, ...); void :ref:`tapi_trex_interface_free`(:ref:`tapi_trex_interface`* interface); // macros #define :ref:`TAPI_TREX_CLIENT`(...) #define :ref:`TAPI_TREX_CLIENTS`(...) #define :ref:`TAPI_TREX_DEFAULT_CLIENT_HTTP_PAYLOAD` #define :ref:`TAPI_TREX_DEFAULT_SERVER_HTTP_PAYLOAD` #define :ref:`TAPI_TREX_LINUX_IFACE`(ta_, iface_) #define :ref:`TAPI_TREX_PCI_BY_BDF`(ta_, addr_) #define :ref:`TAPI_TREX_PCI_BY_IFACE`(ta_, iface_) #define :ref:`TAPI_TREX_SERVER`(...) #define :ref:`TAPI_TREX_SERVERS`(...) .. _details-group__tapi__trex: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ TAPI to manage *Cisco TRex*. Typedefs -------- .. index:: pair: typedef; tapi_trex_port_stat_enum .. _doxid-group__tapi__trex_1gae8697f357892cc90f995a8eed9fd969b: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef enum :ref:`tapi_trex_port_stat_enum` tapi_trex_port_stat_enum List of parameters in per port statistics. .. index:: pair: typedef; tapi_trex_port_stat_flt .. _doxid-group__tapi__trex_1ga9fd55228b361a8a0c6f24cd8a709254d: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_trex_port_stat_flt` tapi_trex_port_stat_flt TRex port stat filter. .. index:: pair: typedef; tapi_trex_per_port_stat_flts .. _doxid-group__tapi__trex_1gaf8c1a690da938ab05a0b805955915bcd: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_trex_per_port_stat_flts` tapi_trex_per_port_stat_flts TRex per port stat filters. .. index:: pair: typedef; tapi_trex_port_stat .. _doxid-group__tapi__trex_1ga0aaf3bc4925a6b56d31a9a6609ec6bf9: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_trex_port_stat` tapi_trex_port_stat TRex statistics for a single port. .. index:: pair: typedef; tapi_trex_per_port_stat .. _doxid-group__tapi__trex_1gabd537de2cf9a9dbb6c0362d30b21379e: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_trex_per_port_stat` tapi_trex_per_port_stat TRex per-port statistics. .. index:: pair: typedef; tapi_trex_app .. _doxid-group__tapi__trex_1ga036bd9e7eb85cd1fe255859b4db62ccf: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_trex_app` tapi_trex_app TRex tool information. .. index:: pair: typedef; tapi_trex_verbose_t .. _doxid-group__tapi__trex_1ga9865dca389a795841dd063597c2ff346: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef enum :ref:`tapi_trex_verbose` tapi_trex_verbose_t Representation of possible values for :ref:`tapi_trex_opt::verbose ` option. .. index:: pair: typedef; tapi_trex_iom_t .. _doxid-group__tapi__trex_1gaee6942210a6ded12eccf38e9ab4ab29e: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef enum :ref:`tapi_trex_iom` tapi_trex_iom_t Representation of possible values for :ref:`tapi_trex_opt::iom ` option. .. index:: pair: typedef; tapi_trex_so_t .. _doxid-group__tapi__trex_1ga62f0ec3fe19f9c6d3a52ba5cba43caa5: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef enum :ref:`tapi_trex_so` tapi_trex_so_t Representation of possible values for :ref:`tapi_trex_opt ` ::\*-so options. .. index:: pair: typedef; tapi_trex_interface .. _doxid-group__tapi__trex_1gabe9fa902f8b59968437937af90ba7450: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_trex_interface` tapi_trex_interface TRex interface description. .. index:: pair: typedef; tapi_trex_common_config .. _doxid-group__tapi__trex_1ga44d871547c19fb73918b347ac4e3aec3: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_trex_common_config` tapi_trex_common_config Common TRex client/server options. .. index:: pair: typedef; tapi_trex_client_config .. _doxid-group__tapi__trex_1ga2a2aa85325f7ce51ff04aa856aee701d: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_trex_client_config` tapi_trex_client_config Specific TRex client options. .. index:: pair: typedef; tapi_trex_server_config .. _doxid-group__tapi__trex_1ga7e3d2fbc9703e3d5cb7f382e0ef11f5d: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_trex_server_config` tapi_trex_server_config Specific TRex server options. .. index:: pair: typedef; tapi_trex_opt .. _doxid-group__tapi__trex_1ga9f27bf35322384c615f0384332a69795: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_trex_opt` tapi_trex_opt Specific TRex options. Before starting tapi_trex it is necessary to initialize its options ``:ref:`tapi_trex_opt ``` and call :ref:`tapi_trex_create() ` to create configuration files and properly bind PCI functions (if DPDK is used). Base ``:ref:`tapi_trex_opt ``` example: .. ref-code-block:: cpp :ref:`tapi_trex_opt ` trex_opt = :ref:`tapi_trex_default_opt `; trex_opt.:ref:`astf_template ` = getenv("TE_TREX_ASTF_TEMPLATE"); trex_opt.:ref:`trex_exec ` = getenv("TE_TREX_EXEC"); trex_opt.:ref:`force_close_at_end ` = true; trex_opt.:ref:`no_monitors ` = true; trex_opt.:ref:`lro_disable ` = true; // Setup servers trex_opt.:ref:`servers ` = :ref:`TAPI_TREX_SERVERS `( :ref:`TAPI_TREX_SERVER `( .common.interface = :ref:`TAPI_TREX_PCI_BY_IFACE `("Agt_A", "eth0"), .common.ip = agtA_addr, .common.gw = agtB_addr, .common.ip_range_beg = agtA_addr, .common.ip_range_end = agtA_addr, .common.payload = "HTTP/1.1 200 OK\r\n" "Content-Type: text/html\r\nConnection: keep-alive\r\n" "Content-Length: 18\r\n\r\nHello" )); // Setup clients trex_opt.:ref:`clients ` = ...; .. index:: pair: typedef; tapi_trex_report .. _doxid-group__tapi__trex_1ga54a57c9fd8e1427496a41a9bea3a74cd: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`tapi_trex_report` tapi_trex_report TRex information from the stdout. Global Variables ---------------- .. index:: pair: variable; tapi_trex_client_config_default .. _doxid-group__tapi__trex_1gafea636af645fb3f4f6bfebe417f80697: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`tapi_trex_client_config` tapi_trex_client_config_default Default TRex client options initializer. .. index:: pair: variable; tapi_trex_server_config_default .. _doxid-group__tapi__trex_1ga48ed3269e782c5c48784b2b2be9510ec: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`tapi_trex_server_config` tapi_trex_server_config_default Default TRex server options initializer. .. index:: pair: variable; tapi_trex_default_opt .. _doxid-group__tapi__trex_1gab9472745ea02bde17db3d87282afc17a: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`tapi_trex_opt` tapi_trex_default_opt Default TRex options initializer. Global Functions ---------------- .. index:: pair: function; tapi_trex_create .. _doxid-group__tapi__trex_1gaee98b0df07576d461ae7973140d694af: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_trex_create(:ref:`tapi_job_factory_t`* factory, const :ref:`tapi_trex_opt`* opt, :ref:`tapi_trex_app`** app) Create TRex app. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - factory - Job factory. * - opt - TRex options. * - app - TRex app handle. .. rubric:: Returns: Status code. .. index:: pair: function; tapi_trex_start .. _doxid-group__tapi__trex_1gab9cef4b69f70ed72895f53450f566b6a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_trex_start(const :ref:`tapi_trex_app`* app) Start TRex. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - app - TRex app handle. .. rubric:: Returns: Status code. .. index:: pair: function; tapi_trex_wait .. _doxid-group__tapi__trex_1ga22fd62b939196fb2116590a8fa1aec9f: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_trex_wait(const :ref:`tapi_trex_app`* app, int timeout_ms) Wait for TRex completion. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - app - TRex app handle. * - timeout_ms - Wait timeout in milliseconds. .. rubric:: Returns: Status code. .. index:: pair: function; tapi_trex_stop .. _doxid-group__tapi__trex_1ga989910070d0cfacb4dd471ecd97668fb: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_trex_stop(const :ref:`tapi_trex_app`* app) Stop TRex. It can be started over with :ref:`tapi_trex_start() `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - app - TRex app handle. .. rubric:: Returns: Status code. .. index:: pair: function; tapi_trex_kill .. _doxid-group__tapi__trex_1gabcd9d31f46dad6aafbc6aec45bc47319: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_trex_kill(const :ref:`tapi_trex_app`* app, int signum) Send a signal to TRex. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - app - TRex app handle. * - signum - Signal to send. .. rubric:: Returns: Status code. .. index:: pair: function; tapi_trex_destroy .. _doxid-group__tapi__trex_1ga5c265972f64cf550dcbbb1e365786c54: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_trex_destroy(const char* ta, :ref:`tapi_trex_app`* app, :ref:`tapi_trex_opt`* opt) Destroy TRex. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ta - TRex Test Agent name. * - app - TRex app handle. * - opt - TRex options. .. rubric:: Returns: Status code. .. index:: pair: function; tapi_trex_get_report .. _doxid-group__tapi__trex_1ga415268e10d248b72dbadb5dc622db632: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_trex_get_report(:ref:`tapi_trex_app`* app, :ref:`tapi_trex_report`* report) Get TRex report. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - app - TRex app handle. * - report - TRex statistics report. .. rubric:: Returns: Status code. .. index:: pair: function; tapi_trex_report_mi_log .. _doxid-group__tapi__trex_1gae8dc8c043a540d6e05c024e16e6372d2: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_trex_report_mi_log(const :ref:`tapi_trex_report`* report) Add TRex report to MI logger. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - report - TRex statistics report. .. rubric:: Returns: Status code. .. index:: pair: function; tapi_trex_destroy_report .. _doxid-group__tapi__trex_1ga1a5d0869941c490ee1ef91b54d14b06a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_trex_destroy_report(:ref:`tapi_trex_report`* report) Destroy TRex report to MI logger and freed memory. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - report - TRex statistics report. .. rubric:: Returns: Status code. .. index:: pair: function; tapi_trex_port_stat_param_series_get .. _doxid-group__tapi__trex_1ga3d8b6ec1aac879d2f09de76f6e1e47f4: .. ref-code-block:: cpp :class: doxyrest-title-code-block void tapi_trex_port_stat_param_series_get(:ref:`tapi_trex_report`* report, :ref:`tapi_trex_port_stat_enum` param, unsigned int index, bool absolute_value, bool by_time, double** vals, unsigned int* n_vals) Get all the values of a given parameter from the per port statistics. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - report - TRex report. * - param - Type of param. * - index - Port index. * - absolute_value - If ``true`` - return parameter value, otherwise, return the differences in the values of each pair of consecutive parameters. * - by_time - If ``true`` - the parameter value will be divided by the time interval between the current and previous parameter * - vals - Array of values. * - n_vals - Number of values. .. index:: pair: function; tapi_trex_port_stat_time_series_get .. _doxid-group__tapi__trex_1gaf9c448c0e18169cad02f1d05e8a37bc1: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void tapi_trex_port_stat_time_series_get(:ref:`tapi_trex_report`* report, double** vals, unsigned int* n_vals) Get time series from the per port statistics. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - report - TRex report. * - vals - Array of values. * - n_vals - Number of values. .. index:: pair: function; tapi_trex_port_stat_param_series_by_time_get .. _doxid-group__tapi__trex_1gaae7ab2c680eaec54867e59d1f4cecd3d: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void tapi_trex_port_stat_param_series_by_time_get(:ref:`tapi_trex_report`* report, :ref:`tapi_trex_port_stat_enum` param, unsigned int index, double** vals, unsigned int* n_vals) Get the value of the port statistics parameter change for each time interval. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - report - TRex report. * - param - Type of param. * - index - Port index. * - vals - Array of values. * - n_vals - Number of values. .. index:: pair: function; tapi_trex_port_stat_data_get .. _doxid-group__tapi__trex_1ga9ce1237f8e0365ed651615dca9d42a87: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`te_errno` tapi_trex_port_stat_data_get(:ref:`tapi_trex_report`* report, :ref:`tapi_trex_port_stat_enum` param, unsigned int index, double time_start, double time_end, double* min, double* avg, double* median, double* max) Get the statisctical data for a given parameter from the per-port statistics. c 0 The result is successful. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - report - TRex report. * - param - Type of param. * - index - Port index. * - time_start - Use values starting from the specified time (in seconds). * - time_end - Use values up to the specified time (in seconds). * - min - Minimal value (may be ``NULL``). * - avg - Average value (may be ``NULL``). * - median - Median value (may be ``NULL``). * - max - Maximum value (may be ``NULL``). * - TE_ENODATA - Per-port statistics do not contain data. * - TE_ERANGE - .. rubric:: Returns: Status code. .. index:: pair: function; tapi_trex_interface_init_oid .. _doxid-group__tapi__trex_1gac38c536c1c8b7ac31e9f39bb5072f056: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`tapi_trex_interface`* tapi_trex_interface_init_oid(bool use_kernel_interface, const char* oid_fmt, ...) Create ``tapi_trex_interface`` with PCI address (e.g. ``"0000:00:04.0"``). .. ref-code-block:: cpp :ref:`tapi_trex_interface ` *iface = :ref:`tapi_trex_interface_init_oid `( false, "/agent:%s/interface:%s", "Agt_A", "eth0"); ... tapi_trex_interface_free(iface); Function result should be :ref:`tapi_trex_interface_free() ` 'd. If ``use_kernel_interface`` is ``true``, then only ``'/agent/interface'`` OIDs are supported and the name of the interface is used. If ``use_kernel_interface`` is ``false``, then OIDs are resolved to a PCI address. OID can be one the following: * ``'/agent/hardware/pci/vendor/device/instance'`` * ``'/agent/hardware/pci/device'`` * ``'/agent/interface'`` .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - use_kernel_interface - Use kernel or DPDK interface. * - oid_fmt - OID format string. * - ... - Arguments for the format string. .. rubric:: Returns: Allocated ``tapi_trex_interface`` structure. .. index:: pair: function; tapi_trex_interface_free .. _doxid-group__tapi__trex_1gad2eef941a0053a4c856456e5fb8b92ee: .. ref-code-block:: cpp :class: doxyrest-title-code-block void tapi_trex_interface_free(:ref:`tapi_trex_interface`* interface) Free allocated ``tapi_trex_interface``. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - interface - TAPI TRex interface. Macros ------ .. index:: pair: define; TAPI_TREX_CLIENT .. _doxid-group__tapi__trex_1ga671b74792575fb09029e52c89cc26aeb: .. ref-code-block:: cpp :class: doxyrest-title-code-block #define TAPI_TREX_CLIENT(...) Convenience TRex client constructor. .. rubric:: See also: :ref:`TAPI_TREX_CLIENTS ` .. index:: pair: define; TAPI_TREX_CLIENTS .. _doxid-group__tapi__trex_1ga7168dcc77c911b336ad10c3ca4dd3b42: .. ref-code-block:: cpp :class: doxyrest-title-code-block #define TAPI_TREX_CLIENTS(...) Convenience TRex clients vector constructor. .. ref-code-block:: cpp :ref:`tapi_trex_opt ` trex_opt; trex_opt.:ref:`clients ` = :ref:`TAPI_TREX_CLIENTS `( :ref:`TAPI_TREX_CLIENT `( .common.interface = :ref:`TAPI_TREX_PCI_BY_IFACE `("Agt_A", "eth0"), .common.port = 80, .common.payload = "GET /3384 HTTP/1.1\r\nHo" )); .. index:: pair: define; TAPI_TREX_DEFAULT_CLIENT_HTTP_PAYLOAD .. _doxid-group__tapi__trex_1ga936a6a17dd4f5ffe6867642ab447fc3d: .. ref-code-block:: cpp :class: doxyrest-title-code-block #define TAPI_TREX_DEFAULT_CLIENT_HTTP_PAYLOAD TRex default client payload. .. index:: pair: define; TAPI_TREX_DEFAULT_SERVER_HTTP_PAYLOAD .. _doxid-group__tapi__trex_1gab54d1475ba024012b7487914a79475a0: .. ref-code-block:: cpp :class: doxyrest-title-code-block #define TAPI_TREX_DEFAULT_SERVER_HTTP_PAYLOAD TRex default server payload. .. index:: pair: define; TAPI_TREX_LINUX_IFACE .. _doxid-group__tapi__trex_1ga9ac9cbe6206b10afd2f008b9d03af136: .. ref-code-block:: cpp :class: doxyrest-title-code-block #define TAPI_TREX_LINUX_IFACE(ta_, iface_) Set linux interface for TRex without binding. .. ref-code-block:: cpp :ref:`tapi_trex_opt ` trex_opt; trex_opt.:ref:`servers ` = :ref:`TAPI_TREX_SERVERS `( :ref:`TAPI_TREX_SERVER `( .common.interface = :ref:`TAPI_TREX_LINUX_IFACE `("Agt_A", "eth0"), ... )); .. index:: pair: define; TAPI_TREX_PCI_BY_BDF .. _doxid-group__tapi__trex_1gaf6d4ac1868c10ba7a15fca31a3067ad1: .. ref-code-block:: cpp :class: doxyrest-title-code-block #define TAPI_TREX_PCI_BY_BDF(ta_, addr_) Set the PCI address interface for TRex with binding. .. ref-code-block:: cpp :ref:`tapi_trex_opt ` trex_opt; trex_opt.:ref:`clients ` = :ref:`TAPI_TREX_CLIENTS `( :ref:`TAPI_TREX_CLIENT `( .common.interface = :ref:`TAPI_TREX_PCI_BY_BDF `("Agt_A", "0000:00:04.0"), ... )); .. index:: pair: define; TAPI_TREX_PCI_BY_IFACE .. _doxid-group__tapi__trex_1gaa451198d8ebe96a2d68ebcf8fa72c5a7: .. ref-code-block:: cpp :class: doxyrest-title-code-block #define TAPI_TREX_PCI_BY_IFACE(ta_, iface_) Set linux interface for TRex with binding. .. ref-code-block:: cpp :ref:`tapi_trex_opt ` trex_opt; trex_opt.:ref:`clients ` = :ref:`TAPI_TREX_CLIENTS `( :ref:`TAPI_TREX_CLIENT `( .common.interface = :ref:`TAPI_TREX_PCI_BY_IFACE `("Agt_A", "eth0"), ... )); .. index:: pair: define; TAPI_TREX_SERVER .. _doxid-group__tapi__trex_1ga77264926636621447d4ea480e7e95145: .. ref-code-block:: cpp :class: doxyrest-title-code-block #define TAPI_TREX_SERVER(...) Convenience TRex server constructor. .. rubric:: See also: :ref:`TAPI_TREX_SERVERS ` .. index:: pair: define; TAPI_TREX_SERVERS .. _doxid-group__tapi__trex_1ga9830b1dfd263a7a3f892a27f83bfa278: .. ref-code-block:: cpp :class: doxyrest-title-code-block #define TAPI_TREX_SERVERS(...) Convenience TRex servers vector constructor. .. ref-code-block:: cpp :ref:`tapi_trex_opt ` trex_opt; trex_opt.:ref:`servers ` = :ref:`TAPI_TREX_SERVERS `( :ref:`TAPI_TREX_SERVER `( .common.interface = :ref:`TAPI_TREX_PCI_BY_IFACE `("Agt_A", "eth0"), .common.payload = "HTTP/1.1 200 OK\r\n" "Content-Type: text/html\r\nConnection: keep-alive\r\n" "Content-Length: 18\r\n\r\nHello" ));