OpenVPN
|
Go to the source code of this file.
Data Structures | |
struct | tap_adapter_node |
Network adapter list node. More... | |
Functions | |
DWORD | tap_create_adapter (_In_opt_ HWND hwndParent, _In_opt_ LPCTSTR szDeviceDescription, _In_ LPCTSTR szHwId, _Inout_ LPBOOL pbRebootRequired, _Out_ LPGUID pguidAdapter) |
Creates a TUN/TAP adapter. More... | |
DWORD | tap_delete_adapter (_In_opt_ HWND hwndParent, _In_ LPCGUID pguidAdapter, _Inout_ LPBOOL pbRebootRequired) |
Deletes an adapter. More... | |
DWORD | tap_enable_adapter (_In_opt_ HWND hwndParent, _In_ LPCGUID pguidAdapter, _In_ BOOL bEnable, _Inout_ LPBOOL pbRebootRequired) |
Enables or disables an adapter. More... | |
DWORD | tap_set_adapter_name (_In_ LPCGUID pguidAdapter, _In_ LPCTSTR szName, _In_ BOOL bSilent) |
Sets adapter name. More... | |
DWORD | tap_list_adapters (_In_opt_ HWND hwndParent, _In_opt_ LPCTSTR szzHwIDs, _Out_ struct tap_adapter_node **ppAdapterList) |
Creates a list of existing network adapters. More... | |
void | tap_free_adapter_list (_In_ struct tap_adapter_node *pAdapterList) |
Frees a list of network adapters. More... | |
DWORD tap_create_adapter | ( | _In_opt_ HWND | hwndParent, |
_In_opt_ LPCTSTR | szDeviceDescription, | ||
_In_ LPCTSTR | szHwId, | ||
_Inout_ LPBOOL | pbRebootRequired, | ||
_Out_ LPGUID | pguidAdapter | ||
) |
Creates a TUN/TAP adapter.
hwndParent | A handle to the top-level window to use for any user adapter that is related to non-device-specific actions (such as a select-device dialog box that uses the global class driver list). This handle is optional and can be NULL. If a specific top-level window is not required, set hwndParent to NULL. |
szDeviceDescription | A pointer to a NULL-terminated string that supplies the text description of the device. This pointer is optional and can be NULL. |
szHwId | A pointer to a NULL-terminated string that supplies the hardware id of the device (e.g. "root\\tap0901", "Wintun"). |
pbRebootRequired | A pointer to a BOOL flag. If the device requires a system restart, this flag is set to TRUE. Otherwise, the flag is left unmodified. This allows the flag to be globally initialized to FALSE and reused for multiple adapter manipulations. |
pguidAdapter | A pointer to GUID that receives network adapter ID. |
Definition at line 723 of file tap.c.
References check_reboot(), find_function(), get_net_adapter_guid(), GUID_DEVCLASS_NET, M_ERRNO, M_NONFATAL, and msg.
Referenced by _tmain(), and ProcessDeferredAction().
DWORD tap_delete_adapter | ( | _In_opt_ HWND | hwndParent, |
_In_ LPCGUID | pguidAdapter, | ||
_Inout_ LPBOOL | pbRebootRequired | ||
) |
Deletes an adapter.
hwndParent | A handle to the top-level window to use for any user adapter that is related to non-device-specific actions (such as a select-device dialog box that uses the global class driver list). This handle is optional and can be NULL. If a specific top-level window is not required, set hwndParent to NULL. |
pguidAdapter | A pointer to GUID that contains network adapter ID. |
pbRebootRequired | A pointer to a BOOL flag. If the device requires a system restart, this flag is set to TRUE. Otherwise, the flag is left unmodified. This allows the flag to be globally initialized to FALSE and reused for multiple adapter manipulations. |
Definition at line 1005 of file tap.c.
References delete_device(), and execute_on_first_adapter().
Referenced by _tmain(), and ProcessDeferredAction().
DWORD tap_enable_adapter | ( | _In_opt_ HWND | hwndParent, |
_In_ LPCGUID | pguidAdapter, | ||
_In_ BOOL | bEnable, | ||
_Inout_ LPBOOL | pbRebootRequired | ||
) |
Enables or disables an adapter.
hwndParent | A handle to the top-level window to use for any user adapter that is related to non-device-specific actions (such as a select-device dialog box that uses the global class driver list). This handle is optional and can be NULL. If a specific top-level window is not required, set hwndParent to NULL. |
pguidAdapter | A pointer to GUID that contains network adapter ID. |
bEnable | TRUE to enable; FALSE to disable |
pbRebootRequired | A pointer to a BOOL flag. If the device requires a system restart, this flag is set to TRUE. Otherwise, the flag is left unmodified. This allows the flag to be globally initialized to FALSE and reused for multiple adapter manipulations. |
Definition at line 1015 of file tap.c.
References disable_device(), enable_device(), and execute_on_first_adapter().
Referenced by ProcessDeferredAction().
void tap_free_adapter_list | ( | _In_ struct tap_adapter_node * | pAdapterList | ) |
Frees a list of network adapters.
pAdapterList | A pointer to the first adapter in the list to free. |
Definition at line 1355 of file tap.c.
References tap_adapter_node::pNext.
Referenced by _tmain(), find_adapters(), ProcessDeferredAction(), schedule_adapter_create(), and schedule_adapter_delete().
DWORD tap_list_adapters | ( | _In_opt_ HWND | hwndParent, |
_In_opt_ LPCTSTR | szzHwIDs, | ||
_Out_ struct tap_adapter_node ** | ppAdapterList | ||
) |
Creates a list of existing network adapters.
hwndParent | A handle to the top-level window to use for any user adapter that is related to non-device-specific actions (such as a select-device dialog box that uses the global class driver list). This handle is optional and can be NULL. If a specific top-level window is not required, set hwndParent to NULL. |
szzHwIDs | A string of strings that supplies the list of hardware IDs of the device. This pointer is optional and can be NULL. When NULL, all network adapters found are added to the list. |
ppAdapterList | A pointer to the list to receive pointer to the first adapter in the list. After the list is no longer required, free it using tap_free_adapter_list(). |
Definition at line 1146 of file tap.c.
References _tcszistr(), _tcszlen(), ADAPTER_REGKEY_PATH_MAX, get_device_reg_property(), get_net_adapter_guid(), get_reg_string(), tap_adapter_node::guid, GUID_DEVCLASS_NET, M_ERRNO, M_FATAL, M_NONFATAL, M_WARN, msg, tap_adapter_node::pNext, PRIsLPOLESTR, PRIsLPTSTR, szAdapterRegKeyPathTemplate, tap_adapter_node::szName, and tap_adapter_node::szzHardwareIDs.
Referenced by _tmain(), find_adapters(), ProcessDeferredAction(), schedule_adapter_create(), and schedule_adapter_delete().
Sets adapter name.
pguidAdapter | A pointer to GUID that contains network adapter ID. |
szName | New adapter name - must be unique |
bSilent | If true, MSI installer won't display message box and only print error to log. |
Definition at line 1063 of file tap.c.
References ADAPTER_REGKEY_PATH_MAX, ExecCommand(), get_reg_string(), GUID_DEVCLASS_NET, M_ERRNO, M_NONFATAL, M_WARN, msg, PRIsLPTSTR, szAdapterRegKeyPathTemplate, and tap_adapter_node::szName.
Referenced by _tmain(), and ProcessDeferredAction().