tool functions TAPI

Overview

TAPI to handle netperf tool. More…

// typedefs

typedef enum tapi_netperf_test_name tapi_netperf_test_name;
typedef enum tapi_netperf_test_type tapi_netperf_test_type;
typedef struct tapi_netperf_test_opt tapi_netperf_test_opt;
typedef struct tapi_netperf_opt tapi_netperf_opt;
typedef struct tapi_netperf_report tapi_netperf_report;
typedef struct tapi_netperf_app_server_t tapi_netperf_app_server_t;
typedef struct tapi_netperf_app_client_t tapi_netperf_app_client_t;

// enums

enum tapi_netperf_test_name;
enum tapi_netperf_test_type;

// structs

struct tapi_netperf_opt;
struct tapi_netperf_report;
struct tapi_netperf_test_opt;

// global variables

const tapi_netperf_opt tapi_netperf_default_opt;

// global functions

te_errno tapi_netperf_create_client(tapi_job_factory_t* factory, const tapi_netperf_opt* opt, tapi_netperf_app_client_t** app);
te_errno tapi_netperf_create_server(tapi_job_factory_t* factory, const tapi_netperf_opt* opt, tapi_netperf_app_server_t** app_server);
te_errno tapi_netperf_create(tapi_job_factory_t* client_factory, tapi_job_factory_t* server_factory, const tapi_netperf_opt* opt, tapi_netperf_app_client_t** client, tapi_netperf_app_server_t** server);
te_errno tapi_netperf_start_client(tapi_netperf_app_client_t* app);
te_errno tapi_netperf_start_server(tapi_netperf_app_server_t* app);
te_errno tapi_netperf_start(tapi_netperf_app_client_t* client, tapi_netperf_app_server_t* server);
te_errno tapi_netperf_wait_client(tapi_netperf_app_client_t* app, int timeout_ms);
te_errno tapi_netperf_wait_server(tapi_netperf_app_server_t* app, int timeout_ms);
te_errno tapi_netperf_get_report(tapi_netperf_app_client_t* app, tapi_netperf_report* report);
te_errno tapi_netperf_kill_client(tapi_netperf_app_client_t* app, int signo);
te_errno tapi_netperf_kill_server(tapi_netperf_app_server_t* app, int signo);
te_errno tapi_netperf_kill(tapi_netperf_app_client_t* client, tapi_netperf_app_server_t* server, int signo);
te_errno tapi_netperf_destroy_client(tapi_netperf_app_client_t* app);
te_errno tapi_netperf_destroy_server(tapi_netperf_app_server_t* app);
te_errno tapi_netperf_mi_report(const tapi_netperf_report* report);
te_errno tapi_netperf_client_wrapper_add(tapi_netperf_app_client_t* app, const char* tool, const char** argv, tapi_job_wrapper_priority_t priority, tapi_job_wrapper_t** wrap);
te_errno tapi_netperf_client_add_sched_param(tapi_netperf_app_client_t* app, tapi_job_sched_param* sched_param);

Detailed Documentation

TAPI to handle netperf tool.

Copyright (C) 2019-2022 OKTET Labs Ltd. All rights reserved.

Typedefs

typedef enum tapi_netperf_test_name tapi_netperf_test_name

Test name. It corresponds to “-t” option of 2.7.0 netperf version.

typedef struct tapi_netperf_test_opt tapi_netperf_test_opt

Test specific command line options.

typedef struct tapi_netperf_opt tapi_netperf_opt

Command line options.

typedef struct tapi_netperf_report tapi_netperf_report

Netperf report.

typedef struct tapi_netperf_app_server_t tapi_netperf_app_server_t

Netserver tool context

typedef struct tapi_netperf_app_client_t tapi_netperf_app_client_t

Netperf tool context.

Global Variables

const tapi_netperf_opt tapi_netperf_default_opt

Default options initializer

Global Functions

te_errno tapi_netperf_create_client(tapi_job_factory_t* factory, const tapi_netperf_opt* opt, tapi_netperf_app_client_t** app)

Create netperf app for netperf. All needed information to run netperf is in opt.

Parameters:

factory

Job factory.

opt

Command line options.

app

netperf app handle.

Returns:

Status code.

te_errno tapi_netperf_create_server(tapi_job_factory_t* factory, const tapi_netperf_opt* opt, tapi_netperf_app_server_t** app_server)

Create netserver app for netperf. All needed information to run netserver is in opt.

Parameters:

factory

Job factory.

opt

Command line options.

app_server

netserver app handle.

Returns:

Status code.

te_errno tapi_netperf_create(tapi_job_factory_t* client_factory, tapi_job_factory_t* server_factory, const tapi_netperf_opt* opt, tapi_netperf_app_client_t** client, tapi_netperf_app_server_t** server)

Create netserver and netperf app.

Parameters:

client_factory

Client job factory.

server_factory

Server job factory.

opt

Command line options.

client

netperf app handle.

server

netserver app handle.

Returns:

Status code.

te_errno tapi_netperf_start_client(tapi_netperf_app_client_t* app)

Start netperf.

Parameters:

app

netperf app handle.

Returns:

Status code.

te_errno tapi_netperf_start_server(tapi_netperf_app_server_t* app)

Start netserver.

Parameters:

app

netserver app handle.

Returns:

Status code.

te_errno tapi_netperf_start(tapi_netperf_app_client_t* client, tapi_netperf_app_server_t* server)

Start netperf and netserver.

Parameters:

client

netperf app handle.

server

netserver app handle.

Returns:

Status code.

te_errno tapi_netperf_wait_client(tapi_netperf_app_client_t* app, int timeout_ms)

Wait for netperf completion.

Parameters:

app

netperf app handle.

timeout_ms

Wait timeout in milliseconds. (negative means tapi_job_get_timeout())

Returns:

Status code.

te_errno tapi_netperf_wait_server(tapi_netperf_app_server_t* app, int timeout_ms)

Wait for netserver completion.

Parameters:

app

netserver app handle.

timeout_ms

Wait timeout in milliseconds. (negative means tapi_job_get_timeout())

Returns:

Status code.

te_errno tapi_netperf_get_report(tapi_netperf_app_client_t* app, tapi_netperf_report* report)

Get netperf report.

Parameters:

app

netperf app handle.

report

netperf statistics report.

Returns:

Status code.

te_errno tapi_netperf_kill_client(tapi_netperf_app_client_t* app, int signo)

Send a signal to netperf.

Parameters:

app

netperf app handle.

signo

Signal to send to netperf.

Returns:

Status code.

te_errno tapi_netperf_kill_server(tapi_netperf_app_server_t* app, int signo)

Send a signal to netserver.

Parameters:

app

netserver app handle.

signo

Signal to send to netperf.

Returns:

Status code.

te_errno tapi_netperf_kill(tapi_netperf_app_client_t* client, tapi_netperf_app_server_t* server, int signo)

Send a signal to netperf and netserver.

Parameters:

client

netperf app hande.

server

netserver app handle.

signo

Signal to send to netperf.

Returns:

Status code.

te_errno tapi_netperf_destroy_client(tapi_netperf_app_client_t* app)

Destroy netperf app.

Parameters:

app

netperf app handle.

Returns:

Status code.

te_errno tapi_netperf_destroy_server(tapi_netperf_app_server_t* app)

Destroy netserver app.

Parameters:

app

netserver app handle.

Returns:

Status code.

te_errno tapi_netperf_mi_report(const tapi_netperf_report* report)

Output netperf report via MI logger.

Parameters:

report

netperf report.

Returns:

Status code.

te_errno tapi_netperf_client_wrapper_add(tapi_netperf_app_client_t* app, const char* tool, const char** argv, tapi_job_wrapper_priority_t priority, tapi_job_wrapper_t** wrap)

Add a wrapper tool/script to netperf

Parameters:

app

netperf app handle.

tool

Path to the wrapper tool.

argv

Wrapper arguments (last item should be NULL)

priority

Wrapper priority.

wrap

Wrapper instance handle

Returns:

Status code.

te_errno tapi_netperf_client_add_sched_param(tapi_netperf_app_client_t* app, tapi_job_sched_param* sched_param)

Add a scheduling parameters to netperf

Parameters:

app

netperf app handle.

sched_param

Array of scheduling parameters. The last element must have the type TAPI_JOB_SCHED_END and data pointer to NULL.

Returns:

Status code