Struct wintun::Adapter [−][src]
pub struct Adapter { /* fields omitted */ }
Expand description
Wrapper around a https://git.zx2c4.com/wintun/about/#wintun_adapter_handle
Implementations
Creates a new wintun adapter inside the pool pool
with name name
Optionally a GUID can be specified that will become the GUID of this adapter once created.
Adapters obtained via this function will be able to return their adapter index via
Adapter::get_adapter_index
Attempts to open an existing wintun interface name name
.
Adapters opened via this call will have an unknown GUID meaning Adapter::get_adapter_index
will always fail because knowing the adapter’s GUID is required to determine its index.
Currently a workaround is to delete and re-create a new adapter every time one is needed so
that it gets created with a known GUID, allowing Adapter::get_adapter_index
to works as
expected. There is likely a way to get the GUID of our adapter using the Windows Registry
or via the Win32 API, so PR’s that solve this issue are always welcome!
Initiates a new wintun session on the given adapter.
Capacity is the size in bytes of the ring buffer used internally by the driver. Must be
a power of two between crate::MIN_RING_CAPACITY
and crate::MIN_RING_CAPACITY
.
Returns the Win32 interface index of this adapter. Useful for specifying the interface
when executing netsh interface ip
commands