• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * netlink/route/sch/netem.h		Network Emulator Qdisc
3  *
4  *	This library is free software; you can redistribute it and/or
5  *	modify it under the terms of the GNU Lesser General Public
6  *	License as published by the Free Software Foundation version 2.1
7  *	of the License.
8  *
9  * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
10  */
11 
12 #ifndef NETLINK_NETEM_H_
13 #define NETLINK_NETEM_H_
14 
15 #include <netlink/netlink.h>
16 #include <netlink/route/qdisc.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 extern void rtnl_netem_set_limit(struct rtnl_qdisc *, int);
23 extern int rtnl_netem_get_limit(struct rtnl_qdisc *);
24 
25 /* Packet Re-ordering */
26 extern void rtnl_netem_set_gap(struct rtnl_qdisc *, int);
27 extern int rtnl_netem_get_gap(struct rtnl_qdisc *);
28 
29 extern void rtnl_netem_set_reorder_probability(struct rtnl_qdisc *, int);
30 extern int rtnl_netem_get_reorder_probability(struct rtnl_qdisc *);
31 
32 extern void rtnl_netem_set_reorder_correlation(struct rtnl_qdisc *, int);
33 extern int rtnl_netem_get_reorder_correlation(struct rtnl_qdisc *);
34 
35 /* Corruption */
36 extern void rtnl_netem_set_corruption_probability(struct rtnl_qdisc *, int);
37 extern int rtnl_netem_get_corruption_probability(struct rtnl_qdisc *);
38 
39 extern void rtnl_netem_set_corruption_correlation(struct rtnl_qdisc *, int);
40 extern int rtnl_netem_get_corruption_correlation(struct rtnl_qdisc *);
41 
42 /* Packet Loss */
43 extern void rtnl_netem_set_loss(struct rtnl_qdisc *, int);
44 extern int rtnl_netem_get_loss(struct rtnl_qdisc *);
45 
46 extern void rtnl_netem_set_loss_correlation(struct rtnl_qdisc *, int);
47 extern int rtnl_netem_get_loss_correlation(struct rtnl_qdisc *);
48 
49 /* Packet Duplication */
50 extern void rtnl_netem_set_duplicate(struct rtnl_qdisc *, int);
51 extern int rtnl_netem_get_duplicate(struct rtnl_qdisc *);
52 
53 extern void rtnl_netem_set_duplicate_correlation(struct rtnl_qdisc *, int);
54 extern int rtnl_netem_get_duplicate_correlation(struct rtnl_qdisc *);
55 
56 /* Packet Delay */
57 extern void rtnl_netem_set_delay(struct rtnl_qdisc *, int);
58 extern int rtnl_netem_get_delay(struct rtnl_qdisc *);
59 
60 extern void rtnl_netem_set_jitter(struct rtnl_qdisc *, int);
61 extern int rtnl_netem_get_jitter(struct rtnl_qdisc *);
62 
63 extern void rtnl_netem_set_delay_correlation(struct rtnl_qdisc *, int);
64 extern int rtnl_netem_get_delay_correlation(struct rtnl_qdisc *);
65 
66 /* Delay Distribution */
67 #define MAXDIST 65536
68 extern int rtnl_netem_set_delay_distribution(struct rtnl_qdisc *, const char *);
69 extern int rtnl_netem_get_delay_distribution_size(struct rtnl_qdisc *);
70 extern int rtnl_netem_get_delay_distribution(struct rtnl_qdisc *, int16_t **);
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif
77