netem_trace/model/
mod.rs

1//! This module contains pre-defined models for BwTrace, DelayTrace, LossTrace and DuplicateTrace.
2//!
3//! A model has two parts: a configuration struct and a model struct.
4//! The configuration struct is used to configure the model and
5//! used for serialization/deserialization if `serde` feature is enabled.
6//! The model struct which implements trait `BwTrace`, `DelayTrace`, `LossTrace` or `DuplicateTrace`
7//! is used to generate the trace and maintain inner states.
8//!
9//! Enable `bw-model` feature to use the BwTrace models.
10//! Enable `delay-model` feature to use the DelayTrace models.
11//! Enable `loss-model` feature to use the LossTrace models.
12//! Enable `duplicate-model` feature to use the DuplicateTrace models.
13
14#[cfg(feature = "bw-model")]
15pub mod bw;
16
17#[cfg(feature = "bw-model")]
18pub use bw::{
19    BwTraceConfig, Forever, NormalizedBwConfig, RepeatedBwPatternConfig, SawtoothBwConfig,
20    StaticBwConfig, TraceBwConfig,
21};
22#[cfg(feature = "bw-model")]
23pub use bw::{NormalizedBw, RepeatedBwPattern, SawtoothBw, StaticBw, TraceBw};
24
25#[cfg(feature = "delay-model")]
26pub mod delay;
27
28#[cfg(feature = "delay-model")]
29pub use delay::{DelayTraceConfig, RepeatedDelayPatternConfig, StaticDelayConfig};
30#[cfg(feature = "delay-model")]
31pub use delay::{RepeatedDelayPattern, StaticDelay};
32
33#[cfg(feature = "delay-per-packet-model")]
34pub mod delay_per_packet;
35
36#[cfg(feature = "delay-per-packet-model")]
37pub use delay_per_packet::{
38    DelayPerPacketTraceConfig, LogNormalizedDelayPerPacketConfig, NormalizedDelayPerPacketConfig,
39    RepeatedDelayPerPacketPatternConfig, StaticDelayPerPacketConfig,
40};
41#[cfg(feature = "delay-per-packet-model")]
42pub use delay_per_packet::{
43    LogNormalizedDelayPerPacket, NormalizedDelayPerPacket, RepeatedDelayPerPacketPattern,
44    StaticDelayPerPacket,
45};
46
47#[cfg(feature = "loss-model")]
48pub mod loss;
49
50#[cfg(feature = "loss-model")]
51pub use loss::{LossTraceConfig, RepeatedLossPatternConfig, StaticLossConfig};
52#[cfg(feature = "loss-model")]
53pub use loss::{RepeatedLossPattern, StaticLoss};
54
55#[cfg(feature = "duplicate-model")]
56pub mod duplicate;
57
58#[cfg(feature = "duplicate-model")]
59pub use duplicate::{DuplicateTraceConfig, RepeatedDuplicatePatternConfig, StaticDuplicateConfig};
60#[cfg(feature = "duplicate-model")]
61pub use duplicate::{RepeatedDuplicatePattern, StaticDuplicate};
62
63#[cfg(feature = "truncated-normal")]
64pub mod solve_truncate;