diff options
| author | tv <tv@krebsco.de> | 2026-10-30 18:11:57 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-30 18:11:57 +0100 |
| commit | 46a7d204c81b002f960a9bca97941df7a98c43d4 (patch) | |
| tree | dcf519abd3b5e48dd3c768648fc4d5dca03d6ce3 /src/transport/wire.rs | |
| parent | f65ecfdf313658a3979a2d0add53e342ce4b97df (diff) | |
dashboard: show all links between peers
Diffstat (limited to 'src/transport/wire.rs')
| -rw-r--r-- | src/transport/wire.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/transport/wire.rs b/src/transport/wire.rs index 3e1ab10..87063d2 100644 --- a/src/transport/wire.rs +++ b/src/transport/wire.rs @@ -14,7 +14,7 @@ use super::{MessageKind, ParsedMessage}; /// The wire format's version, the first byte of every payload. Bump it with every change /// to a message type or a codec (`golden_bytes` fails then). -pub(crate) const VERSION: u8 = 7; +pub(crate) const VERSION: u8 = 8; /// What the second byte of a payload says. fn tag(kind: MessageKind) -> u8 { @@ -419,6 +419,10 @@ pub(crate) fn samples() -> Vec<ParsedMessage> { relayed: true, rtt_us: Some(1500), dormant: false, + others: vec![crate::transport::OtherPath { + transport: "mycelium".into(), + rtt_us: None, + }], }], }), ] @@ -591,7 +595,7 @@ mod tests { }); assert_eq!( hex(&encode(&hello).unwrap()), - format!("070097a5737761726d{epoch_hex}01c403010203c3{}07", run("04")) + format!("080097a5737761726d{epoch_hex}01c403010203c3{}07", run("04")) ); let reply = ParsedMessage::HelloReply(HelloReply { @@ -611,7 +615,7 @@ mod tests { assert_eq!( hex(&encode(&reply).unwrap()), format!( - "070199a5737761726d9192a17091a161{epoch_hex}01c400c2{}05{}", + "080199a5737761726d9192a17091a161{epoch_hex}01c400c2{}05{}", run("04"), run("06") ) @@ -626,7 +630,7 @@ mod tests { }); assert_eq!( hex(&encode(&status).unwrap()), - format!("0703959290c400{epoch_hex}01c3c2") + format!("0803959290c400{epoch_hex}01c3c2") ); let who = ParsedMessage::Who(IdentityProof { @@ -635,7 +639,7 @@ mod tests { }); assert_eq!( hex(&encode(&who).unwrap()), - format!("070692c420{}c440{}", "08".repeat(32), "09".repeat(64)) + format!("080692c420{}c440{}", "08".repeat(32), "09".repeat(64)) ); let ParsedMessage::Me(proof) = decode( &encode(&ParsedMessage::Me(IdentityProof { @@ -649,10 +653,10 @@ mod tests { }; assert_eq!((proof.key, proof.signature), ([8; 32], [9; 64])); - assert_eq!(hex(&encode(&ParsedMessage::Ping(7)).unwrap()), "070807"); + assert_eq!(hex(&encode(&ParsedMessage::Ping(7)).unwrap()), "080807"); assert_eq!( hex(&encode(&ParsedMessage::Pong(u64::MAX)).unwrap()), - "0709cfffffffffffffffff" + "0809cfffffffffffffffff" ); let ParsedMessage::Pong(nonce) = decode(&[VERSION, 9, 0x2a]).unwrap() else { panic!("not a PONG"); |
