Skip to main content

netem_trace/model/
mod.rs

1//! This module contains pre-defined models for BwTrace, DelayTrace, LossTrace, DuplicateTrace and RwndTrace.
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`, `DuplicateTrace` or `RwndTrace`
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//! Enable `rwnd-model` feature to use the RwndTrace models.
14//! Enable `pdo-model` feature to use the HeavyPdoTrace and LightPdoTrace models.
15
16#[cfg(feature = "bw-model")]
17pub mod bw;
18
19#[cfg(feature = "bw-model")]
20pub use bw::{
21    BwTraceConfig, Forever, NormalizedBwConfig, RepeatedBwPatternConfig, SawtoothBwConfig,
22    StaticBwConfig, TraceBwConfig,
23};
24#[cfg(feature = "bw-model")]
25pub use bw::{NormalizedBw, RepeatedBwPattern, SawtoothBw, StaticBw, TraceBw};
26
27#[cfg(feature = "delay-model")]
28pub mod delay;
29
30#[cfg(feature = "delay-model")]
31pub use delay::{DelayTraceConfig, RepeatedDelayPatternConfig, StaticDelayConfig};
32#[cfg(feature = "delay-model")]
33pub use delay::{RepeatedDelayPattern, StaticDelay};
34
35#[cfg(feature = "delay-per-packet-model")]
36pub mod delay_per_packet;
37
38#[cfg(feature = "delay-per-packet-model")]
39pub use delay_per_packet::{
40    DelayPerPacketTraceConfig, LogNormalizedDelayPerPacketConfig, NormalizedDelayPerPacketConfig,
41    RepeatedDelayPerPacketPatternConfig, StaticDelayPerPacketConfig, UniformDelayPerPacketConfig,
42};
43#[cfg(feature = "delay-per-packet-model")]
44pub use delay_per_packet::{
45    LogNormalizedDelayPerPacket, NormalizedDelayPerPacket, RepeatedDelayPerPacketPattern,
46    StaticDelayPerPacket, UniformDelayPerPacket,
47};
48
49#[cfg(feature = "loss-model")]
50pub mod loss;
51
52#[cfg(feature = "loss-model")]
53pub use loss::{LossTraceConfig, RepeatedLossPatternConfig, StaticLossConfig};
54#[cfg(feature = "loss-model")]
55pub use loss::{RepeatedLossPattern, StaticLoss};
56
57#[cfg(feature = "duplicate-model")]
58pub mod duplicate;
59
60#[cfg(feature = "duplicate-model")]
61pub use duplicate::{DuplicateTraceConfig, RepeatedDuplicatePatternConfig, StaticDuplicateConfig};
62#[cfg(feature = "duplicate-model")]
63pub use duplicate::{RepeatedDuplicatePattern, StaticDuplicate};
64
65#[cfg(feature = "rwnd-model")]
66pub mod rwnd;
67
68#[cfg(feature = "rwnd-model")]
69pub use rwnd::{RepeatedRwndPattern, StaticRwnd};
70#[cfg(feature = "rwnd-model")]
71pub use rwnd::{RepeatedRwndPatternConfig, RwndTraceConfig, StaticRwndConfig};
72
73#[cfg(feature = "pdo-model")]
74pub mod pdo;
75
76#[cfg(feature = "pdo-model")]
77pub use pdo::{
78    load_cellreplay_light_pdo_trace, HeavyPdoTraceConfig, LightPdoTraceConfig,
79    RepeatedHeavyPdoPatternConfig, StaticHeavyPdoConfig, TraceHeavyPdoConfig, TraceLightPdoConfig,
80    CELLREPLAY_PDO_SIZE,
81};
82#[cfg(feature = "pdo-model")]
83pub use pdo::{RepeatedHeavyPdoPattern, StaticHeavyPdo, TraceHeavyPdo, TraceLightPdo};
84
85#[cfg(feature = "truncated-normal")]
86pub mod solve_truncate;