diff --git a/commons/zenoh-util/src/std_only/net/mod.rs b/commons/zenoh-util/src/std_only/net/mod.rs index 4fad541d1e..67e732d3ee 100644 --- a/commons/zenoh-util/src/std_only/net/mod.rs +++ b/commons/zenoh-util/src/std_only/net/mod.rs @@ -361,7 +361,7 @@ pub fn get_index_of_interface(addr: IpAddr) -> ZResult { } } -pub fn get_interfaces_by_addr(addr: IpAddr) -> ZResult> { +pub fn get_interface_names_by_addr(addr: IpAddr) -> ZResult> { #[cfg(unix)] { if addr.is_unspecified() { diff --git a/io/zenoh-link-commons/src/lib.rs b/io/zenoh-link-commons/src/lib.rs index 2d5bf243f1..b15a0d9ad5 100644 --- a/io/zenoh-link-commons/src/lib.rs +++ b/io/zenoh-link-commons/src/lib.rs @@ -72,7 +72,7 @@ impl From<&LinkUnicast> for Link { mtu: link.get_mtu(), is_reliable: link.is_reliable(), is_streamed: link.is_streamed(), - interfaces: link.get_interfaces(), + interfaces: link.get_interface_names(), } } } diff --git a/io/zenoh-link-commons/src/unicast.rs b/io/zenoh-link-commons/src/unicast.rs index 3b4a69b707..19e90c3b2c 100644 --- a/io/zenoh-link-commons/src/unicast.rs +++ b/io/zenoh-link-commons/src/unicast.rs @@ -45,7 +45,7 @@ pub trait LinkUnicastTrait: Send + Sync { fn get_dst(&self) -> &Locator; fn is_reliable(&self) -> bool; fn is_streamed(&self) -> bool; - fn get_interfaces(&self) -> Vec; + fn get_interface_names(&self) -> Vec; async fn write(&self, buffer: &[u8]) -> ZResult; async fn write_all(&self, buffer: &[u8]) -> ZResult<()>; async fn read(&self, buffer: &mut [u8]) -> ZResult; diff --git a/io/zenoh-links/zenoh-link-quic/src/unicast.rs b/io/zenoh-links/zenoh-link-quic/src/unicast.rs index 856c0f37d8..dfc70dca28 100644 --- a/io/zenoh-links/zenoh-link-quic/src/unicast.rs +++ b/io/zenoh-links/zenoh-link-quic/src/unicast.rs @@ -144,8 +144,9 @@ impl LinkUnicastTrait for LinkUnicastQuic { } #[inline(always)] - fn get_interfaces(&self) -> Vec { - // Not supported for now + fn get_interface_names(&self) -> Vec { + // @TODO: Not supported for now + log::debug!("The get_interface_names for LinkUnicastQuic is not supported"); vec![] } diff --git a/io/zenoh-links/zenoh-link-serial/src/unicast.rs b/io/zenoh-links/zenoh-link-serial/src/unicast.rs index 25d0f6306a..51d734f91b 100644 --- a/io/zenoh-links/zenoh-link-serial/src/unicast.rs +++ b/io/zenoh-links/zenoh-link-serial/src/unicast.rs @@ -182,8 +182,9 @@ impl LinkUnicastTrait for LinkUnicastSerial { } #[inline(always)] - fn get_interfaces(&self) -> Vec { - // Not supported for now + fn get_interface_names(&self) -> Vec { + // @TODO: Not supported for now + log::debug!("The get_interface_names for LinkUnicastSerial is not supported"); vec![] } diff --git a/io/zenoh-links/zenoh-link-tcp/src/unicast.rs b/io/zenoh-links/zenoh-link-tcp/src/unicast.rs index 71a87df605..3876a947ca 100644 --- a/io/zenoh-links/zenoh-link-tcp/src/unicast.rs +++ b/io/zenoh-links/zenoh-link-tcp/src/unicast.rs @@ -145,19 +145,19 @@ impl LinkUnicastTrait for LinkUnicastTcp { } #[inline(always)] - fn get_interfaces(&self) -> Vec { - match zenoh_util::net::get_interfaces_by_addr(self.src_addr.ip()) { + fn get_interface_names(&self) -> Vec { + match zenoh_util::net::get_interface_names_by_addr(self.src_addr.ip()) { Ok(interfaces) => { - log::debug!( - "get_interfaces for {:?}: {:?}", + log::trace!( + "get_interface_names for {:?}: {:?}", self.src_addr.ip(), interfaces ); interfaces } Err(e) => { - log::error!( - "get_interfaces for {:?} failed: {:?}", + log::debug!( + "get_interface_names for {:?} failed: {:?}", self.src_addr.ip(), e ); diff --git a/io/zenoh-links/zenoh-link-tls/src/unicast.rs b/io/zenoh-links/zenoh-link-tls/src/unicast.rs index de3b616d05..383b03a366 100644 --- a/io/zenoh-links/zenoh-link-tls/src/unicast.rs +++ b/io/zenoh-links/zenoh-link-tls/src/unicast.rs @@ -196,8 +196,9 @@ impl LinkUnicastTrait for LinkUnicastTls { } #[inline(always)] - fn get_interfaces(&self) -> Vec { - // Not supported for now + fn get_interface_names(&self) -> Vec { + // @TODO: Not supported for now + log::debug!("The get_interface_names for LinkUnicastTls is not supported"); vec![] } diff --git a/io/zenoh-links/zenoh-link-udp/src/unicast.rs b/io/zenoh-links/zenoh-link-udp/src/unicast.rs index 016a557740..210c6f7b7a 100644 --- a/io/zenoh-links/zenoh-link-udp/src/unicast.rs +++ b/io/zenoh-links/zenoh-link-udp/src/unicast.rs @@ -209,19 +209,19 @@ impl LinkUnicastTrait for LinkUnicastUdp { } #[inline(always)] - fn get_interfaces(&self) -> Vec { - match zenoh_util::net::get_interfaces_by_addr(self.src_addr.ip()) { + fn get_interface_names(&self) -> Vec { + match zenoh_util::net::get_interface_names_by_addr(self.src_addr.ip()) { Ok(interfaces) => { - log::debug!( - "get_interfaces for {:?}: {:?}", + log::trace!( + "get_interface_names for {:?}: {:?}", self.src_addr.ip(), interfaces ); interfaces } Err(e) => { - log::error!( - "get_interfaces for {:?} failed: {:?}", + log::debug!( + "get_interface_names for {:?} failed: {:?}", self.src_addr.ip(), e ); diff --git a/io/zenoh-links/zenoh-link-unixpipe/src/unix/unicast.rs b/io/zenoh-links/zenoh-link-unixpipe/src/unix/unicast.rs index 2add468eef..83f6414dee 100644 --- a/io/zenoh-links/zenoh-link-unixpipe/src/unix/unicast.rs +++ b/io/zenoh-links/zenoh-link-unixpipe/src/unix/unicast.rs @@ -493,8 +493,9 @@ impl LinkUnicastTrait for UnicastPipe { } #[inline(always)] - fn get_interfaces(&self) -> Vec { - // Not supported for now + fn get_interface_names(&self) -> Vec { + // @TODO: Not supported for now + log::debug!("The get_interface_names for UnicastPipe is not supported"); vec![] } diff --git a/io/zenoh-links/zenoh-link-unixsock_stream/src/unicast.rs b/io/zenoh-links/zenoh-link-unixsock_stream/src/unicast.rs index 5e2e4b0d43..3ac1bcbfe6 100644 --- a/io/zenoh-links/zenoh-link-unixsock_stream/src/unicast.rs +++ b/io/zenoh-links/zenoh-link-unixsock_stream/src/unicast.rs @@ -116,8 +116,9 @@ impl LinkUnicastTrait for LinkUnicastUnixSocketStream { } #[inline(always)] - fn get_interfaces(&self) -> Vec { - // Not supported for now + fn get_interface_names(&self) -> Vec { + // @TODO: Not supported for now + log::debug!("The get_interface_names for LinkUnicastUnixSocketStream is not supported"); vec![] } diff --git a/io/zenoh-links/zenoh-link-ws/src/unicast.rs b/io/zenoh-links/zenoh-link-ws/src/unicast.rs index 9252f9e326..4276e2bfaf 100644 --- a/io/zenoh-links/zenoh-link-ws/src/unicast.rs +++ b/io/zenoh-links/zenoh-link-ws/src/unicast.rs @@ -208,8 +208,9 @@ impl LinkUnicastTrait for LinkUnicastWs { } #[inline(always)] - fn get_interfaces(&self) -> Vec { - // Not supported for now + fn get_interface_names(&self) -> Vec { + // @TODO: Not supported for now + log::debug!("The get_interface_names for LinkUnicastWs is not supported"); vec![] }