libnl 3.7.0
netem.h
1/* SPDX-License-Identifier: LGPL-2.1-only */
2/*
3 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
4 */
5
6#ifndef NETLINK_NETEM_H_
7#define NETLINK_NETEM_H_
8
9#include <netlink/netlink.h>
10#include <netlink/route/qdisc.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16extern void rtnl_netem_set_limit(struct rtnl_qdisc *, int);
17extern int rtnl_netem_get_limit(struct rtnl_qdisc *);
18
19/* Packet Re-ordering */
20extern void rtnl_netem_set_gap(struct rtnl_qdisc *, int);
21extern int rtnl_netem_get_gap(struct rtnl_qdisc *);
22
23extern void rtnl_netem_set_reorder_probability(struct rtnl_qdisc *, int);
24extern int rtnl_netem_get_reorder_probability(struct rtnl_qdisc *);
25
26extern void rtnl_netem_set_reorder_correlation(struct rtnl_qdisc *, int);
27extern int rtnl_netem_get_reorder_correlation(struct rtnl_qdisc *);
28
29/* Corruption */
30extern void rtnl_netem_set_corruption_probability(struct rtnl_qdisc *, int);
31extern int rtnl_netem_get_corruption_probability(struct rtnl_qdisc *);
32
33extern void rtnl_netem_set_corruption_correlation(struct rtnl_qdisc *, int);
34extern int rtnl_netem_get_corruption_correlation(struct rtnl_qdisc *);
35
36/* Packet Loss */
37extern void rtnl_netem_set_loss(struct rtnl_qdisc *, int);
38extern int rtnl_netem_get_loss(struct rtnl_qdisc *);
39
40extern void rtnl_netem_set_loss_correlation(struct rtnl_qdisc *, int);
41extern int rtnl_netem_get_loss_correlation(struct rtnl_qdisc *);
42
43/* Packet Duplication */
44extern void rtnl_netem_set_duplicate(struct rtnl_qdisc *, int);
45extern int rtnl_netem_get_duplicate(struct rtnl_qdisc *);
46
47extern void rtnl_netem_set_duplicate_correlation(struct rtnl_qdisc *, int);
48extern int rtnl_netem_get_duplicate_correlation(struct rtnl_qdisc *);
49
50/* Packet Delay */
51extern void rtnl_netem_set_delay(struct rtnl_qdisc *, int);
52extern int rtnl_netem_get_delay(struct rtnl_qdisc *);
53
54extern void rtnl_netem_set_jitter(struct rtnl_qdisc *, int);
55extern int rtnl_netem_get_jitter(struct rtnl_qdisc *);
56
57extern void rtnl_netem_set_delay_correlation(struct rtnl_qdisc *, int);
58extern int rtnl_netem_get_delay_correlation(struct rtnl_qdisc *);
59
60/* Delay Distribution */
61#define MAXDIST 65536
62extern int rtnl_netem_set_delay_distribution(struct rtnl_qdisc *, const char *);
63extern int rtnl_netem_set_delay_distribution_data(struct rtnl_qdisc *, const int16_t *, size_t len);
64extern int rtnl_netem_get_delay_distribution_size(struct rtnl_qdisc *);
65extern int rtnl_netem_get_delay_distribution(struct rtnl_qdisc *, int16_t **);
66
67#ifdef __cplusplus
68}
69#endif
70
71#endif
void rtnl_netem_set_duplicate_correlation(struct rtnl_qdisc *, int)
Set packet duplication correlation probability of netem qdisc.
Definition: netem.c:691
int rtnl_netem_get_duplicate(struct rtnl_qdisc *)
Get packet duplication probability of netem qdisc.
Definition: netem.c:672
int rtnl_netem_get_delay_distribution(struct rtnl_qdisc *, int16_t **)
Get a pointer to the distribution table.
Definition: netem.c:855
int rtnl_netem_get_reorder_correlation(struct rtnl_qdisc *)
Get re-ordering correlation probability of netem qdisc.
Definition: netem.c:476
void rtnl_netem_set_delay_correlation(struct rtnl_qdisc *, int)
Set packet delay correlation probability of netem qdisc.
Definition: netem.c:802
int rtnl_netem_get_delay_correlation(struct rtnl_qdisc *)
Get packet delay correlation probability of netem qdisc.
Definition: netem.c:818
int rtnl_netem_get_loss(struct rtnl_qdisc *)
Get packet loss probability of netem qdisc.
Definition: netem.c:595
int rtnl_netem_get_delay_distribution_size(struct rtnl_qdisc *)
Get the size of the distribution table.
Definition: netem.c:836
int rtnl_netem_get_gap(struct rtnl_qdisc *)
Get re-ordering gap of netem qdisc.
Definition: netem.c:406
int rtnl_netem_get_reorder_probability(struct rtnl_qdisc *)
Get re-ordering probability of netem qdisc.
Definition: netem.c:441
int rtnl_netem_get_duplicate_correlation(struct rtnl_qdisc *)
Get packet duplication correlation probability of netem qdisc.
Definition: netem.c:707
void rtnl_netem_set_jitter(struct rtnl_qdisc *, int)
Set packet delay jitter of netem qdisc.
Definition: netem.c:768
int rtnl_netem_get_corruption_correlation(struct rtnl_qdisc *)
Get corruption correlation probability of netem qdisc.
Definition: netem.c:553
void rtnl_netem_set_loss(struct rtnl_qdisc *, int)
Set packet loss probability of netem qdisc.
Definition: netem.c:579
void rtnl_netem_set_limit(struct rtnl_qdisc *, int)
Set limit of netem qdisc.
Definition: netem.c:348
void rtnl_netem_set_reorder_correlation(struct rtnl_qdisc *, int)
Set re-order correlation probability of netem qdisc.
Definition: netem.c:460
int rtnl_netem_get_corruption_probability(struct rtnl_qdisc *)
Get corruption probability of netem qdisc.
Definition: netem.c:518
int rtnl_netem_get_jitter(struct rtnl_qdisc *)
Get packet delay jitter of netem qdisc.
Definition: netem.c:784
void rtnl_netem_set_corruption_correlation(struct rtnl_qdisc *, int)
Set corruption correlation probability of netem qdisc.
Definition: netem.c:537
int rtnl_netem_get_delay(struct rtnl_qdisc *)
Get packet delay of netem qdisc.
Definition: netem.c:749
void rtnl_netem_set_reorder_probability(struct rtnl_qdisc *, int)
Set re-ordering probability of netem qdisc.
Definition: netem.c:425
void rtnl_netem_set_gap(struct rtnl_qdisc *, int)
Set re-ordering gap of netem qdisc.
Definition: netem.c:390
void rtnl_netem_set_corruption_probability(struct rtnl_qdisc *, int)
Set corruption probability of netem qdisc.
Definition: netem.c:502
void rtnl_netem_set_duplicate(struct rtnl_qdisc *, int)
Set packet duplication probability of netem qdisc.
Definition: netem.c:656
void rtnl_netem_set_loss_correlation(struct rtnl_qdisc *, int)
Set packet loss correlation probability of netem qdisc.
Definition: netem.c:614
int rtnl_netem_set_delay_distribution(struct rtnl_qdisc *, const char *)
Load the delay distribution from a file.
Definition: netem.c:905
void rtnl_netem_set_delay(struct rtnl_qdisc *, int)
Set packet delay of netem qdisc.
Definition: netem.c:733
int rtnl_netem_get_loss_correlation(struct rtnl_qdisc *)
Get packet loss correlation probability of netem qdisc.
Definition: netem.c:630
int rtnl_netem_set_delay_distribution_data(struct rtnl_qdisc *, const int16_t *, size_t len)
Set the delay distribution data.
Definition: netem.c:874
int rtnl_netem_get_limit(struct rtnl_qdisc *)
Get limit of netem qdisc.
Definition: netem.c:364