mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-22 00:50:52 +00:00
mio::event::Source
This commit is contained in:
parent
8aeaf238f2
commit
3e7a4dc8b2
4 changed files with 32 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
|||
use mio::{event, Interest, Registry, Token};
|
||||
use smoltcp::{
|
||||
phy::{self, Device, DeviceCapabilities, Medium},
|
||||
time::Instant,
|
||||
|
@ -22,6 +23,20 @@ pub struct WinTunInterface {
|
|||
// }
|
||||
// }
|
||||
|
||||
impl event::Source for WinTunInterface {
|
||||
fn register(&mut self, _registry: &Registry, _token: Token, _interests: Interest) -> io::Result<()> {
|
||||
Err(io::Error::new(io::ErrorKind::Other, "register"))
|
||||
}
|
||||
|
||||
fn reregister(&mut self, _registry: &Registry, _token: Token, _interests: Interest) -> io::Result<()> {
|
||||
Err(io::Error::new(io::ErrorKind::Other, "reregister"))
|
||||
}
|
||||
|
||||
fn deregister(&mut self, _registry: &Registry) -> io::Result<()> {
|
||||
Err(io::Error::new(io::ErrorKind::Other, "deregister"))
|
||||
}
|
||||
}
|
||||
|
||||
impl WinTunInterface {
|
||||
pub fn new(name: &str, medium: Medium) -> io::Result<WinTunInterface> {
|
||||
let wintun = unsafe { wintun::load() }.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue