changed the iface name from Demo to name, then, should write a library

for android
This commit is contained in:
asxalex 2024-07-06 00:09:14 +08:00
parent 53bccdd53b
commit f059b78204

View File

@ -80,9 +80,9 @@ impl Iface {
fn create_wintun(path: &str,name: &str) -> Iface { fn create_wintun(path: &str,name: &str) -> Iface {
let wt = unsafe { wintun::load_from_path(path) }.expect("failed to load wintun"); let wt = unsafe { wintun::load_from_path(path) }.expect("failed to load wintun");
let adapter = match wintun::Adapter::open(&wt, "Demo") { let adapter = match wintun::Adapter::open(&wt, name) {
Ok(a) => a, Ok(a) => a,
Err(e) => wintun::Adapter::create(&wt, "Demo", "Example", None) Err(e) => wintun::Adapter::create(&wt, name, "Example", None)
.expect("failed to create wintun adapter"), .expect("failed to create wintun adapter"),
}; };
let session = Arc::new(adapter.start_session(wintun::MAX_RING_CAPACITY).unwrap()); let session = Arc::new(adapter.start_session(wintun::MAX_RING_CAPACITY).unwrap());