Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in JOIN message specification #1346

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading