diff --git a/src/iface/interface.rs b/src/iface/interface.rs index 3a4f605..50f9d0f 100644 --- a/src/iface/interface.rs +++ b/src/iface/interface.rs @@ -555,6 +555,16 @@ where &mut self.device } + /// Get an iterator to the inner sockets. + pub fn sockets(&self) -> impl Iterator> { + self.sockets.iter() + } + + /// Get a mutable iterator to the inner sockets. + pub fn sockets_mut(&mut self) -> impl Iterator> { + self.sockets.iter_mut() + } + /// Add an address to a list of subscribed multicast IP addresses. /// /// Returns `Ok(announce_sent)` if the address was added successfully, where `annouce_sent`