netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

For further documentation see http://linux-net.osdl.org/index.php/Netem. More...

Collaboration diagram for Network Emulator:

Functions

int netem_build_msg (struct rtnl_qdisc *qdisc, struct nl_msg *msg)
 

Queue Limit

int rtnl_netem_set_limit (struct rtnl_qdisc *qdisc, int limit)
 Set limit of netem qdisc. More...
 
int rtnl_netem_get_limit (struct rtnl_qdisc *qdisc)
 Get limit of netem qdisc. More...
 

Packet Re-ordering

int rtnl_netem_set_gap (struct rtnl_qdisc *qdisc, int gap)
 Set re-ordering gap of netem qdisc. More...
 
int rtnl_netem_get_gap (struct rtnl_qdisc *qdisc)
 Get re-ordering gap of netem qdisc. More...
 
int rtnl_netem_set_reorder_probability (struct rtnl_qdisc *qdisc, int prob)
 Set re-ordering probability of netem qdisc. More...
 
int rtnl_netem_get_reorder_probability (struct rtnl_qdisc *qdisc)
 Get re-ordering probability of netem qdisc. More...
 
int rtnl_netem_set_reorder_correlation (struct rtnl_qdisc *qdisc, int prob)
 Set re-order correlation probability of netem qdisc. More...
 
int rtnl_netem_get_reorder_correlation (struct rtnl_qdisc *qdisc)
 Get re-ordering correlation probability of netem qdisc. More...
 

Corruption

int rtnl_netem_set_corruption_probability (struct rtnl_qdisc *qdisc, int prob)
 Set corruption probability of netem qdisc. More...
 
int rtnl_netem_get_corruption_probability (struct rtnl_qdisc *qdisc)
 Get corruption probability of netem qdisc. More...
 
int rtnl_netem_set_corruption_correlation (struct rtnl_qdisc *qdisc, int prob)
 Set corruption correlation probability of netem qdisc. More...
 
int rtnl_netem_get_corruption_correlation (struct rtnl_qdisc *qdisc)
 Get corruption correlation probability of netem qdisc. More...
 

Packet Loss

int rtnl_netem_set_loss (struct rtnl_qdisc *qdisc, int prob)
 Set packet loss probability of netem qdisc. More...
 
int rtnl_netem_get_loss (struct rtnl_qdisc *qdisc)
 Get packet loss probability of netem qdisc. More...
 
int rtnl_netem_set_loss_correlation (struct rtnl_qdisc *qdisc, int prob)
 Set packet loss correlation probability of netem qdisc. More...
 
int rtnl_netem_get_loss_correlation (struct rtnl_qdisc *qdisc)
 Get packet loss correlation probability of netem qdisc. More...
 

Packet Duplication

int rtnl_netem_set_duplicate (struct rtnl_qdisc *qdisc, int prob)
 Set packet duplication probability of netem qdisc. More...
 
int rtnl_netem_get_duplicate (struct rtnl_qdisc *qdisc)
 Get packet duplication probability of netem qdisc. More...
 
int rtnl_netem_set_duplicate_correlation (struct rtnl_qdisc *qdisc, int prob)
 Set packet duplication correlation probability of netem qdisc. More...
 
int rtnl_netem_get_duplicate_correlation (struct rtnl_qdisc *qdisc)
 Get packet duplication correlation probability of netem qdisc. More...
 

Packet Delay

int rtnl_netem_set_delay (struct rtnl_qdisc *qdisc, int delay)
 Set packet delay of netem qdisc. More...
 
int rtnl_netem_get_delay (struct rtnl_qdisc *qdisc)
 Get packet delay of netem qdisc. More...
 
int rtnl_netem_set_jitter (struct rtnl_qdisc *qdisc, int jitter)
 Set packet delay jitter of netem qdisc. More...
 
int rtnl_netem_get_jitter (struct rtnl_qdisc *qdisc)
 Get packet delay jitter of netem qdisc. More...
 
int rtnl_netem_set_delay_correlation (struct rtnl_qdisc *qdisc, int prob)
 Set packet delay correlation probability of netem qdisc. More...
 
int rtnl_netem_get_delay_correlation (struct rtnl_qdisc *qdisc)
 Get packet delay correlation probability of netem qdisc. More...
 
int rtnl_netem_get_delay_distribution_size (struct rtnl_qdisc *qdisc)
 Get the size of the distribution table. More...
 
int rtnl_netem_get_delay_distribution (struct rtnl_qdisc *qdisc, int16_t **dist_ptr)
 Get a pointer to the distribution table. More...
 
int rtnl_netem_set_delay_distribution (struct rtnl_qdisc *qdisc, const char *dist_type)
 Set the delay distribution. More...
 

Detailed Description

For further documentation see http://linux-net.osdl.org/index.php/Netem.

Function Documentation

int rtnl_netem_get_corruption_correlation ( struct rtnl_qdisc qdisc)

Get corruption correlation probability of netem qdisc.

  • qdisc Netem qdisc.
    Returns
    Corruption correlation probability or a negative error code.

References NLE_NOATTR, rtnl_netem_crpt::nmcr_correlation, rtnl_netem::qnm_crpt, and rtnl_netem::qnm_mask.

int rtnl_netem_get_corruption_probability ( struct rtnl_qdisc qdisc)

Get corruption probability of netem qdisc.

  • qdisc Netem qdisc.
    Returns
    Corruption probability or a negative error code.

References NLE_NOATTR, rtnl_netem_crpt::nmcr_probability, rtnl_netem::qnm_crpt, and rtnl_netem::qnm_mask.

int rtnl_netem_get_delay ( struct rtnl_qdisc qdisc)

Get packet delay of netem qdisc.

  • qdisc Netem qdisc.
    Returns
    Packet delay in micro seconds or a negative error code.

References nl_ticks2us(), NLE_NOATTR, rtnl_netem::qnm_latency, and rtnl_netem::qnm_mask.

Here is the call graph for this function:

int rtnl_netem_get_delay_correlation ( struct rtnl_qdisc qdisc)

Get packet delay correlation probability of netem qdisc.

  • qdisc Netem qdisc.
    Returns
    Packet delay correlation probability or a negative error code.

References NLE_NOATTR, rtnl_netem_corr::nmc_delay, rtnl_netem::qnm_corr, and rtnl_netem::qnm_mask.

int rtnl_netem_get_delay_distribution ( struct rtnl_qdisc qdisc,
int16_t **  dist_ptr 
)

Get a pointer to the distribution table.

  • qdisc Netem qdisc.
  • dist_ptr The pointer to set.
    Returns
    Negative error code on failure or 0 on success.

References rtnl_netem_dist::dist_data, NLE_NOATTR, rtnl_netem::qnm_dist, and rtnl_netem::qnm_mask.

int rtnl_netem_get_delay_distribution_size ( struct rtnl_qdisc qdisc)

Get the size of the distribution table.

  • qdisc Netem qdisc.
    Returns
    Distribution table size or a negative error code.

References rtnl_netem_dist::dist_size, NLE_NOATTR, rtnl_netem::qnm_dist, and rtnl_netem::qnm_mask.

int rtnl_netem_get_duplicate ( struct rtnl_qdisc qdisc)

Get packet duplication probability of netem qdisc.

  • qdisc Netem qdisc.
    Returns
    Packet duplication probability or a negative error code.

References NLE_NOATTR, rtnl_netem::qnm_duplicate, and rtnl_netem::qnm_mask.

int rtnl_netem_get_duplicate_correlation ( struct rtnl_qdisc qdisc)

Get packet duplication correlation probability of netem qdisc.

  • qdisc Netem qdisc.
    Returns
    Packet duplication correlation probability or a negative error code.

References NLE_NOATTR, rtnl_netem_corr::nmc_duplicate, rtnl_netem::qnm_corr, and rtnl_netem::qnm_mask.

int rtnl_netem_get_gap ( struct rtnl_qdisc qdisc)

Get re-ordering gap of netem qdisc.

  • qdisc Netem qdisc.
    Returns
    Re-ordering gap in packets or a negative error code.

References NLE_NOATTR, rtnl_netem::qnm_gap, and rtnl_netem::qnm_mask.

int rtnl_netem_get_jitter ( struct rtnl_qdisc qdisc)

Get packet delay jitter of netem qdisc.

  • qdisc Netem qdisc.
    Returns
    Packet delay jitter in micro seconds or a negative error code.

References nl_ticks2us(), NLE_NOATTR, rtnl_netem::qnm_jitter, and rtnl_netem::qnm_mask.

Here is the call graph for this function:

int rtnl_netem_get_limit ( struct rtnl_qdisc qdisc)

Get limit of netem qdisc.

  • qdisc Netem qdisc.
    Returns
    Limit in bytes or a negative error code.

References NLE_NOATTR, rtnl_netem::qnm_limit, and rtnl_netem::qnm_mask.

int rtnl_netem_get_loss ( struct rtnl_qdisc qdisc)

Get packet loss probability of netem qdisc.

  • qdisc Netem qdisc.
    Returns
    Packet loss probability or a negative error code.

References NLE_NOATTR, rtnl_netem::qnm_loss, and rtnl_netem::qnm_mask.

int rtnl_netem_get_loss_correlation ( struct rtnl_qdisc qdisc)

Get packet loss correlation probability of netem qdisc.

  • qdisc Netem qdisc.
    Returns
    Packet loss correlation probability or a negative error code.

References NLE_NOATTR, rtnl_netem_corr::nmc_loss, rtnl_netem::qnm_corr, and rtnl_netem::qnm_mask.

int rtnl_netem_get_reorder_correlation ( struct rtnl_qdisc qdisc)

Get re-ordering correlation probability of netem qdisc.

  • qdisc Netem qdisc.
    Returns
    Re-ordering correlation probability or a negative error code.

References NLE_NOATTR, rtnl_netem_reo::nmro_correlation, rtnl_netem::qnm_mask, and rtnl_netem::qnm_ro.

int rtnl_netem_get_reorder_probability ( struct rtnl_qdisc qdisc)

Get re-ordering probability of netem qdisc.

  • qdisc Netem qdisc.
    Returns
    Re-ordering probability or a negative error code.

References NLE_NOATTR, rtnl_netem_reo::nmro_probability, rtnl_netem::qnm_mask, and rtnl_netem::qnm_ro.

int rtnl_netem_set_corruption_correlation ( struct rtnl_qdisc qdisc,
int  prob 
)

Set corruption correlation probability of netem qdisc.

  • qdisc Netem qdisc to be modified.
  • prob New corruption correlation probability.
    Returns
    0 on success or a negative error code.

References NLE_NOMEM, rtnl_netem_crpt::nmcr_correlation, rtnl_netem::qnm_crpt, and rtnl_netem::qnm_mask.

int rtnl_netem_set_corruption_probability ( struct rtnl_qdisc qdisc,
int  prob 
)

Set corruption probability of netem qdisc.

  • qdisc Netem qdisc to be modified.
  • prob New corruption probability.
    Returns
    0 on success or a negative error code.

References NLE_NOMEM, rtnl_netem_crpt::nmcr_probability, rtnl_netem::qnm_crpt, and rtnl_netem::qnm_mask.

int rtnl_netem_set_delay ( struct rtnl_qdisc qdisc,
int  delay 
)

Set packet delay of netem qdisc.

  • qdisc Netem qdisc to be modified.
  • delay New packet delay in micro seconds.
    Returns
    0 on success or a negative error code.

References nl_us2ticks(), NLE_NOMEM, rtnl_netem::qnm_latency, and rtnl_netem::qnm_mask.

Here is the call graph for this function:

int rtnl_netem_set_delay_correlation ( struct rtnl_qdisc qdisc,
int  prob 
)

Set packet delay correlation probability of netem qdisc.

  • qdisc Netem qdisc to be modified.
  • prob New packet delay correlation probability.

References NLE_NOMEM, rtnl_netem_corr::nmc_delay, rtnl_netem::qnm_corr, and rtnl_netem::qnm_mask.

int rtnl_netem_set_delay_distribution ( struct rtnl_qdisc qdisc,
const char *  dist_type 
)

Set the delay distribution.

Latency/jitter must be set before applying.

  • qdisc Netem qdisc.
  • dist_type The name of the distribution (type, file, path/file).
    Returns
    0 on success, error code on failure.

References rtnl_netem_dist::dist_data, rtnl_netem_dist::dist_size, line, MAXDIST, name, nl_syserr2nlerr(), NLE_INVAL, NLE_NOMEM, NULL, rtnl_netem::qnm_dist, and rtnl_netem::qnm_mask.

Here is the call graph for this function:

int rtnl_netem_set_duplicate ( struct rtnl_qdisc qdisc,
int  prob 
)

Set packet duplication probability of netem qdisc.

  • qdisc Netem qdisc to be modified.
  • prob New packet duplication probability.
    Returns
    0 on success or a negative error code.

References NLE_NOMEM, rtnl_netem::qnm_duplicate, and rtnl_netem::qnm_mask.

int rtnl_netem_set_duplicate_correlation ( struct rtnl_qdisc qdisc,
int  prob 
)

Set packet duplication correlation probability of netem qdisc.

  • qdisc Netem qdisc to be modified.
  • prob New packet duplication correlation probability.
    Returns
    0 on sucess or a negative error code.

References NLE_NOMEM, rtnl_netem_corr::nmc_duplicate, rtnl_netem::qnm_corr, and rtnl_netem::qnm_mask.

int rtnl_netem_set_gap ( struct rtnl_qdisc qdisc,
int  gap 
)

Set re-ordering gap of netem qdisc.

  • qdisc Netem qdisc to be modified.
  • gap New gap in number of packets.
    Returns
    0 on success or a negative error code.

References NLE_NOMEM, rtnl_netem::qnm_gap, and rtnl_netem::qnm_mask.

int rtnl_netem_set_jitter ( struct rtnl_qdisc qdisc,
int  jitter 
)

Set packet delay jitter of netem qdisc.

  • qdisc Netem qdisc to be modified.
  • jitter New packet delay jitter in micro seconds.
    Returns
    0 on success or a negative error code.

References nl_us2ticks(), NLE_NOMEM, rtnl_netem::qnm_jitter, and rtnl_netem::qnm_mask.

Here is the call graph for this function:

int rtnl_netem_set_limit ( struct rtnl_qdisc qdisc,
int  limit 
)

Set limit of netem qdisc.

  • qdisc Netem qdisc to be modified.
  • limit New limit in bytes.
    Returns
    0 on success or a negative error code.

References NLE_NOMEM, rtnl_netem::qnm_limit, and rtnl_netem::qnm_mask.

int rtnl_netem_set_loss ( struct rtnl_qdisc qdisc,
int  prob 
)

Set packet loss probability of netem qdisc.

  • qdisc Netem qdisc to be modified.
  • prob New packet loss probability.
    Returns
    0 on success or a negative error code.

References NLE_NOMEM, rtnl_netem::qnm_loss, and rtnl_netem::qnm_mask.

int rtnl_netem_set_loss_correlation ( struct rtnl_qdisc qdisc,
int  prob 
)

Set packet loss correlation probability of netem qdisc.

  • qdisc Netem qdisc to be modified.
  • prob New packet loss correlation.
    Returns
    0 on success or a negative error code.

References NLE_NOMEM, rtnl_netem_corr::nmc_loss, rtnl_netem::qnm_corr, and rtnl_netem::qnm_mask.

int rtnl_netem_set_reorder_correlation ( struct rtnl_qdisc qdisc,
int  prob 
)

Set re-order correlation probability of netem qdisc.

  • qdisc Netem qdisc to be modified.
  • prob New re-ordering correlation probability.
    Returns
    0 on success or a negative error code.

References NLE_NOMEM, rtnl_netem_reo::nmro_correlation, rtnl_netem::qnm_mask, and rtnl_netem::qnm_ro.

int rtnl_netem_set_reorder_probability ( struct rtnl_qdisc qdisc,
int  prob 
)

Set re-ordering probability of netem qdisc.

  • qdisc Netem qdisc to be modified.
  • prob New re-ordering probability.
    Returns
    0 on success or a negative error code.

References NLE_NOMEM, rtnl_netem_reo::nmro_probability, rtnl_netem::qnm_mask, and rtnl_netem::qnm_ro.