1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! Configuration translation to the underlying `peashape` layer.
//!
//! `peaveil` sits on top of `peashape`, which provides the
//! wire-level shaping. The mapping from a [`NodeConfig`] to
//! the corresponding [`peashape::ShapeConfig`] lives here.
//!
//! [`NodeConfig`]: crate::NodeConfig
use crateNodeConfig;
use ShapeConfig;
/// Translates a `peaveil` [`NodeConfig`] into a `peashape`
/// [`ShapeConfig`] for the underlying transport.
///
/// `peaveil`'s discovery traffic is shaped exactly the way
/// `peashape` shapes any other application traffic: as
/// constant-size, constant-rate (or Poisson) frames. The
/// shape-config parameters are the relevant subset of the
/// `peaveil::NodeConfig`:
///
/// - `frame_size` and the lane capacities are passed through
/// unchanged;
/// - `cover` (constant or Poisson) drives the shaping
/// strategy;
/// - `view_size` and `sample_size` are *not* used by the
/// peashape layer; they are peaveil-internal knobs.
///
/// [`NodeConfig`]: crate::NodeConfig
pub