| 1 |
/* SPDX-License-Identifier: LGPL-2.1-only */ |
| 2 |
/* |
| 3 |
* Copyright (c) 2003-2006 Thomas Graf <[email protected]> |
| 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 |
| 13 |
extern "C" { |
| 14 |
#endif |
| 15 |
|
| 16 |
extern void rtnl_netem_set_limit(struct rtnl_qdisc *, int); |
| 17 |
extern int rtnl_netem_get_limit(struct rtnl_qdisc *); |
| 18 |
|
| 19 |
/* Packet Re-ordering */ |
| 20 |
extern void rtnl_netem_set_gap(struct rtnl_qdisc *, int); |
| 21 |
extern int rtnl_netem_get_gap(struct rtnl_qdisc *); |
| 22 |
|
| 23 |
extern void rtnl_netem_set_reorder_probability(struct rtnl_qdisc *, int); |
| 24 |
extern int rtnl_netem_get_reorder_probability(struct rtnl_qdisc *); |
| 25 |
|
| 26 |
extern void rtnl_netem_set_reorder_correlation(struct rtnl_qdisc *, int); |
| 27 |
extern int rtnl_netem_get_reorder_correlation(struct rtnl_qdisc *); |
| 28 |
|
| 29 |
/* Corruption */ |
| 30 |
extern void rtnl_netem_set_corruption_probability(struct rtnl_qdisc *, int); |
| 31 |
extern int rtnl_netem_get_corruption_probability(struct rtnl_qdisc *); |
| 32 |
|
| 33 |
extern void rtnl_netem_set_corruption_correlation(struct rtnl_qdisc *, int); |
| 34 |
extern int rtnl_netem_get_corruption_correlation(struct rtnl_qdisc *); |
| 35 |
|
| 36 |
/* Packet Loss */ |
| 37 |
extern void rtnl_netem_set_loss(struct rtnl_qdisc *, int); |
| 38 |
extern int rtnl_netem_get_loss(struct rtnl_qdisc *); |
| 39 |
|
| 40 |
extern void rtnl_netem_set_loss_correlation(struct rtnl_qdisc *, int); |
| 41 |
extern int rtnl_netem_get_loss_correlation(struct rtnl_qdisc *); |
| 42 |
|
| 43 |
/* Packet Duplication */ |
| 44 |
extern void rtnl_netem_set_duplicate(struct rtnl_qdisc *, int); |
| 45 |
extern int rtnl_netem_get_duplicate(struct rtnl_qdisc *); |
| 46 |
|
| 47 |
extern void rtnl_netem_set_duplicate_correlation(struct rtnl_qdisc *, int); |
| 48 |
extern int rtnl_netem_get_duplicate_correlation(struct rtnl_qdisc *); |
| 49 |
|
| 50 |
/* Packet Delay */ |
| 51 |
extern void rtnl_netem_set_delay(struct rtnl_qdisc *, int); |
| 52 |
extern int rtnl_netem_get_delay(struct rtnl_qdisc *); |
| 53 |
|
| 54 |
extern void rtnl_netem_set_jitter(struct rtnl_qdisc *, int); |
| 55 |
extern int rtnl_netem_get_jitter(struct rtnl_qdisc *); |
| 56 |
|
| 57 |
extern void rtnl_netem_set_delay_correlation(struct rtnl_qdisc *, int); |
| 58 |
extern int rtnl_netem_get_delay_correlation(struct rtnl_qdisc *); |
| 59 |
|
| 60 |
/* Delay Distribution */ |
| 61 |
#define MAXDIST 65536 |
| 62 |
extern int rtnl_netem_set_delay_distribution(struct rtnl_qdisc *, const char *); |
| 63 |
extern int rtnl_netem_set_delay_distribution_data(struct rtnl_qdisc *, const int16_t *, size_t len); |
| 64 |
extern int rtnl_netem_get_delay_distribution_size(struct rtnl_qdisc *); |
| 65 |
extern int rtnl_netem_get_delay_distribution(struct rtnl_qdisc *, int16_t **); |
| 66 |
|
| 67 |
#ifdef __cplusplus |
| 68 |
} |
| 69 |
#endif |
| 70 |
|
| 71 |
#endif |