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
15#[cfg(feature = "bw-model")]
16pub mod bw;
17
18#[cfg(feature = "bw-model")]
19pub use bw::{
20    BwTraceConfig, Forever, NormalizedBwConfig, RepeatedBwPatternConfig, SawtoothBwConfig,
21    StaticBwConfig, TraceBwConfig,
22};
23#[cfg(feature = "bw-model")]
24pub use bw::{NormalizedBw, RepeatedBwPattern, SawtoothBw, StaticBw, TraceBw};
25
26#[cfg(feature = "delay-model")]
27pub mod delay;
28
29#[cfg(feature = "delay-model")]
30pub use delay::{DelayTraceConfig, RepeatedDelayPatternConfig, StaticDelayConfig};
31#[cfg(feature = "delay-model")]
32pub use delay::{RepeatedDelayPattern, StaticDelay};
33
34#[cfg(feature = "delay-per-packet-model")]
35pub mod delay_per_packet;
36
37#[cfg(feature = "delay-per-packet-model")]
38pub use delay_per_packet::{
39    DelayPerPacketTraceConfig, LogNormalizedDelayPerPacketConfig, NormalizedDelayPerPacketConfig,
40    RepeatedDelayPerPacketPatternConfig, StaticDelayPerPacketConfig, UniformDelayPerPacketConfig,
41};
42#[cfg(feature = "delay-per-packet-model")]
43pub use delay_per_packet::{
44    LogNormalizedDelayPerPacket, NormalizedDelayPerPacket, RepeatedDelayPerPacketPattern,
45    StaticDelayPerPacket, UniformDelayPerPacket,
46};
47
48#[cfg(feature = "loss-model")]
49pub mod loss;
50
51#[cfg(feature = "loss-model")]
52pub use loss::{LossTraceConfig, RepeatedLossPatternConfig, StaticLossConfig};
53#[cfg(feature = "loss-model")]
54pub use loss::{RepeatedLossPattern, StaticLoss};
55
56#[cfg(feature = "duplicate-model")]
57pub mod duplicate;
58
59#[cfg(feature = "duplicate-model")]
60pub use duplicate::{DuplicateTraceConfig, RepeatedDuplicatePatternConfig, StaticDuplicateConfig};
61#[cfg(feature = "duplicate-model")]
62pub use duplicate::{RepeatedDuplicatePattern, StaticDuplicate};
63
64#[cfg(feature = "rwnd-model")]
65pub mod rwnd;
66
67#[cfg(feature = "rwnd-model")]
68pub use rwnd::{RepeatedRwndPattern, StaticRwnd};
69#[cfg(feature = "rwnd-model")]
70pub use rwnd::{RepeatedRwndPatternConfig, RwndTraceConfig, StaticRwndConfig};
71
72#[cfg(feature = "truncated-normal")]
73pub mod solve_truncate;