-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
588 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# | ||
# Copyright (c) 2024 ZettaScale Technology | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
# which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
# | ||
# Contributors: | ||
# ZettaScale Zenoh Team, <[email protected]> | ||
# | ||
[package] | ||
rust-version = { workspace = true } | ||
name = "zenoh-link-vsock" | ||
version = { workspace = true } | ||
repository = { workspace = true } | ||
homepage = { workspace = true } | ||
authors = { workspace = true } | ||
edition = { workspace = true } | ||
license = { workspace = true } | ||
categories = { workspace = true } | ||
description = "Internal crate for zenoh." | ||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
async-trait = { workspace = true } | ||
tokio = { workspace = true, features = ["net", "io-util", "rt", "time"] } | ||
tokio-util = { workspace = true, features = ["rt"] } | ||
log = { workspace = true } | ||
libc = { workspace = true } | ||
zenoh-core = { workspace = true } | ||
zenoh-link-commons = { workspace = true } | ||
zenoh-protocol = { workspace = true } | ||
zenoh-result = { workspace = true } | ||
zenoh-sync = { workspace = true } | ||
zenoh-util = { workspace = true } | ||
zenoh-runtime = { workspace = true } | ||
|
||
[target.'cfg(target_os = "linux")'.dependencies] | ||
tokio-vsock = "0.5.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// | ||
// Copyright (c) 2024 ZettaScale Technology | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License 2.0 which is available at | ||
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
// which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
// | ||
// Contributors: | ||
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
|
||
//! ⚠️ WARNING ⚠️ | ||
//! | ||
//! This crate is intended for Zenoh's internal use. | ||
//! | ||
//! [Click here for Zenoh's documentation](../zenoh/index.html) | ||
use async_trait::async_trait; | ||
use zenoh_core::zconfigurable; | ||
use zenoh_link_commons::LocatorInspector; | ||
use zenoh_protocol::core::Locator; | ||
use zenoh_result::ZResult; | ||
|
||
#[cfg(target_os = "linux")] | ||
mod unicast; | ||
#[cfg(target_os = "linux")] | ||
pub use unicast::*; | ||
|
||
pub const VSOCK_LOCATOR_PREFIX: &str = "vsock"; | ||
|
||
#[derive(Default, Clone, Copy)] | ||
pub struct VsockLocatorInspector; | ||
#[async_trait] | ||
impl LocatorInspector for VsockLocatorInspector { | ||
fn protocol(&self) -> &str { | ||
VSOCK_LOCATOR_PREFIX | ||
} | ||
|
||
async fn is_multicast(&self, _locator: &Locator) -> ZResult<bool> { | ||
Ok(false) | ||
} | ||
} | ||
|
||
zconfigurable! { | ||
// Default MTU in bytes. | ||
static ref VSOCK_DEFAULT_MTU: u16 = u16::MAX; | ||
// Amount of time in microseconds to throttle the accept loop upon an error. | ||
// Default set to 100 ms. | ||
static ref VSOCK_ACCEPT_THROTTLE_TIME: u64 = 100_000; | ||
} |
Oops, something went wrong.