Skip to content

Commit

Permalink
Merge dev/1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Jul 19, 2024
2 parents 5d56741 + b31a410 commit 68d7279
Show file tree
Hide file tree
Showing 117 changed files with 1,602 additions and 1,175 deletions.
50 changes: 44 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ members = [
exclude = ["ci/nostd-check", "ci/valgrind-check"]

[workspace.package]
rust-version = "1.72.0"
rust-version = "1.75.0"
version = "0.11.0-dev" # Zenoh version
repository = "https://github.com/eclipse-zenoh/zenoh"
homepage = "http://zenoh.io"
Expand Down Expand Up @@ -171,7 +171,7 @@ tokio-rustls = { version = "0.26.0", default-features = false }
# tokio-vsock = see: io/zenoh-links/zenoh-link-vsock/Cargo.toml (workspaces does not support platform dependent dependencies)
thread-priority = "1.1.0"
typenum = "1.16.0"
uhlc = { version = "0.7.0", default-features = false } # Default features are disabled due to usage in no_std crates
uhlc = { version = "0.8.0", default-features = false } # Default features are disabled due to usage in no_std crates
unwrap-infallible = "0.1.5"
unzip-n = "0.1.2"
url = "2.3.1"
Expand Down
37 changes: 22 additions & 15 deletions DEFAULT_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/// The node's metadata (name, location, DNS name, etc.) Arbitrary JSON data not interpreted by zenoh and available in admin space @/<zid>/router, @/<zid>/peer or @/<zid>/client
metadata: {
name: "strawberry",
location: "Penny Lane"
location: "Penny Lane",
},

/// Which endpoints to connect to. E.g. tcp/localhost:7447.
Expand All @@ -23,9 +23,13 @@
/// E.g. tcp/192.168.0.1:7447#iface=eth0, for connect only if the IP address is reachable via the interface eth0
connect: {
/// timeout waiting for all endpoints connected (0: no retry, -1: infinite timeout)
/// Accepts a single value or different values for router, peer and client.
/// Accepts a single value (e.g. timeout_ms: 0)
/// or different values for router, peer and client (e.g. timeout_ms: { router: -1, peer: -1, client: 0 }).
timeout_ms: { router: -1, peer: -1, client: 0 },

/// The list of endpoints to connect to.
/// Accepts a single list (e.g. endpoints: ["tcp/10.10.10.10:7447", "tcp/11.11.11.11:7447"])
/// or different lists for router, peer and client (e.g. endpoints: { router: ["tcp/10.10.10.10:7447"], peer: ["tcp/11.11.11.11:7447"] }).
endpoints: [
// "<proto>/<address>"
],
Expand All @@ -49,19 +53,21 @@
},
},

/// Which endpoints to listen on. E.g. tcp/localhost:7447.
/// Which endpoints to listen on. E.g. tcp/0.0.0.0:7447.
/// By configuring the endpoints, it is possible to tell zenoh which are the endpoints that other routers,
/// peers, or client can use to establish a zenoh session.
/// For TCP/UDP on Linux, it is possible additionally specify the interface to be listened to:
/// E.g. tcp/0.0.0.0:7447#iface=eth0, for listen connection only on eth0
listen: {
/// timeout waiting for all listen endpoints (0: no retry, -1: infinite timeout)
/// Accepts a single value or different values for router, peer and client.
/// Accepts a single value (e.g. timeout_ms: 0)
/// or different values for router, peer and client (e.g. timeout_ms: { router: -1, peer: -1, client: 0 }).
timeout_ms: 0,

endpoints: [
// "<proto>/<address>"
],
/// The list of endpoints to listen on.
/// Accepts a single list (e.g. endpoints: ["tcp/[::]:7447", "udp/[::]:7447"])
/// or different lists for router, peer and client (e.g. endpoints: { router: ["tcp/[::]:7447"], peer: ["tcp/[::]:0"] }).
endpoints: { router: ["tcp/[::]:7447"], peer: ["tcp/[::]:0"] },

/// Global listen configuration,
/// Accepts a single value or different values for router, peer and client.
Expand Down Expand Up @@ -98,9 +104,10 @@
/// The time-to-live on multicast scouting packets
ttl: 1,
/// Which type of Zenoh instances to automatically establish sessions with upon discovery on UDP multicast.
/// Accepts a single value or different values for router, peer and client.
/// Accepts a single value (e.g. autoconnect: ["router", "peer"])
/// or different values for router, peer and client (e.g. autoconnect: { router: [], peer: ["router", "peer"] }).
/// Each value is bit-or-like combinations of "peer", "router" and "client".
autoconnect: { router: "", peer: "router|peer" },
autoconnect: { router: [], peer: ["router", "peer"] },
/// Whether or not to listen for scout messages on UDP multicast and reply to them.
listen: true,
},
Expand All @@ -115,9 +122,10 @@
/// direct connectivity with each other.
multihop: false,
/// Which type of Zenoh instances to automatically establish sessions with upon discovery on gossip.
/// Accepts a single value or different values for router, peer and client.
/// Accepts a single value (e.g. autoconnect: ["router", "peer"])
/// or different values for router, peer and client (e.g. autoconnect: { router: [], peer: ["router", "peer"] }).
/// Each value is bit-or-like combinations of "peer", "router" and "client".
autoconnect: { router: "", peer: "router|peer" },
autoconnect: { router: [], peer: ["router", "peer"] },
},
},

Expand Down Expand Up @@ -200,7 +208,7 @@
// "interfaces": [
// "lo0"
// ],
// /// Subjects can be cert_common_names when using TLS or Quic
// /// Subjects can be cert_common_names when using TLS or Quic
// "cert_common_names": [
// "example.zenoh.io"
// ],
Expand Down Expand Up @@ -230,7 +238,7 @@
/// NOTE: Currently, the LowLatency transport doesn't preserve QoS prioritization.
/// NOTE: Due to the note above, 'lowlatency' is incompatible with 'qos' option, so in order to
/// enable 'lowlatency' you need to explicitly disable 'qos'.
/// NOTE: LowLatency transport does not support the fragmentation, so the message size should be
/// NOTE: LowLatency transport does not support the fragmentation, so the message size should be
/// smaller than the tx batch_size.
lowlatency: false,
/// Enables QoS on unicast communications.
Expand Down Expand Up @@ -309,7 +317,7 @@
/// Using CongestionControl::Drop the message might be dropped, depending on conditions configured here.
congestion_control: {
/// The maximum time in microseconds to wait for an available batch before dropping the message if still no batch is available.
wait_before_drop: 1000
wait_before_drop: 1000,
},
/// The initial exponential backoff time in nanoseconds to allow the batching to eventually progress.
/// Higher values lead to a more aggressive batching but it will introduce additional latency.
Expand Down Expand Up @@ -531,5 +539,4 @@
// __config__: "./plugins/zenoh-plugin-storage-manager/config.json5",
// }
// },

}
5 changes: 4 additions & 1 deletion ci/valgrind-check/src/queryable_get/bin/z_queryable_get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
use std::{convert::TryFrom, time::Duration};

use zenoh::{
config::Config, key_expr::KeyExpr, prelude::*, query::QueryTarget, selector::Selector,
config::Config,
key_expr::KeyExpr,
prelude::*,
query::{QueryTarget, Selector},
};

#[tokio::main]
Expand Down
29 changes: 28 additions & 1 deletion commons/zenoh-codec/src/core/shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>
//
use std::num::NonZeroUsize;

use zenoh_buffers::{
reader::{DidntRead, Reader},
writer::{DidntWrite, Writer},
Expand Down Expand Up @@ -62,6 +64,18 @@ where
}
}

impl<W> WCodec<NonZeroUsize, &mut W> for Zenoh080
where
W: Writer,
{
type Output = Result<(), DidntWrite>;

fn write(self, writer: &mut W, x: NonZeroUsize) -> Self::Output {
self.write(&mut *writer, x.get())?;
Ok(())
}
}

impl<W> WCodec<&ShmBufInfo, &mut W> for Zenoh080
where
W: Writer,
Expand All @@ -80,7 +94,7 @@ where

self.write(&mut *writer, data_descriptor)?;
self.write(&mut *writer, shm_protocol)?;
self.write(&mut *writer, data_len)?;
self.write(&mut *writer, *data_len)?;
self.write(&mut *writer, watchdog_descriptor)?;
self.write(&mut *writer, header_descriptor)?;
self.write(&mut *writer, generation)?;
Expand Down Expand Up @@ -138,6 +152,19 @@ where
}
}

impl<R> RCodec<NonZeroUsize, &mut R> for Zenoh080
where
R: Reader,
{
type Error = DidntRead;

fn read(self, reader: &mut R) -> Result<NonZeroUsize, Self::Error> {
let size: usize = self.read(&mut *reader)?;
let size = NonZeroUsize::new(size).ok_or(DidntRead)?;
Ok(size)
}
}

impl<R> RCodec<ShmBufInfo, &mut R> for Zenoh080
where
R: Reader,
Expand Down
28 changes: 28 additions & 0 deletions commons/zenoh-config/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,34 @@ pub mod routing {
}
}

impl Default for ListenConfig {
#[allow(clippy::unnecessary_cast)]
fn default() -> Self {
Self {
timeout_ms: None,
endpoints: ModeDependentValue::Dependent(ModeValues {
router: Some(vec!["tcp/[::]:7447".parse().unwrap()]),
peer: Some(vec!["tcp/[::]:0".parse().unwrap()]),
client: None,
}),
exit_on_failure: None,
retry: None,
}
}
}

impl Default for ConnectConfig {
#[allow(clippy::unnecessary_cast)]
fn default() -> Self {
Self {
timeout_ms: None,
endpoints: ModeDependentValue::Unique(vec![]),
exit_on_failure: None,
retry: None,
}
}
}

impl Default for TransportUnicastConf {
fn default() -> Self {
Self {
Expand Down
Loading

0 comments on commit 68d7279

Please sign in to comment.