Network Emulator configuration

Overview

Copyright (C) 2004-2022 OKTET Labs Ltd. More…

// global functions

te_errno tapi_cfg_netem_get_param(const char* ta, const char* if_name, const char* param, char** value);
te_errno tapi_cfg_netem_set_param(const char* ta, const char* if_name, const char* param, const char* value);
te_errno tapi_cfg_netem_set_delay(const char* ta, const char* if_name, uint32_t delay_us);
te_errno tapi_cfg_netem_get_delay(const char* ta, const char* if_name, uint32_t* delay_us);
te_errno tapi_cfg_netem_set_jitter(const char* ta, const char* if_name, uint32_t jitter_us);
te_errno tapi_cfg_netem_get_jitter(const char* ta, const char* if_name, uint32_t* jitter_us);
te_errno tapi_cfg_netem_set_delay_correlation(const char* ta, const char* if_name, double delay_correlation);
te_errno tapi_cfg_netem_get_delay_correlation(const char* ta, const char* if_name, double* delay_correlation);
te_errno tapi_cfg_netem_set_loss(const char* ta, const char* if_name, double loss);
te_errno tapi_cfg_netem_get_loss(const char* ta, const char* if_name, double* loss);
te_errno tapi_cfg_netem_set_loss_correlation(const char* ta, const char* if_name, double loss_correlation);
te_errno tapi_cfg_netem_get_loss_correlation(const char* ta, const char* if_name, double* loss_correlation);
te_errno tapi_cfg_netem_set_duplicate(const char* ta, const char* if_name, double duplicate);
te_errno tapi_cfg_netem_get_duplicate(const char* ta, const char* if_name, double* duplicate);
te_errno tapi_cfg_netem_set_duplicate_correlation(const char* ta, const char* if_name, double duplicate_correlation);
te_errno tapi_cfg_netem_get_duplicate_correclation(const char* ta, const char* if_name, double* duplicate_correlation);
te_errno tapi_cfg_netem_set_limit(const char* ta, const char* if_name, uint32_t limit);
te_errno tapi_cfg_netem_get_limit(const char* ta, const char* if_name, uint32_t* limit);
te_errno tapi_cfg_netem_set_gap(const char* ta, const char* if_name, uint32_t gap);
te_errno tapi_cfg_netem_get_gap(const char* ta, const char* if_name, uint32_t* gap);
te_errno tapi_cfg_netem_set_reorder_probability(const char* ta, const char* if_name, double reorder_probability);
te_errno tapi_cfg_netem_get_reorder_probability(const char* ta, const char* if_name, double* reorder_probability);
te_errno tapi_cfg_netem_set_reorder_correlation(const char* ta, const char* if_name, double reorder_correlation);
te_errno tapi_cfg_netem_get_reorder_correlation(const char* ta, const char* if_name, double* reorder_correlation);
te_errno tapi_cfg_netem_set_corruption_probability(const char* ta, const char* if_name, double corruption_probability);
te_errno tapi_cfg_netem_get_corruption_probability(const char* ta, const char* if_name, double* corruption_probability);
te_errno tapi_cfg_netem_set_corruption_correlation(const char* ta, const char* if_name, double corruption_correlation);
te_errno tapi_cfg_netem_get_corruption_correlation(const char* ta, const char* if_name, double* corruption_correlation);

// macros

#define TAPI_CFG_NETEM_MAX_PARAM_LEN

Detailed Documentation

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

Global Functions

te_errno tapi_cfg_netem_get_param(const char* ta, const char* if_name, const char* param, char** value)

Get value of NetEm parameter as string value should be free() after use

Parameters:

ta

Test Agent

if_name

Interface name

param

NetEm parameter name

value

Parameter value

Returns:

Status code

te_errno tapi_cfg_netem_set_param(const char* ta, const char* if_name, const char* param, const char* value)

Set value of NetEm parameter as string

Parameters:

ta

Test Agent

if_name

Interface name

param

NetEm parameter name

value

Parameter value

Returns:

Status code

te_errno tapi_cfg_netem_set_delay(const char* ta, const char* if_name, uint32_t delay_us)

Set packet delay on interface

Parameters:

ta

Test Agent

if_name

Interface name

delay_us

Delay value in usec

Returns:

Status code

te_errno tapi_cfg_netem_get_delay(const char* ta, const char* if_name, uint32_t* delay_us)

Get packet delay on interface

Parameters:

ta

Test Agent

if_name

Interface name

delay_us

Delay value in usec

Returns:

Status code

te_errno tapi_cfg_netem_set_jitter(const char* ta, const char* if_name, uint32_t jitter_us)

Set packet jitter on interface

Parameters:

ta

Test Agent

if_name

Interface name

jitter_us

Jitter value in usec

Returns:

Status code

te_errno tapi_cfg_netem_get_jitter(const char* ta, const char* if_name, uint32_t* jitter_us)

Get packet jitter on interface

Parameters:

ta

Test Agent

if_name

Interface name

jitter_us

Jitter value in usec

Returns:

Status code

te_errno tapi_cfg_netem_set_delay_correlation(const char* ta, const char* if_name, double delay_correlation)

Set packet delay correlation on interface

Parameters:

ta

Test Agent

if_name

Interface name

delay_correlation

Delay correlation value [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_get_delay_correlation(const char* ta, const char* if_name, double* delay_correlation)

Get packet delay correlation on interface

Parameters:

ta

Test Agent

if_name

Interface name

delay_correlation

Delay correlation value [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_set_loss(const char* ta, const char* if_name, double loss)

Set packet loss on interface

Parameters:

ta

Test Agent

if_name

Interface name

loss

Loss probability [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_get_loss(const char* ta, const char* if_name, double* loss)

Get packet loss on interface

Parameters:

ta

Test Agent

if_name

Interface name

loss

Loss probability [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_set_loss_correlation(const char* ta, const char* if_name, double loss_correlation)

Set packet loss correlation on interface

Parameters:

ta

Test Agent

if_name

Interface name

loss_correlation

Loss correlation [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_get_loss_correlation(const char* ta, const char* if_name, double* loss_correlation)

Get packet loss correlation on interface

Parameters:

ta

Test Agent

if_name

Interface name

loss_correlation

Loss correlation [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_set_duplicate(const char* ta, const char* if_name, double duplicate)

Set packet duplicate on interface

Parameters:

ta

Test Agent

if_name

Interface name

duplicate

Duplicate probability [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_get_duplicate(const char* ta, const char* if_name, double* duplicate)

Get packet duplicate on interface

Parameters:

ta

Test Agent

if_name

Interface name

duplicate

Duplicate probability [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_set_duplicate_correlation(const char* ta, const char* if_name, double duplicate_correlation)

Set packet duplicate correlation on interface

Parameters:

ta

Test Agent

if_name

Interface name

duplicate_correlation

Duplicate correlation [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_get_duplicate_correclation(const char* ta, const char* if_name, double* duplicate_correlation)

Get packet duplicate correlation on interface

Parameters:

ta

Test Agent

if_name

Interface name

duplicate_correlation

Duplicate correlation [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_set_limit(const char* ta, const char* if_name, uint32_t limit)

Set packet limit on interface

Parameters:

ta

Test Agent

if_name

Interface name

limit

Limit value

Returns:

Status code

te_errno tapi_cfg_netem_get_limit(const char* ta, const char* if_name, uint32_t* limit)

Get packet limit on interface

Parameters:

ta

Test Agent

if_name

Interface name

limit

Limit value

Returns:

Status code

te_errno tapi_cfg_netem_set_gap(const char* ta, const char* if_name, uint32_t gap)

Set packet gap on interface

Parameters:

ta

Test Agent

if_name

Interface name

gap

Gap value

Returns:

Status code

te_errno tapi_cfg_netem_get_gap(const char* ta, const char* if_name, uint32_t* gap)

Get packet gap on interface

Parameters:

ta

Test Agent

if_name

Interface name

gap

Gap value

Returns:

Status code

te_errno tapi_cfg_netem_set_reorder_probability(const char* ta, const char* if_name, double reorder_probability)

Set packet reorder on interface

Parameters:

ta

Test Agent

if_name

Interface name

reorder_probability

Reorder probability value [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_get_reorder_probability(const char* ta, const char* if_name, double* reorder_probability)

Get packet reorder on interface

Parameters:

ta

Test Agent

if_name

Interface name

reorder_probability

Reorder probability value [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_set_reorder_correlation(const char* ta, const char* if_name, double reorder_correlation)

Set packet reorder correlation on interface

Parameters:

ta

Test Agent

if_name

Interface name

reorder_correlation

Reorder correlation value [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_get_reorder_correlation(const char* ta, const char* if_name, double* reorder_correlation)

Get packet reorder correlation on interface

Parameters:

ta

Test Agent

if_name

Interface name

reorder_correlation

Reorder probability value [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_set_corruption_probability(const char* ta, const char* if_name, double corruption_probability)

Set packet corruption probability on interface

Parameters:

ta

Test Agent

if_name

Interface name

corruption_probability

Corruption probability value [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_get_corruption_probability(const char* ta, const char* if_name, double* corruption_probability)

Get packet corruption probability on interface

Parameters:

ta

Test Agent

if_name

Interface name

corruption_probability

Corruption probability value [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_set_corruption_correlation(const char* ta, const char* if_name, double corruption_correlation)

Set packet corruption correlation on interface

Parameters:

ta

Test Agent

if_name

Interface name

corruption_correlation

Corruption correlation value [0-100]%

Returns:

Status code

te_errno tapi_cfg_netem_get_corruption_correlation(const char* ta, const char* if_name, double* corruption_correlation)

Get packet corruption correlation on interface

Parameters:

ta

Test Agent

if_name

Interface name

corruption_correlation

Corruption correlation value [0-100]%

Returns:

Status code