OpenVPN
tap.h
Go to the documentation of this file.
1/*
2 * tapctl -- Utility to manipulate TUN/TAP adapters on Windows
3 * https://community.openvpn.net/openvpn/wiki/Tapctl
4 *
5 * Copyright (C) 2018-2024 Simon Rozman <simon@rozman.si>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2
9 * as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#ifndef TAP_H
22#define TAP_H
23
24#include <windows.h>
25#include "basic.h"
26
27
52DWORD
54 _In_opt_ HWND hwndParent,
55 _In_opt_ LPCTSTR szDeviceDescription,
56 _In_ LPCTSTR szHwId,
57 _Inout_ LPBOOL pbRebootRequired,
58 _Out_ LPGUID pguidAdapter);
59
60
79DWORD
81 _In_opt_ HWND hwndParent,
82 _In_ LPCGUID pguidAdapter,
83 _Inout_ LPBOOL pbRebootRequired);
84
85
106DWORD
108 _In_opt_ HWND hwndParent,
109 _In_ LPCGUID pguidAdapter,
110 _In_ BOOL bEnable,
111 _Inout_ LPBOOL pbRebootRequired);
112
113
126DWORD
128 _In_ LPCGUID pguidAdapter,
129 _In_ LPCTSTR szName,
130 _In_ BOOL bSilent);
131
132
137{
138 GUID guid;
140 LPTSTR szName;
143};
144
145
165DWORD
167 _In_opt_ HWND hwndParent,
168 _In_opt_ LPCTSTR szzHwIDs,
169 _Out_ struct tap_adapter_node **ppAdapterList);
170
171
177void
179 _In_ struct tap_adapter_node *pAdapterList);
180
181#endif /* ifndef TAP_H */
Network adapter list node.
Definition tap.h:137
struct tap_adapter_node * pNext
Pointer to next adapter.
Definition tap.h:142
LPTSTR szzHardwareIDs
Device hardware ID(s)
Definition tap.h:139
LPTSTR szName
Adapter name.
Definition tap.h:140
GUID guid
Adapter GUID.
Definition tap.h:138
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.
Definition tap.c:1146
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.
Definition tap.c:723
DWORD tap_set_adapter_name(_In_ LPCGUID pguidAdapter, _In_ LPCTSTR szName, _In_ BOOL bSilent)
Sets adapter name.
Definition tap.c:1063
DWORD tap_delete_adapter(_In_opt_ HWND hwndParent, _In_ LPCGUID pguidAdapter, _Inout_ LPBOOL pbRebootRequired)
Deletes an adapter.
Definition tap.c:1005
void tap_free_adapter_list(_In_ struct tap_adapter_node *pAdapterList)
Frees a list of network adapters.
Definition tap.c:1355
DWORD tap_enable_adapter(_In_opt_ HWND hwndParent, _In_ LPCGUID pguidAdapter, _In_ BOOL bEnable, _Inout_ LPBOOL pbRebootRequired)
Enables or disables an adapter.
Definition tap.c:1015
#define _Inout_
Definition basic.h:51
#define _Out_
Definition basic.h:57
#define _In_
Definition basic.h:42
#define _In_opt_
Definition basic.h:45