diff --git a/Cargo.toml b/Cargo.toml index 29f491c..30f1d01 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ default-features = true features = [ "heapless" ] [dependencies.smoltcp] -git = "https://github.com/smoltcp-rs/smoltcp.git" +version = "0.7.0" default-features = false features = ["ethernet", "proto-ipv4", "proto-ipv6", "socket-tcp", "alloc"] diff --git a/src/set.rs b/src/set.rs index 357f90e..838c85c 100644 --- a/src/set.rs +++ b/src/set.rs @@ -6,8 +6,8 @@ use net::phy::Device; use net::iface::EthernetInterface; use net::time::Instant; -pub struct TlsSocketSet<'a, 'b, 'c> { - tls_sockets: ManagedSlice<'a, Option>> +pub struct TlsSocketSet<'a> { + tls_sockets: ManagedSlice<'a, Option>> } #[derive(Clone, Copy, Debug)] @@ -19,17 +19,17 @@ impl TlsSocketHandle { } } -impl<'a, 'b, 'c> TlsSocketSet<'a, 'b, 'c> { +impl<'a> TlsSocketSet<'a> { pub fn new(tls_sockets: T) -> Self where - T: Into>>> + T: Into>>> { Self { tls_sockets: tls_sockets.into() } } - pub fn add(&mut self, socket: TlsSocket<'a, 'b, 'c>) -> TlsSocketHandle + pub fn add(&mut self, socket: TlsSocket<'a>) -> TlsSocketHandle { for (index, slot) in self.tls_sockets.iter_mut().enumerate() { if slot.is_none() { @@ -51,7 +51,7 @@ impl<'a, 'b, 'c> TlsSocketSet<'a, 'b, 'c> { } } - pub fn get(&mut self, handle: TlsSocketHandle) -> &mut TlsSocket<'a, 'b, 'c> { + pub fn get(&mut self, handle: TlsSocketHandle) -> &mut TlsSocket<'a> { self.tls_sockets[handle.0].as_mut().unwrap() } diff --git a/src/tcp_stack.rs b/src/tcp_stack.rs index 4d273b7..9ff9382 100644 --- a/src/tcp_stack.rs +++ b/src/tcp_stack.rs @@ -21,14 +21,14 @@ pub enum NetworkError { } // Structure for implementaion TcpStack interface -pub struct NetworkStack<'a, 'b, 'c> { - sockets: RefCell>, +pub struct NetworkStack<'a> { + sockets: RefCell>, next_port: RefCell, unused_handles: RefCell> } -impl<'a, 'b, 'c> NetworkStack<'a, 'b, 'c> { - pub fn new(sockets: SocketSet<'a, 'b, 'c>) -> Self { +impl<'a> NetworkStack<'a> { + pub fn new(sockets: SocketSet<'a>) -> Self { let mut vec = Vec::new(); log::info!("socket set size: {:?}", sockets.len()); for index in 0..sockets.len() { @@ -67,7 +67,7 @@ impl<'a, 'b, 'c> NetworkStack<'a, 'b, 'c> { } } -impl<'a, 'b, 'c> TcpStack for NetworkStack<'a, 'b, 'c> { +impl<'a> TcpStack for NetworkStack<'a> { type TcpSocket = SocketHandle; type Error = NetworkError; diff --git a/src/tls.rs b/src/tls.rs index 94e9f96..697611e 100644 --- a/src/tls.rs +++ b/src/tls.rs @@ -59,22 +59,22 @@ pub(crate) enum TlsState { SERVER_CONNECTED } -pub struct TlsSocket<'a, 'b, 'c> +pub struct TlsSocket<'a> { // Locally owned SocketSet, solely containing 1 TCP socket - sockets: SocketSet<'a, 'b, 'c>, + sockets: SocketSet<'a>, tcp_handle: SocketHandle, - rng: &'b mut dyn crate::TlsRng, - session: RefCell>, + rng: &'a mut dyn crate::TlsRng, + session: RefCell>, } -impl<'a, 'b, 'c> TlsSocket<'a, 'b, 'c> { +impl<'a> TlsSocket<'a> { pub fn new( - tcp_socket: TcpSocket<'b>, - rng: &'b mut dyn crate::TlsRng, + tcp_socket: TcpSocket<'a>, + rng: &'a mut dyn crate::TlsRng, certificate_with_key: Option<( crate::session::CertificatePrivateKey, - Vec<&'b [u8]> + Vec<&'a [u8]> )> ) -> Self { @@ -2095,7 +2095,7 @@ impl<'a, 'b, 'c> TlsSocket<'a, 'b, 'c> { } use core::fmt; -impl<'a, 'b, 'c> fmt::Write for TlsSocket<'a, 'b, 'c> { +impl<'a> fmt::Write for TlsSocket<'a> { fn write_str(&mut self, slice: &str) -> fmt::Result { let slice = slice.as_bytes(); if self.send_slice(slice) == Ok(slice.len()) {