libnl 3.5.0

Network Emulator
Routing Library (libnl-route) » Traffic Control » Queueing Disciplines

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

## Queue Limit
void | 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
void | 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...
void | 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...
void | 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
void | 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...
void | 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
void | 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...
void | 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
void | 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...
void | 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
void | 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...
void | 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...
void | 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_data (struct rtnl_qdisc *qdisc, const int16_t *data, size_t len)
| Set the delay distribution data. More...
int | rtnl_netem_set_delay_distribution (struct rtnl_qdisc *qdisc, const char *dist_type)
| Load the delay distribution from a file. More...

## Detailed Description

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

## Function Documentation

## ◆ rtnl_netem_set_limit()

void rtnl_netem_set_limit | ( | struct rtnl_qdisc * | qdisc,
|  | int | limit
| ) |  |

Set limit of netem qdisc.

Parameters

  qdisc | Netem qdisc to be modified.
  limit | New limit in bytes.

Returns
  0 on success or a negative error code.

Definition at line 352 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_limit()

int rtnl_netem_get_limit | ( | struct rtnl_qdisc * | qdisc | ) |

Get limit of netem qdisc.

Parameters

  qdisc | Netem qdisc.

Returns
  Limit in bytes or a negative error code.

Definition at line 368 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_set_gap()

void rtnl_netem_set_gap | ( | struct rtnl_qdisc * | qdisc,
|  | int | gap
| ) |  |

Set re-ordering gap of netem qdisc.

Parameters

  qdisc | Netem qdisc to be modified.
  gap | New gap in number of packets.

Returns
  0 on success or a negative error code.

Definition at line 394 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_gap()

int rtnl_netem_get_gap | ( | struct rtnl_qdisc * | qdisc | ) |

Get re-ordering gap of netem qdisc.

Parameters

  qdisc | Netem qdisc.

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

Definition at line 410 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_set_reorder_probability()

void rtnl_netem_set_reorder_probability | ( | struct rtnl_qdisc * | qdisc,
|  | int | prob
| ) |  |

Set re-ordering probability of netem qdisc.

Parameters

  qdisc | Netem qdisc to be modified.
  prob | New re-ordering probability.

Returns
  0 on success or a negative error code.

Definition at line 429 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_reorder_probability()

int rtnl_netem_get_reorder_probability | ( | struct rtnl_qdisc * | qdisc | ) |

Get re-ordering probability of netem qdisc.

Parameters

  qdisc | Netem qdisc.

Returns
  Re-ordering probability or a negative error code.

Definition at line 445 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_set_reorder_correlation()

void rtnl_netem_set_reorder_correlation | ( | struct rtnl_qdisc * | qdisc,
|  | int | prob
| ) |  |

Set re-order correlation probability of netem qdisc.

Parameters

  qdisc | Netem qdisc to be modified.
  prob | New re-ordering correlation probability.

Returns
  0 on success or a negative error code.

Definition at line 464 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_reorder_correlation()

int rtnl_netem_get_reorder_correlation | ( | struct rtnl_qdisc * | qdisc | ) |

Get re-ordering correlation probability of netem qdisc.

Parameters

  qdisc | Netem qdisc.

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

Definition at line 480 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_set_corruption_probability()

void rtnl_netem_set_corruption_probability | ( | struct rtnl_qdisc * | qdisc,
|  | int | prob
| ) |  |

Set corruption probability of netem qdisc.

Parameters

  qdisc | Netem qdisc to be modified.
  prob | New corruption probability.

Returns
  0 on success or a negative error code.

Definition at line 506 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_corruption_probability()

int rtnl_netem_get_corruption_probability | ( | struct rtnl_qdisc * | qdisc | ) |

Get corruption probability of netem qdisc.

Parameters

  qdisc | Netem qdisc.

Returns
  Corruption probability or a negative error code.

Definition at line 522 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_set_corruption_correlation()

void rtnl_netem_set_corruption_correlation | ( | struct rtnl_qdisc * | qdisc,
|  | int | prob
| ) |  |

Set corruption correlation probability of netem qdisc.

Parameters

  qdisc | Netem qdisc to be modified.
  prob | New corruption correlation probability.

Returns
  0 on success or a negative error code.

Definition at line 541 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_corruption_correlation()

int rtnl_netem_get_corruption_correlation | ( | struct rtnl_qdisc * | qdisc | ) |

Get corruption correlation probability of netem qdisc.

Parameters

  qdisc | Netem qdisc.

Returns
  Corruption correlation probability or a negative error code.

Definition at line 557 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_set_loss()

void rtnl_netem_set_loss | ( | struct rtnl_qdisc * | qdisc,
|  | int | prob
| ) |  |

Set packet loss probability of netem qdisc.

Parameters

  qdisc | Netem qdisc to be modified.
  prob | New packet loss probability.

Returns
  0 on success or a negative error code.

Definition at line 583 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_loss()

int rtnl_netem_get_loss | ( | struct rtnl_qdisc * | qdisc | ) |

Get packet loss probability of netem qdisc.

Parameters

  qdisc | Netem qdisc.

Returns
  Packet loss probability or a negative error code.

Definition at line 599 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_set_loss_correlation()

void rtnl_netem_set_loss_correlation | ( | struct rtnl_qdisc * | qdisc,
|  | int | prob
| ) |  |

Set packet loss correlation probability of netem qdisc.

Parameters

  qdisc | Netem qdisc to be modified.
  prob | New packet loss correlation.

Returns
  0 on success or a negative error code.

Definition at line 618 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_loss_correlation()

int rtnl_netem_get_loss_correlation | ( | struct rtnl_qdisc * | qdisc | ) |

Get packet loss correlation probability of netem qdisc.

Parameters

  qdisc | Netem qdisc.

Returns
  Packet loss correlation probability or a negative error code.

Definition at line 634 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_set_duplicate()

void rtnl_netem_set_duplicate | ( | struct rtnl_qdisc * | qdisc,
|  | int | prob
| ) |  |

Set packet duplication probability of netem qdisc.

Parameters

  qdisc | Netem qdisc to be modified.
  prob | New packet duplication probability.

Returns
  0 on success or a negative error code.

Definition at line 660 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_duplicate()

int rtnl_netem_get_duplicate | ( | struct rtnl_qdisc * | qdisc | ) |

Get packet duplication probability of netem qdisc.

Parameters

  qdisc | Netem qdisc.

Returns
  Packet duplication probability or a negative error code.

Definition at line 676 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_set_duplicate_correlation()

void rtnl_netem_set_duplicate_correlation | ( | struct rtnl_qdisc * | qdisc,
|  | int | prob
| ) |  |

Set packet duplication correlation probability of netem qdisc.

Parameters

  qdisc | Netem qdisc to be modified.
  prob | New packet duplication correlation probability.

Returns
  0 on sucess or a negative error code.

Definition at line 695 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_duplicate_correlation()

int rtnl_netem_get_duplicate_correlation | ( | struct rtnl_qdisc * | qdisc | ) |

Get packet duplication correlation probability of netem qdisc.

Parameters

  qdisc | Netem qdisc.

Returns
  Packet duplication correlation probability or a negative error code.

Definition at line 711 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_set_delay()

void rtnl_netem_set_delay | ( | struct rtnl_qdisc * | qdisc,
|  | int | delay
| ) |  |

Set packet delay of netem qdisc.

Parameters

  qdisc | Netem qdisc to be modified.
  delay | New packet delay in micro seconds.

Returns
  0 on success or a negative error code.

Definition at line 737 of file netem.c.

References nl_us2ticks(), rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_delay()

int rtnl_netem_get_delay | ( | struct rtnl_qdisc * | qdisc | ) |

Get packet delay of netem qdisc.

Parameters

  qdisc | Netem qdisc.

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

Definition at line 753 of file netem.c.

References nl_ticks2us(), rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_set_jitter()

void rtnl_netem_set_jitter | ( | struct rtnl_qdisc * | qdisc,
|  | int | jitter
| ) |  |

Set packet delay jitter of netem qdisc.

Parameters

  qdisc | Netem qdisc to be modified.
  jitter | New packet delay jitter in micro seconds.

Returns
  0 on success or a negative error code.

Definition at line 772 of file netem.c.

References nl_us2ticks(), rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_jitter()

int rtnl_netem_get_jitter | ( | struct rtnl_qdisc * | qdisc | ) |

Get packet delay jitter of netem qdisc.

Parameters

  qdisc | Netem qdisc.

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

Definition at line 788 of file netem.c.

References nl_ticks2us(), rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_set_delay_correlation()

void rtnl_netem_set_delay_correlation | ( | struct rtnl_qdisc * | qdisc,
|  | int | prob
| ) |  |

Set packet delay correlation probability of netem qdisc.

Parameters

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

Definition at line 806 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_delay_correlation()

int rtnl_netem_get_delay_correlation | ( | struct rtnl_qdisc * | qdisc | ) |

Get packet delay correlation probability of netem qdisc.

Parameters

  qdisc | Netem qdisc.

Returns
  Packet delay correlation probability or a negative error code.

Definition at line 822 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_delay_distribution_size()

int rtnl_netem_get_delay_distribution_size | ( | struct rtnl_qdisc * | qdisc | ) |

Get the size of the distribution table.

Parameters

  qdisc | Netem qdisc.

Returns
  Distribution table size or a negative error code.

Definition at line 840 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_get_delay_distribution()

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

Get a pointer to the distribution table.

Parameters

  qdisc | Netem qdisc.
  dist_ptr | The pointer to set.

Returns
  Negative error code on failure or 0 on success.

Definition at line 859 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_netem_set_delay_distribution_data()

int rtnl_netem_set_delay_distribution_data | ( | struct rtnl_qdisc * | qdisc,
|  | const int16_t * | data,
|  | size_t | len
| ) |  |

Set the delay distribution data.

Latency/jitter must be set before applying.

Parameters

  qdisc | Netem qdisc.

Returns
  0 on success, error code on failure.

Definition at line 878 of file netem.c.

References rtnl_tc_data(), and TC_CAST.

Referenced by rtnl_netem_set_delay_distribution().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ rtnl_netem_set_delay_distribution()

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

Load the delay distribution from a file.

Latency/jitter must be set before applying.

Parameters

  qdisc | Netem qdisc.
  dist_type | The name of the distribution (type, file, path/file).

Returns
  0 on success, error code on failure.

Definition at line 909 of file netem.c.

References rtnl_netem_set_delay_distribution_data().

Here is the call graph for this function: