Implement TunInterfaceOptions
This commit is contained in:
parent
da065b503f
commit
84f1d91d5c
6 changed files with 83 additions and 9 deletions
|
|
@ -15,7 +15,7 @@ mod sys;
|
|||
|
||||
pub use super::queue::TunQueue;
|
||||
|
||||
use super::{ifname_to_string, string_to_ifname};
|
||||
use super::{ifname_to_string, string_to_ifname, TunInterfaceOptions};
|
||||
use kern_control::SysControlSocket;
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
@ -26,6 +26,11 @@ pub struct TunInterface {
|
|||
impl TunInterface {
|
||||
#[throws]
|
||||
pub fn new() -> TunInterface {
|
||||
Self::new_with_options(TunInterfaceOptions::new())?
|
||||
}
|
||||
|
||||
#[throws]
|
||||
pub fn new_with_options(_: TunInterfaceOptions) -> TunInterface {
|
||||
TunInterface::connect(0)?
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue