Struct wintun::Adapter[][src]

pub struct Adapter { /* fields omitted */ }
Expand description

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!

Delete an adapter, consuming it in the process

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 LUID for this adapter

Returns the Win32 interface index of this adapter. Useful for specifying the interface when executing netsh interface ip commands

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.