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 
52 DWORD
54  _In_opt_ HWND hwndParent,
55  _In_opt_ LPCTSTR szDeviceDescription,
56  _In_ LPCTSTR szHwId,
57  _Inout_ LPBOOL pbRebootRequired,
58  _Out_ LPGUID pguidAdapter);
59 
60 
79 DWORD
81  _In_opt_ HWND hwndParent,
82  _In_ LPCGUID pguidAdapter,
83  _Inout_ LPBOOL pbRebootRequired);
84 
85 
106 DWORD
108  _In_opt_ HWND hwndParent,
109  _In_ LPCGUID pguidAdapter,
110  _In_ BOOL bEnable,
111  _Inout_ LPBOOL pbRebootRequired);
112 
113 
126 DWORD
128  _In_ LPCGUID pguidAdapter,
129  _In_ LPCTSTR szName,
130  _In_ BOOL bSilent);
131 
132 
137 {
138  GUID guid;
139  LPTSTR szzHardwareIDs;
140  LPTSTR szName;
143 };
144 
145 
165 DWORD
167  _In_opt_ HWND hwndParent,
168  _In_opt_ LPCTSTR szzHwIDs,
169  _Out_ struct tap_adapter_node **ppAdapterList);
170 
171 
177 void
179  _In_ struct tap_adapter_node *pAdapterList);
180 
181 #endif /* ifndef TAP_H */
tap_adapter_node::szzHardwareIDs
LPTSTR szzHardwareIDs
Adapter GUID.
Definition: tap.h:139
tap_free_adapter_list
void tap_free_adapter_list(_In_ struct tap_adapter_node *pAdapterList)
Frees a list of network adapters.
Definition: tap.c:1355
tap_adapter_node::pNext
struct tap_adapter_node * pNext
Adapter name.
Definition: tap.h:142
tap_list_adapters
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
tap_adapter_node::guid
GUID guid
Definition: tap.h:138
tap_adapter_node::szName
LPTSTR szName
Device hardware ID(s)
Definition: tap.h:140
tap_create_adapter
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
basic.h
_In_
#define _In_
Definition: basic.h:42
tap_delete_adapter
DWORD tap_delete_adapter(_In_opt_ HWND hwndParent, _In_ LPCGUID pguidAdapter, _Inout_ LPBOOL pbRebootRequired)
Deletes an adapter.
Definition: tap.c:1005
_Out_
#define _Out_
Definition: basic.h:57
tap_adapter_node
Network adapter list node.
Definition: tap.h:136
_Inout_
#define _Inout_
Definition: basic.h:51
_In_opt_
#define _In_opt_
Definition: basic.h:45
tap_set_adapter_name
DWORD tap_set_adapter_name(_In_ LPCGUID pguidAdapter, _In_ LPCTSTR szName, _In_ BOOL bSilent)
Sets adapter name.
Definition: tap.c:1063
tap_enable_adapter
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