aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/traffic.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-06 16:47:32 +0100
committertv <tv@krebsco.de>2026-11-06 16:47:32 +0100
commitab8f5447680da56ce658abbc33c222219c3204ef (patch)
tree93ed572d120cf29b7e440c31194bafd021e8a5a6 /src/transport/traffic.rs
parent7c0f90b327ad567c4e5e6a96cda433d774182dac (diff)
plumtree
Diffstat (limited to 'src/transport/traffic.rs')
-rw-r--r--src/transport/traffic.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/transport/traffic.rs b/src/transport/traffic.rs
index 2e4266c..501c77b 100644
--- a/src/transport/traffic.rs
+++ b/src/transport/traffic.rs
@@ -55,6 +55,8 @@ pub(crate) struct ByKind {
pub(crate) links: Counter,
/// PROBE and PROBE_REPLY (`swarm::working_links`).
pub(crate) probe: Counter,
+ /// PRUNE and GRAFT (`swarm::plumtree`).
+ pub(crate) plumtree: Counter,
}
impl ByKind {
@@ -70,6 +72,7 @@ impl ByKind {
MessageKind::Ping,
MessageKind::Links,
MessageKind::Probe,
+ MessageKind::Prune,
] {
let theirs = *other.get(kind);
self.get_mut(kind).absorb(theirs);
@@ -88,6 +91,7 @@ impl ByKind {
MessageKind::Ping | MessageKind::Pong => &self.paths,
MessageKind::Links | MessageKind::LinksReply => &self.links,
MessageKind::Probe | MessageKind::ProbeReply => &self.probe,
+ MessageKind::Prune | MessageKind::Graft => &self.plumtree,
}
}
@@ -103,6 +107,7 @@ impl ByKind {
MessageKind::Ping | MessageKind::Pong => &mut self.paths,
MessageKind::Links | MessageKind::LinksReply => &mut self.links,
MessageKind::Probe | MessageKind::ProbeReply => &mut self.probe,
+ MessageKind::Prune | MessageKind::Graft => &mut self.plumtree,
}
}
}
@@ -295,6 +300,8 @@ fn names(kind: MessageKind) -> (&'static str, &'static str) {
MessageKind::LinksReply => ("LINKS_REPLY", "links"),
MessageKind::Probe => ("PROBE", "probe"),
MessageKind::ProbeReply => ("PROBE_REPLY", "probe"),
+ MessageKind::Prune => ("PRUNE", "plumtree"),
+ MessageKind::Graft => ("GRAFT", "plumtree"),
}
}