Skip to content

Commit

Permalink
Merge pull request #1346 from fuzzypixelz/fix-protocol-typos
Browse files Browse the repository at this point in the history
Fix typos in `JOIN` message specification
  • Loading branch information
Mallets authored Sep 2, 2024
2 parents 983908b + dfeec61 commit 5dc5f85
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions commons/zenoh-protocol/src/transport/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ use crate::{
///
/// ```text
/// Flags:
/// - T: Lease period if T==1 then the lease period is in seconds else in milliseconds
/// - T: Lease period if T==1 then the lease period is in seconds otherwise it is in milliseconds
/// - S: Size params If S==1 then size parameters are exchanged
/// - Z: Extensions If Z==1 then zenoh extensions will follow.
/// - Z: Extensions If Z==1 then Zenoh extensions will follow.
///
/// 7 6 5 4 3 2 1 0
/// +-+-+-+-+-+-+-+-+
Expand All @@ -51,7 +51,7 @@ use crate::{
/// +---------------+
/// |zid_len|x|x|wai| (#)(*)
/// +-------+-+-+---+
/// ~ [u8] ~ -- ZenohID of the sender of the INIT message
/// ~ [u8] ~ -- ZenohID of the sender of the JOIN message
/// +---------------+
/// |x|x|x|x|rid|fsn| \ -- SN/ID resolution (+)
/// +---------------+ | if Flag(S)==1
Expand All @@ -60,13 +60,11 @@ use crate::{
/// +---------------+
/// % lease % -- Lease period of the sender of the JOIN message
/// +---------------+
/// % next_sn % -- Next SN to be sent by the sender of the JOIN(^)
/// % next_sn % -- Next SN to be sent by the sender of the JOIN message (^)
/// +---------------+
/// ~ [JoinExts] ~ -- if Flag(Z)==1
/// +---------------+
///
/// If A==1 and S==0 then size parameters are (ie. S flag) are accepted.
///
/// (*) WhatAmI. It indicates the role of the zenoh node sending the JOIN message.
/// The valid WhatAmI values are:
/// - 0b00: Router
Expand All @@ -93,14 +91,6 @@ use crate::{
///
/// (^) The next sequence number MUST be compatible with the adverstised Sequence Number resolution
/// ```
///
pub mod flag {
pub const T: u8 = 1 << 5; // 0x20 Lease period if T==1 then the lease period is in seconds else in milliseconds
pub const S: u8 = 1 << 6; // 0x40 Size params if S==1 then size parameters are advertised
pub const Z: u8 = 1 << 7; // 0x80 Extensions if Z==1 then an extension will follow
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Join {
pub version: u8,
Expand All @@ -114,6 +104,12 @@ pub struct Join {
pub ext_shm: Option<ext::Shm>,
}

pub mod flag {
pub const T: u8 = 1 << 5; // 0x20 Lease period if T==1 then the lease period is in seconds else in milliseconds
pub const S: u8 = 1 << 6; // 0x40 Size params if S==1 then size parameters are advertised
pub const Z: u8 = 1 << 7; // 0x80 Extensions if Z==1 then an extension will follow
}

// Extensions
pub mod ext {
use alloc::boxed::Box;
Expand Down

0 comments on commit 5dc5f85

Please sign in to comment.