OpenVPN
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
interactive.c File Reference
#include "service.h"
#include <ws2tcpip.h>
#include <iphlpapi.h>
#include <userenv.h>
#include <accctrl.h>
#include <aclapi.h>
#include <stdio.h>
#include <sddl.h>
#include <shellapi.h>
#include <mstcpip.h>
#include <inttypes.h>
#include <versionhelpers.h>
#include "openvpn-msg.h"
#include "validate.h"
#include "wfp_block.h"
Include dependency graph for interactive.c:

Go to the source code of this file.

Data Structures

struct  STARTUP_DATA
 
struct  _list_item
 
struct  wfp_block_data_t
 
struct  dns_domains_undo_data_t
 
union  pipe_message_t
 
struct  nrpt_exclude_data_t
 

Macros

#define IO_TIMEOUT   2000 /*ms*/
 
#define ERROR_OPENVPN_STARTUP   0x20000000
 
#define ERROR_STARTUP_DATA   0x20000001
 
#define ERROR_MESSAGE_DATA   0x20000002
 
#define ERROR_MESSAGE_TYPE   0x20000003
 
#define RDNS_TIMEOUT   600 /* seconds to wait for the semaphore */
 
#define TUN_IOCTL_REGISTER_RINGS   CTL_CODE(51820U, 0x970U, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
 

Typedefs

typedef struct _list_item list_item_t
 
typedef list_item_tundo_lists_t[_undo_type_max]
 
typedef BOOL(* match_fn_t) (LPVOID item, LPVOID ctx)
 

Enumerations

enum  undo_type_t {
  address , route , wfp_block , undo_dns4 ,
  undo_dns6 , undo_nrpt , undo_domains , undo_wins ,
  _undo_type_max
}
 
enum  async_op_t { peek , read , write }
 

Functions

static DWORD AddListItem (list_item_t **pfirst, LPVOID data)
 
static LPVOID RemoveListItem (list_item_t **pfirst, match_fn_t match, LPVOID ctx)
 
static HANDLE CloseHandleEx (LPHANDLE handle)
 
static HANDLE InitOverlapped (LPOVERLAPPED overlapped)
 
static BOOL ResetOverlapped (LPOVERLAPPED overlapped)
 
static DWORD AsyncPipeOp (async_op_t op, HANDLE pipe, LPVOID buffer, DWORD size, DWORD count, LPHANDLE events)
 
static DWORD PeekNamedPipeAsync (HANDLE pipe, DWORD count, LPHANDLE events)
 
static DWORD ReadPipeAsync (HANDLE pipe, LPVOID buffer, DWORD size, DWORD count, LPHANDLE events)
 
static DWORD WritePipeAsync (HANDLE pipe, LPVOID data, DWORD size, DWORD count, LPHANDLE events)
 
static VOID ReturnProcessId (HANDLE pipe, DWORD pid, DWORD count, LPHANDLE events)
 
static VOID ReturnError (HANDLE pipe, DWORD error, LPCWSTR func, DWORD count, LPHANDLE events)
 
static VOID ReturnLastError (HANDLE pipe, LPCWSTR func)
 
static BOOL ValidateOptions (HANDLE pipe, const WCHAR *workdir, const WCHAR *options, WCHAR *errmsg, DWORD capacity)
 
static BOOL GetStartupData (HANDLE pipe, STARTUP_DATA *sud)
 
static VOID FreeStartupData (STARTUP_DATA *sud)
 
static SOCKADDR_INET sockaddr_inet (short family, inet_address_t *addr)
 
static DWORD InterfaceLuid (const char *iface_name, PNET_LUID luid)
 
static BOOL CmpAddress (LPVOID item, LPVOID address)
 
static DWORD DeleteAddress (PMIB_UNICASTIPADDRESS_ROW addr_row)
 
static DWORD HandleAddressMessage (address_message_t *msg, undo_lists_t *lists)
 
static BOOL CmpRoute (LPVOID item, LPVOID route)
 
static DWORD DeleteRoute (PMIB_IPFORWARD_ROW2 fwd_row)
 
static DWORD HandleRouteMessage (route_message_t *msg, undo_lists_t *lists)
 
static DWORD HandleFlushNeighborsMessage (flush_neighbors_message_t *msg)
 
static void BlockDNSErrHandler (DWORD err, const char *msg)
 
static BOOL CmpAny (LPVOID item, LPVOID any)
 
static DWORD DeleteWfpBlock (const wfp_block_message_t *msg, undo_lists_t *lists)
 
static DWORD AddWfpBlock (const wfp_block_message_t *msg, undo_lists_t *lists)
 
static DWORD HandleWfpBlockMessage (const wfp_block_message_t *msg, undo_lists_t *lists)
 
static DWORD ExecCommand (const WCHAR *argv0, const WCHAR *cmdline, DWORD timeout)
 
static DWORD WINAPI RegisterDNS (LPVOID unused)
 
static DWORD HandleRegisterDNSMessage (void)
 
static DWORD netsh_wins_cmd (const wchar_t *action, const wchar_t *if_name, const wchar_t *addr)
 Run the command: netsh interface ip $action wins $if_name [static] $addr.
 
static BOOL CmpWString (LPVOID item, LPVOID str)
 
static BOOL ApplyGpolSettings32 (void)
 Signal the DNS resolver (and others potentially) to reload the group policy (DNS) settings on 32 bit Windows systems.
 
static BOOL ApplyGpolSettings64 (void)
 Signal the DNS resolver (and others potentially) to reload the group policy (DNS) settings on 64 bit Windows systems.
 
static BOOL ApplyGpolSettings (void)
 Signal the DNS resolver (and others potentially) to reload the group policy (DNS) settings.
 
static BOOL ApplyDnsSettings (BOOL apply_gpol)
 Signal the DNS resolver to reload its settings.
 
static DWORD InterfaceIdString (PCSTR itf_name, PWSTR str, size_t len)
 Get the string interface UUID (with braces) for an interface alias name.
 
static BOOL HasValidSearchList (HKEY key)
 Check for a valid search list in a certain key of the registry.
 
static BOOL GetDnsSearchListKey (PCSTR itf_name, PBOOL gpol, PHKEY key)
 Find the registry key for storing the DNS domains for the VPN interface.
 
static BOOL InitialSearchListExists (HKEY key)
 Check if a initial list had already been created.
 
static BOOL StoreInitialDnsSearchList (HKEY key, PCWSTR list)
 Prepare DNS domain "SearchList" registry value, so additional VPN domains can be added and its original state can be restored in case the system cannot clean up regularly.
 
static BOOL AddDnsSearchDomains (HKEY key, BOOL have_list, PCWSTR domains)
 Append domain suffixes to an existing search list.
 
static BOOL ResetDnsSearchDomains (HKEY key)
 Reset the DNS search list to its original value.
 
static void RemoveDnsSearchDomains (HKEY key, PCWSTR domains)
 Remove domain suffixes from an existing search list.
 
static void UndoDnsSearchDomains (dns_domains_undo_data_t *undo_data)
 Removes DNS domains from a search list they were previously added to.
 
static DWORD SetDnsSearchDomains (PCSTR itf_name, PCSTR domains, PBOOL gpol, undo_lists_t *lists)
 Add or remove DNS search domains.
 
static BOOL GetInterfacesKey (short family, PHKEY key)
 Return the interfaces registry key for the specified address family.
 
static DWORD SetNameServersValue (PCWSTR itf_id, short family, PCSTR value)
 Set the DNS name servers in a registry interface configuration.
 
static DWORD SetNameServers (PCWSTR itf_id, short family, PCSTR addrs)
 Set the DNS name servers in a registry interface configuration.
 
static DWORD ResetNameServers (PCWSTR itf_id, short family)
 Delete all DNS name servers from a registry interface configuration.
 
static DWORD HandleDNSConfigMessage (const dns_cfg_message_t *msg, undo_lists_t *lists)
 
static BOOL IsDhcpEnabled (HKEY key)
 Checks if DHCP is enabled for an interface.
 
static LSTATUS SetNameServerAddresses (PWSTR itf_id, const nrpt_address_t *addresses)
 Set name servers from a NRPT address list.
 
static LSTATUS GetItfDnsServersV4 (HKEY itf_key, PSTR addrs, PDWORD size)
 Get DNS server IPv4 addresses of an interface.
 
static LSTATUS GetItfDnsServersV6 (HKEY itf_key, PSTR addrs, PDWORD size)
 Get DNS server IPv6 addresses of an interface.
 
static BOOL ListContainsDomain (PCWSTR list, PCWSTR domain, size_t len)
 Check if a domain is contained in a comma separated list of domains.
 
static LSTATUS GetItfDnsDomains (HKEY itf, PCWSTR search_domains, PWSTR domains, PDWORD size)
 Return interface specific domain suffix(es)
 
static BOOL IsInterfaceConnected (PWSTR iid_str)
 Check if an interface is connected and up.
 
static void GetNrptExcludeData (PCWSTR search_domains, nrpt_exclude_data_t *data, size_t data_size)
 Collect interface DNS settings to be used in excluding NRPT rules.
 
static DWORD SetNrptRule (HKEY nrpt_key, PCWSTR subkey, PCSTR address, PCWSTR domains, DWORD dom_size, BOOL dnssec)
 Set a NRPT rule (subkey) and its values in the registry.
 
static void SetNrptExcludeRules (HKEY nrpt_key, DWORD ovpn_pid, PCWSTR search_domains)
 Set NRPT exclude rules to accompany a catch all rule.
 
static DWORD SetNrptRules (HKEY nrpt_key, const nrpt_address_t *addresses, const char *domains, const char *search_domains, BOOL dnssec, DWORD ovpn_pid)
 Set NRPT rules for a openvpn process.
 
static LSTATUS OpenNrptBaseKey (PHKEY key, PBOOL gpol)
 Return the registry key where NRPT rules are stored.
 
static BOOL DeleteNrptRules (DWORD pid, PBOOL gpol)
 Delete OpenVPN NRPT rules from the registry.
 
static void UndoNrptRules (DWORD ovpn_pid)
 Delete a process' NRPT rules and apply the reduced set of rules.
 
static DWORD HandleDNSConfigNrptMessage (const nrpt_dns_cfg_message_t *msg, DWORD ovpn_pid, undo_lists_t *lists)
 Add Name Resolution Policy Table (NRPT) rules as documented in https://msdn.microsoft.com/en-us/library/ff957356.aspx for DNS name resolution, as well as DNS search domain(s), if given.
 
static DWORD HandleWINSConfigMessage (const wins_cfg_message_t *msg, undo_lists_t *lists)
 
static DWORD HandleEnableDHCPMessage (const enable_dhcp_message_t *dhcp)
 
static DWORD HandleMTUMessage (const set_mtu_message_t *mtu)
 
static DWORD HandleCreateAdapterMessage (const create_adapter_message_t *msg)
 Creates a VPN adapter of the specified type by invoking tapctl.exe.
 
static VOID HandleMessage (HANDLE pipe, PPROCESS_INFORMATION proc_info, DWORD bytes, DWORD count, LPHANDLE events, undo_lists_t *lists)
 
static VOID Undo (undo_lists_t *lists)
 
static DWORD WINAPI RunOpenvpn (LPVOID p)
 
static DWORD WINAPI ServiceCtrlInteractive (DWORD ctrl_code, DWORD event, LPVOID data, LPVOID ctx)
 
static HANDLE CreateClientPipeInstance (VOID)
 
static DWORD UpdateWaitHandles (LPHANDLE *handles_ptr, LPDWORD count, HANDLE io_event, HANDLE exit_event, list_item_t *threads)
 
static VOID FreeWaitHandles (LPHANDLE h)
 
static BOOL CmpHandle (LPVOID item, LPVOID hnd)
 
VOID WINAPI ServiceStartInteractiveOwn (DWORD dwArgc, LPWSTR *lpszArgv)
 
static void CleanupRegistry (void)
 Clean up remains of previous sessions in registry.
 
VOID WINAPI ServiceStartInteractive (DWORD dwArgc, LPWSTR *lpszArgv)
 

Variables

static SERVICE_STATUS_HANDLE service
 
static SERVICE_STATUS status = { .dwServiceType = SERVICE_WIN32_SHARE_PROCESS }
 
static HANDLE exit_event = NULL
 
static settings_t settings
 
static HANDLE rdns_semaphore = NULL
 
openvpn_service_t interactive_service
 

Macro Definition Documentation

◆ ERROR_MESSAGE_DATA

#define ERROR_MESSAGE_DATA   0x20000002

Definition at line 48 of file interactive.c.

◆ ERROR_MESSAGE_TYPE

#define ERROR_MESSAGE_TYPE   0x20000003

Definition at line 49 of file interactive.c.

◆ ERROR_OPENVPN_STARTUP

#define ERROR_OPENVPN_STARTUP   0x20000000

Definition at line 46 of file interactive.c.

◆ ERROR_STARTUP_DATA

#define ERROR_STARTUP_DATA   0x20000001

Definition at line 47 of file interactive.c.

◆ IO_TIMEOUT

#define IO_TIMEOUT   2000 /*ms*/

Definition at line 44 of file interactive.c.

◆ RDNS_TIMEOUT

#define RDNS_TIMEOUT   600 /* seconds to wait for the semaphore */

Definition at line 56 of file interactive.c.

◆ TUN_IOCTL_REGISTER_RINGS

#define TUN_IOCTL_REGISTER_RINGS   CTL_CODE(51820U, 0x970U, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)

Definition at line 58 of file interactive.c.

Typedef Documentation

◆ list_item_t

typedef struct _list_item list_item_t

◆ match_fn_t

typedef BOOL(* match_fn_t) (LPVOID item, LPVOID ctx)

Definition at line 146 of file interactive.c.

◆ undo_lists_t

typedef list_item_t* undo_lists_t[_undo_type_max]

Definition at line 95 of file interactive.c.

Enumeration Type Documentation

◆ async_op_t

enum async_op_t
Enumerator
peek 
read 
write 

Definition at line 205 of file interactive.c.

◆ undo_type_t

Enumerator
address 
route 
wfp_block 
undo_dns4 
undo_dns6 
undo_nrpt 
undo_domains 
undo_wins 
_undo_type_max 

Definition at line 84 of file interactive.c.

Function Documentation

◆ AddDnsSearchDomains()

static BOOL AddDnsSearchDomains ( HKEY  key,
BOOL  have_list,
PCWSTR  domains 
)
static

Append domain suffixes to an existing search list.

Parameters
keyHKEY the list is stored at
have_listBOOL to indicate if a search list already exists
domainsdomain suffixes as comma separated string
Returns
BOOL to indicate success or failure

Definition at line 1458 of file interactive.c.

References M_SYSERR, MsgToEventLog(), pos(), and StoreInitialDnsSearchList().

Referenced by SetDnsSearchDomains().

◆ AddListItem()

static DWORD AddListItem ( list_item_t **  pfirst,
LPVOID  data 
)
static

◆ AddWfpBlock()

static DWORD AddWfpBlock ( const wfp_block_message_t msg,
undo_lists_t lists 
)
static

◆ ApplyDnsSettings()

static BOOL ApplyDnsSettings ( BOOL  apply_gpol)
static

Signal the DNS resolver to reload its settings.

Parameters
apply_gpolBOOL reload setting from group policy hives as well
Returns
BOOL to indicate if the reload was initiated

Definition at line 1173 of file interactive.c.

References ApplyGpolSettings(), M_ERR, MsgToEventLog(), and status.

Referenced by CleanupRegistry(), HandleDNSConfigMessage(), HandleDNSConfigNrptMessage(), UndoDnsSearchDomains(), and UndoNrptRules().

◆ ApplyGpolSettings()

static BOOL ApplyGpolSettings ( void  )
static

Signal the DNS resolver (and others potentially) to reload the group policy (DNS) settings.

Returns
BOOL to indicate if the reload was initiated

Definition at line 1157 of file interactive.c.

References ApplyGpolSettings32(), and ApplyGpolSettings64().

Referenced by ApplyDnsSettings().

◆ ApplyGpolSettings32()

static BOOL ApplyGpolSettings32 ( void  )
static

Signal the DNS resolver (and others potentially) to reload the group policy (DNS) settings on 32 bit Windows systems.

Returns
BOOL to indicate if the reload was initiated

Definition at line 1080 of file interactive.c.

Referenced by ApplyGpolSettings().

◆ ApplyGpolSettings64()

static BOOL ApplyGpolSettings64 ( void  )
static

Signal the DNS resolver (and others potentially) to reload the group policy (DNS) settings on 64 bit Windows systems.

Returns
BOOL to indicate if the reload was initiated

Definition at line 1120 of file interactive.c.

Referenced by ApplyGpolSettings().

◆ AsyncPipeOp()

static DWORD AsyncPipeOp ( async_op_t  op,
HANDLE  pipe,
LPVOID  buffer,
DWORD  size,
DWORD  count,
LPHANDLE  events 
)
static

Definition at line 212 of file interactive.c.

References CloseHandleEx(), InitOverlapped(), IO_TIMEOUT, peek, and write.

Referenced by PeekNamedPipeAsync(), ReadPipeAsync(), and WritePipeAsync().

◆ BlockDNSErrHandler()

static void BlockDNSErrHandler ( DWORD  err,
const char *  msg 
)
static

Definition at line 731 of file interactive.c.

References M_ERR, msg, and MsgToEventLog().

Referenced by AddWfpBlock().

◆ CleanupRegistry()

static void CleanupRegistry ( void  )
static

Clean up remains of previous sessions in registry.

These remains can happen with unclean shutdowns or crashes and would interfere with normal operation of the system with and without active tunnels.

Definition at line 3729 of file interactive.c.

References ApplyDnsSettings(), DeleteNrptRules(), GetDnsSearchListKey(), and ResetDnsSearchDomains().

Referenced by ServiceStartInteractive().

◆ CloseHandleEx()

static HANDLE CloseHandleEx ( LPHANDLE  handle)
static

Definition at line 173 of file interactive.c.

Referenced by AsyncPipeOp(), RunOpenvpn(), and ServiceStartInteractive().

◆ CmpAddress()

static BOOL CmpAddress ( LPVOID  item,
LPVOID  address 
)
static

Definition at line 558 of file interactive.c.

References address.

Referenced by HandleAddressMessage().

◆ CmpAny()

static BOOL CmpAny ( LPVOID  item,
LPVOID  any 
)
static

◆ CmpHandle()

static BOOL CmpHandle ( LPVOID  item,
LPVOID  hnd 
)
static

Definition at line 3710 of file interactive.c.

Referenced by ServiceStartInteractive().

◆ CmpRoute()

static BOOL CmpRoute ( LPVOID  item,
LPVOID  route 
)
static

Definition at line 636 of file interactive.c.

References route.

Referenced by HandleRouteMessage().

◆ CmpWString()

static BOOL CmpWString ( LPVOID  item,
LPVOID  str 
)
static

Definition at line 1068 of file interactive.c.

Referenced by HandleWINSConfigMessage().

◆ CreateClientPipeInstance()

static HANDLE CreateClientPipeInstance ( VOID  )
static

Definition at line 3603 of file interactive.c.

References _L, M_SYSERR, MsgToEventLog(), PACKAGE, and service_instance.

Referenced by ServiceStartInteractive().

◆ DeleteAddress()

static DWORD DeleteAddress ( PMIB_UNICASTIPADDRESS_ROW  addr_row)
static

Definition at line 564 of file interactive.c.

Referenced by HandleAddressMessage(), and Undo().

◆ DeleteNrptRules()

static BOOL DeleteNrptRules ( DWORD  pid,
PBOOL  gpol 
)
static

Delete OpenVPN NRPT rules from the registry.

If the pid parameter is 0 all NRPT rules added by OpenVPN are deleted. In all other cases only rules matching the pid are deleted.

Parameters
pidPID of the process to delete the rules for or 0
gpol
Returns
BOOL to indicate if rules were deleted

Definition at line 2687 of file interactive.c.

References M_SYSERR, MsgToEventLog(), and OpenNrptBaseKey().

Referenced by CleanupRegistry(), HandleDNSConfigNrptMessage(), and UndoNrptRules().

◆ DeleteRoute()

static DWORD DeleteRoute ( PMIB_IPFORWARD_ROW2  fwd_row)
static

Definition at line 642 of file interactive.c.

Referenced by HandleRouteMessage(), and Undo().

◆ DeleteWfpBlock()

static DWORD DeleteWfpBlock ( const wfp_block_message_t msg,
undo_lists_t lists 
)
static

◆ ExecCommand()

static DWORD ExecCommand ( const WCHAR *  argv0,
const WCHAR *  cmdline,
DWORD  timeout 
)
static

◆ FreeStartupData()

static VOID FreeStartupData ( STARTUP_DATA sud)
static

Definition at line 516 of file interactive.c.

References STARTUP_DATA::directory.

Referenced by RunOpenvpn().

◆ FreeWaitHandles()

static VOID FreeWaitHandles ( LPHANDLE  h)
static

Definition at line 3704 of file interactive.c.

Referenced by ServiceStartInteractive().

◆ GetDnsSearchListKey()

static BOOL GetDnsSearchListKey ( PCSTR  itf_name,
PBOOL  gpol,
PHKEY  key 
)
static

Find the registry key for storing the DNS domains for the VPN interface.

Parameters
itf_namePCSTR that contains the alias name of the interface the domains are related to. If this is NULL the interface probing is skipped.
gpolPBOOL to indicate if the key returned is the group policy hive
keyPHKEY in which the found registry key is returned in
Returns
BOOL to indicate if a search list is already present at the location. If the key returned is INVALID_HANDLE_VALUE, this indicates an unrecoverable error.

The correct location to add them is where a non-empty "SearchList" value exists, or in the interface configuration itself. However, the system-wide and then the group policy search lists overrule the previous one respectively, so we need to probe to find the effective list.

Definition at line 1325 of file interactive.c.

References HasValidSearchList(), and InterfaceIdString().

Referenced by CleanupRegistry(), SetDnsSearchDomains(), and UndoDnsSearchDomains().

◆ GetInterfacesKey()

static BOOL GetInterfacesKey ( short  family,
PHKEY  key 
)
static

Return the interfaces registry key for the specified address family.

Parameters
familythe internet address family to open the key for
keyPHKEY to return the key in
Returns
BOOL to indicate success or failure

Definition at line 1733 of file interactive.c.

References M_SYSERR, and MsgToEventLog().

Referenced by GetNrptExcludeData(), and SetNameServersValue().

◆ GetItfDnsDomains()

static LSTATUS GetItfDnsDomains ( HKEY  itf,
PCWSTR  search_domains,
PWSTR  domains,
PDWORD  size 
)
static

Return interface specific domain suffix(es)

The domains paramter will be set to a MULTI_SZ domains string. In case of an error or if no domains are found for the interface size is set to 0 and the contents of domains are invalid. Note that the domains could have been set by DHCP or manually. Note that domains are ignored if they match a pushed search domain.

Parameters
itfHKEY of the interface to read from
search_domainsoptional list of search domains
domainsPWSTR buffer to return the domain(s) in
sizepointer to size of the domains buffer in bytes. Will be set to the size of the string returned, including the terminating zeros or 0.
Returns
LSTATUS NO_ERROR if the domain suffix(es) were read successfully, ERROR_FILE_NOT_FOUND if no domain was found for the interface, ERROR_MORE_DATA if the list did not fit into the buffer, any other error indicates an error while reading from the registry.

Definition at line 2182 of file interactive.c.

References buf_len(), ListContainsDomain(), and pos().

Referenced by GetNrptExcludeData().

◆ GetItfDnsServersV4()

static LSTATUS GetItfDnsServersV4 ( HKEY  itf_key,
PSTR  addrs,
PDWORD  size 
)
static

Get DNS server IPv4 addresses of an interface.

Parameters
itf_keyregistry key of the IPv4 interface data
addrspointer to the buffer addresses are returned in
sizepointer to the size of the buffer, contains the size of the addresses on return
Returns
LSTATUS NO_ERROR on success, a Windows error code otherwise

Definition at line 2021 of file interactive.c.

References IsDhcpEnabled().

Referenced by GetNrptExcludeData().

◆ GetItfDnsServersV6()

static LSTATUS GetItfDnsServersV6 ( HKEY  itf_key,
PSTR  addrs,
PDWORD  size 
)
static

Get DNS server IPv6 addresses of an interface.

Parameters
itf_keyregistry key of the IPv6 interface data
addrspointer to the buffer addresses are returned in
sizepointer to the size of the buffer
Returns
LSTATUS NO_ERROR on success, a Windows error code otherwise

Definition at line 2066 of file interactive.c.

References IsDhcpEnabled(), and pos().

Referenced by GetNrptExcludeData().

◆ GetNrptExcludeData()

static void GetNrptExcludeData ( PCWSTR  search_domains,
nrpt_exclude_data_t data,
size_t  data_size 
)
static

Collect interface DNS settings to be used in excluding NRPT rules.

This is needed so that local DNS keeps working even when a catch all NRPT rule is installed by a VPN connection.

Parameters
search_domainsoptional list of search domains
datapointer to the data structures the values are returned in
data_sizenumber of exclude data structures pointed to

Definition at line 2325 of file interactive.c.

References nrpt_exclude_data_t::addresses, nrpt_exclude_data_t::domains, nrpt_exclude_data_t::domains_size, GetInterfacesKey(), GetItfDnsDomains(), GetItfDnsServersV4(), GetItfDnsServersV6(), IsInterfaceConnected(), M_SYSERR, MsgToEventLog(), and NRPT_ADDR_SIZE.

Referenced by SetNrptExcludeRules().

◆ GetStartupData()

static BOOL GetStartupData ( HANDLE  pipe,
STARTUP_DATA sud 
)
static

◆ HandleAddressMessage()

static DWORD HandleAddressMessage ( address_message_t msg,
undo_lists_t lists 
)
static

◆ HandleCreateAdapterMessage()

static DWORD HandleCreateAdapterMessage ( const create_adapter_message_t msg)
static

Creates a VPN adapter of the specified type by invoking tapctl.exe.

Parameters
msgAdapter creation request specifying the type.
Returns
NO_ERROR on success, otherwise a Windows error code.

Definition at line 3042 of file interactive.c.

References ADAPTER_TYPE_DCO, ADAPTER_TYPE_TAP, settings_t::bin_dir, ExecCommand(), msg, and settings.

Referenced by HandleMessage().

◆ HandleDNSConfigMessage()

static DWORD HandleDNSConfigMessage ( const dns_cfg_message_t msg,
undo_lists_t lists 
)
static

◆ HandleDNSConfigNrptMessage()

static DWORD HandleDNSConfigNrptMessage ( const nrpt_dns_cfg_message_t msg,
DWORD  ovpn_pid,
undo_lists_t lists 
)
static

Add Name Resolution Policy Table (NRPT) rules as documented in https://msdn.microsoft.com/en-us/library/ff957356.aspx for DNS name resolution, as well as DNS search domain(s), if given.

Parameters
msgconfig messages sent by the openvpn process
ovpn_pidprocess id of the sending openvpn process
listsundo lists for this process
Returns
NO_ERROR on success, or a Windows error code

Definition at line 2767 of file interactive.c.

References AddListItem(), nrpt_dns_cfg_message_t::addresses, ApplyDnsSettings(), CmpAny(), DeleteNrptRules(), ERROR_MESSAGE_DATA, nrpt_dns_cfg_message_t::iface, InterfaceIdString(), M_INFO, msg, msg_add_nrpt_cfg, msg_del_nrpt_cfg, MsgToEventLog(), interface_t::name, NRPT_ADDR_NUM, nrpt_dnssec, OpenNrptBaseKey(), RemoveListItem(), ResetNameServers(), nrpt_dns_cfg_message_t::resolve_domains, nrpt_dns_cfg_message_t::search_domains, SetDnsSearchDomains(), SetNameServerAddresses(), SetNrptRules(), and undo_nrpt.

Referenced by HandleMessage().

◆ HandleEnableDHCPMessage()

static DWORD HandleEnableDHCPMessage ( const enable_dhcp_message_t dhcp)
static

Definition at line 2974 of file interactive.c.

References ExecCommand(), and get_win_sys_path().

Referenced by HandleMessage().

◆ HandleFlushNeighborsMessage()

static DWORD HandleFlushNeighborsMessage ( flush_neighbors_message_t msg)
static

Definition at line 720 of file interactive.c.

References msg.

Referenced by HandleMessage().

◆ HandleMessage()

static VOID HandleMessage ( HANDLE  pipe,
PPROCESS_INFORMATION  proc_info,
DWORD  bytes,
DWORD  count,
LPHANDLE  events,
undo_lists_t lists 
)
static

◆ HandleMTUMessage()

static DWORD HandleMTUMessage ( const set_mtu_message_t mtu)
static

◆ HandleRegisterDNSMessage()

static DWORD HandleRegisterDNSMessage ( void  )
static

Definition at line 985 of file interactive.c.

References RegisterDNS().

Referenced by HandleMessage().

◆ HandleRouteMessage()

static DWORD HandleRouteMessage ( route_message_t msg,
undo_lists_t lists 
)
static

◆ HandleWfpBlockMessage()

static DWORD HandleWfpBlockMessage ( const wfp_block_message_t msg,
undo_lists_t lists 
)
static

Definition at line 861 of file interactive.c.

References AddWfpBlock(), DeleteWfpBlock(), msg, and msg_add_wfp_block.

Referenced by HandleMessage().

◆ HandleWINSConfigMessage()

static DWORD HandleWINSConfigMessage ( const wins_cfg_message_t msg,
undo_lists_t lists 
)
static

◆ HasValidSearchList()

static BOOL HasValidSearchList ( HKEY  key)
static

Check for a valid search list in a certain key of the registry.

Valid means that a string value "SearchList" exists and that it contains one or more domains. We only check if the string contains a valid domain name character, but the main point is to prevent letting pass whitespace-only lists, so that check is good enough for that purpose.

Parameters
keyHKEY in which to check for a valid search list
Returns
BOOL to indicate if a valid search list has been found

Definition at line 1288 of file interactive.c.

Referenced by GetDnsSearchListKey().

◆ InitialSearchListExists()

static BOOL InitialSearchListExists ( HKEY  key)
static

Check if a initial list had already been created.

Parameters
keyHKEY of the registry subkey to search in
Returns
BOOL to indicate if the initial list is already present under key

Definition at line 1393 of file interactive.c.

References M_ERR, and MsgToEventLog().

Referenced by StoreInitialDnsSearchList().

◆ InitOverlapped()

static HANDLE InitOverlapped ( LPOVERLAPPED  overlapped)
static

Definition at line 184 of file interactive.c.

Referenced by AsyncPipeOp(), and ServiceStartInteractive().

◆ InterfaceIdString()

static DWORD InterfaceIdString ( PCSTR  itf_name,
PWSTR  str,
size_t  len 
)
static

Get the string interface UUID (with braces) for an interface alias name.

Parameters
itf_namethe interface alias name
strpointer to the buffer the wide UUID is returned in
lensize of the str buffer in characters
Returns
NO_ERROR on success, or the Windows error code for the failure

Definition at line 1232 of file interactive.c.

References InterfaceLuid(), M_ERR, and MsgToEventLog().

Referenced by GetDnsSearchListKey(), HandleDNSConfigMessage(), and HandleDNSConfigNrptMessage().

◆ InterfaceLuid()

static DWORD InterfaceLuid ( const char *  iface_name,
PNET_LUID  luid 
)
static

Definition at line 540 of file interactive.c.

References status, and utf8to16().

Referenced by HandleAddressMessage(), HandleRouteMessage(), and InterfaceIdString().

◆ IsDhcpEnabled()

static BOOL IsDhcpEnabled ( HKEY  key)
static

Checks if DHCP is enabled for an interface.

Parameters
keyHKEY of the interface to check for
Returns
BOOL set to TRUE if DHCP is enabled, or FALSE if disabled or an error occurred

Definition at line 1943 of file interactive.c.

References M_SYSERR, and MsgToEventLog().

Referenced by GetItfDnsServersV4(), and GetItfDnsServersV6().

◆ IsInterfaceConnected()

static BOOL IsInterfaceConnected ( PWSTR  iid_str)
static

Check if an interface is connected and up.

Parameters
iid_strthe interface GUID as string
Returns
TRUE if the interface is connected and up, FALSE otherwise or in case an error happened

Definition at line 2279 of file interactive.c.

References M_SYSERR, and MsgToEventLog().

Referenced by GetNrptExcludeData().

◆ ListContainsDomain()

static BOOL ListContainsDomain ( PCWSTR  list,
PCWSTR  domain,
size_t  len 
)
static

Check if a domain is contained in a comma separated list of domains.

Parameters
listComma separated list of domains
domainDomain string to search for
lenLength of the domain string, excluding the '\0'
Returns
TRUE when the domain was found in the list, FALSE otherwise.

Definition at line 2138 of file interactive.c.

Referenced by GetItfDnsDomains().

◆ netsh_wins_cmd()

static DWORD netsh_wins_cmd ( const wchar_t *  action,
const wchar_t *  if_name,
const wchar_t *  addr 
)
static

Run the command: netsh interface ip $action wins $if_name [static] $addr.

Parameters
action"delete", "add" or "set"
if_name"name_of_interface"
addrIPv4 address as a string

If addr is null and action = "delete" all addresses are deleted. if action = "set" then "static" is added before $addr

Definition at line 1020 of file interactive.c.

References ExecCommand(), and get_win_sys_path().

Referenced by HandleWINSConfigMessage(), and Undo().

◆ OpenNrptBaseKey()

static LSTATUS OpenNrptBaseKey ( PHKEY  key,
PBOOL  gpol 
)
static

Return the registry key where NRPT rules are stored.

Parameters
keypointer to the HKEY it is returned in
gpolpointer to BOOL the use of GPOL hive is returned in
Returns
NO_ERROR on success, or a Windows error code

Definition at line 2648 of file interactive.c.

Referenced by DeleteNrptRules(), and HandleDNSConfigNrptMessage().

◆ PeekNamedPipeAsync()

static DWORD PeekNamedPipeAsync ( HANDLE  pipe,
DWORD  count,
LPHANDLE  events 
)
static

Definition at line 276 of file interactive.c.

References AsyncPipeOp(), and peek.

Referenced by GetStartupData(), and RunOpenvpn().

◆ ReadPipeAsync()

static DWORD ReadPipeAsync ( HANDLE  pipe,
LPVOID  buffer,
DWORD  size,
DWORD  count,
LPHANDLE  events 
)
static

Definition at line 282 of file interactive.c.

References AsyncPipeOp(), and read.

Referenced by GetStartupData(), and HandleMessage().

◆ RegisterDNS()

static DWORD WINAPI RegisterDNS ( LPVOID  unused)
static

◆ RemoveDnsSearchDomains()

static void RemoveDnsSearchDomains ( HKEY  key,
PCWSTR  domains 
)
static

Remove domain suffixes from an existing search list.

Parameters
keyHKEY the list is stored at
domainsdomain suffixes to remove as comma separated string

Definition at line 1563 of file interactive.c.

References M_ERR, M_SYSERR, MsgToEventLog(), and ResetDnsSearchDomains().

Referenced by SetDnsSearchDomains(), and UndoDnsSearchDomains().

◆ RemoveListItem()

static LPVOID RemoveListItem ( list_item_t **  pfirst,
match_fn_t  match,
LPVOID  ctx 
)
static

◆ ResetDnsSearchDomains()

static BOOL ResetDnsSearchDomains ( HKEY  key)
static

Reset the DNS search list to its original value.

Looks for a "InitialSearchList" value as the one to reset to. If it doesn't exist, doesn't reset anything, as there was no SearchList in the first place.

Parameters
keyHKEY of the location in the registry to reset
Returns
BOOL to indicate if something was reset

Definition at line 1522 of file interactive.c.

References M_SYSERR, and MsgToEventLog().

Referenced by CleanupRegistry(), and RemoveDnsSearchDomains().

◆ ResetNameServers()

static DWORD ResetNameServers ( PCWSTR  itf_id,
short  family 
)
static

Delete all DNS name servers from a registry interface configuration.

Parameters
itf_idthe interface id to clear the servers for
familyinternet address family to clear the servers for
Returns
DWORD NO_ERROR on success, a Windows error code otherwise

Definition at line 1822 of file interactive.c.

References SetNameServersValue().

Referenced by HandleDNSConfigMessage(), HandleDNSConfigNrptMessage(), and Undo().

◆ ResetOverlapped()

static BOOL ResetOverlapped ( LPOVERLAPPED  overlapped)
static

Definition at line 192 of file interactive.c.

Referenced by ServiceStartInteractive().

◆ ReturnError()

static VOID ReturnError ( HANDLE  pipe,
DWORD  error,
LPCWSTR  func,
DWORD  count,
LPHANDLE  events 
)
static

◆ ReturnLastError()

static VOID ReturnLastError ( HANDLE  pipe,
LPCWSTR  func 
)
static

Definition at line 348 of file interactive.c.

References exit_event, and ReturnError().

Referenced by GetStartupData(), and RunOpenvpn().

◆ ReturnProcessId()

static VOID ReturnProcessId ( HANDLE  pipe,
DWORD  pid,
DWORD  count,
LPHANDLE  events 
)
static

Definition at line 294 of file interactive.c.

References msg, and WritePipeAsync().

Referenced by RunOpenvpn().

◆ RunOpenvpn()

static DWORD WINAPI RunOpenvpn ( LPVOID  p)
static

◆ ServiceCtrlInteractive()

static DWORD WINAPI ServiceCtrlInteractive ( DWORD  ctrl_code,
DWORD  event,
LPVOID  data,
LPVOID  ctx 
)
static

Definition at line 3579 of file interactive.c.

References exit_event, ReportStatusToSCMgr(), service, and status.

Referenced by ServiceStartInteractive().

◆ ServiceStartInteractive()

VOID WINAPI ServiceStartInteractive ( DWORD  dwArgc,
LPWSTR *  lpszArgv 
)

◆ ServiceStartInteractiveOwn()

VOID WINAPI ServiceStartInteractiveOwn ( DWORD  dwArgc,
LPWSTR *  lpszArgv 
)

Definition at line 3717 of file interactive.c.

References ServiceStartInteractive(), and status.

Referenced by wmain().

◆ SetDnsSearchDomains()

static DWORD SetDnsSearchDomains ( PCSTR  itf_name,
PCSTR  domains,
PBOOL  gpol,
undo_lists_t lists 
)
static

Add or remove DNS search domains.

Parameters
itf_namealias name of the interface the domains are set for
domainsa comma separated list of domain name suffixes
gpolPBOOL to indicate if group policy values were modified
listspointer to the undo lists
Returns
NO_ERROR on success, an error status code otherwise

If a SearchList is present in the registry already, the domains are added to that list. Otherwise the domains are added to the VPN interface specific list. A group policy search list takes precedence over a system-wide list, and that one itself takes precedence over interface specific ones.

This function will remove previously set domains if the domains parameter is NULL or empty.

The gpol value is only valid if the function returns no error. In the error case nothing is changed.

Definition at line 1666 of file interactive.c.

References AddDnsSearchDomains(), AddListItem(), CmpAny(), dns_domains_undo_data_t::domains, GetDnsSearchListKey(), dns_domains_undo_data_t::itf_name, M_SYSERR, MsgToEventLog(), RemoveDnsSearchDomains(), RemoveListItem(), undo_domains, and utf8to16().

Referenced by HandleDNSConfigMessage(), and HandleDNSConfigNrptMessage().

◆ SetNameServerAddresses()

static LSTATUS SetNameServerAddresses ( PWSTR  itf_id,
const nrpt_address_t addresses 
)
static

Set name servers from a NRPT address list.

Parameters
itf_idthe VPN interface ID to set the name servers for
addressesthe list of NRPT addresses
Returns
LSTATUS NO_ERROR in case of success, a Windows error code otherwise

Definition at line 1968 of file interactive.c.

References NRPT_ADDR_NUM, NRPT_ADDR_SIZE, and SetNameServers().

Referenced by HandleDNSConfigNrptMessage().

◆ SetNameServers()

static DWORD SetNameServers ( PCWSTR  itf_id,
short  family,
PCSTR  addrs 
)
static

Set the DNS name servers in a registry interface configuration.

Parameters
itf_idthe interface id to set the servers for
familyinternet address family to set the servers for
addrscomma separated list of name server addresses
Returns
DWORD NO_ERROR on success, a Windows error code otherwise

Definition at line 1808 of file interactive.c.

References SetNameServersValue().

Referenced by HandleDNSConfigMessage(), and SetNameServerAddresses().

◆ SetNameServersValue()

static DWORD SetNameServersValue ( PCWSTR  itf_id,
short  family,
PCSTR  value 
)
static

Set the DNS name servers in a registry interface configuration.

Parameters
itf_idthe interface id to set the servers for
familyinternet address family to set the servers for
valuethe value to set the name servers to
Returns
DWORD NO_ERROR on success, a Windows error code otherwise

Definition at line 1760 of file interactive.c.

References GetInterfacesKey(), M_SYSERR, and MsgToEventLog().

Referenced by ResetNameServers(), and SetNameServers().

◆ SetNrptExcludeRules()

static void SetNrptExcludeRules ( HKEY  nrpt_key,
DWORD  ovpn_pid,
PCWSTR  search_domains 
)
static

Set NRPT exclude rules to accompany a catch all rule.

This is done so that local resolution of names is not interfered with in case the VPN resolves all names.

Parameters
nrpt_keythe registry key to set the rules under
ovpn_pidthe PID of the openvpn process
search_domainsoptional list of search domains

Definition at line 2532 of file interactive.c.

References nrpt_exclude_data_t::addresses, nrpt_exclude_data_t::domains, nrpt_exclude_data_t::domains_size, GetNrptExcludeData(), M_ERR, MsgToEventLog(), and SetNrptRule().

Referenced by SetNrptRules().

◆ SetNrptRule()

static DWORD SetNrptRule ( HKEY  nrpt_key,
PCWSTR  subkey,
PCSTR  address,
PCWSTR  domains,
DWORD  dom_size,
BOOL  dnssec 
)
static

Set a NRPT rule (subkey) and its values in the registry.

Parameters
nrpt_keyNRPT registry key handle
subkeysubkey string to create
addressname server address string
domainsdomains to resolve by this server as MULTI_SZ
dom_sizesize of domains in bytes including the terminators
dnssecboolean to determine if DNSSEC is to be enabled
Returns
NO_ERROR on success, or Windows error code

Definition at line 2445 of file interactive.c.

References address.

Referenced by SetNrptExcludeRules(), and SetNrptRules().

◆ SetNrptRules()

static DWORD SetNrptRules ( HKEY  nrpt_key,
const nrpt_address_t addresses,
const char *  domains,
const char *  search_domains,
BOOL  dnssec,
DWORD  ovpn_pid 
)
static

Set NRPT rules for a openvpn process.

Parameters
nrpt_keythe registry key to set the rules under
addressesname server addresses
domainsoptional list of split routing domains
search_domainsoptional list of search domains
dnssecboolean whether DNSSEC is to be used
ovpn_pidthe PID of the openvpn process
Returns
NO_ERROR on success, or a Windows error code

Definition at line 2571 of file interactive.c.

References M_ERR, MsgToEventLog(), NRPT_ADDR_NUM, NRPT_ADDR_SIZE, pos(), SetNrptExcludeRules(), SetNrptRule(), utf8to16(), and utf8to16_size().

Referenced by HandleDNSConfigNrptMessage().

◆ sockaddr_inet()

static SOCKADDR_INET sockaddr_inet ( short  family,
inet_address_t addr 
)
static

Definition at line 523 of file interactive.c.

References inet_address_t::ipv4, and inet_address_t::ipv6.

Referenced by HandleAddressMessage(), and HandleRouteMessage().

◆ StoreInitialDnsSearchList()

static BOOL StoreInitialDnsSearchList ( HKEY  key,
PCWSTR  list 
)
static

Prepare DNS domain "SearchList" registry value, so additional VPN domains can be added and its original state can be restored in case the system cannot clean up regularly.

Parameters
keyregistry subkey to store the list in
liststring of comma separated domains to use as the list
Returns
boolean to indicate whether the list was stored successfully

Definition at line 1422 of file interactive.c.

References InitialSearchListExists(), M_ERR, and MsgToEventLog().

Referenced by AddDnsSearchDomains().

◆ Undo()

static VOID Undo ( undo_lists_t lists)
static

◆ UndoDnsSearchDomains()

static void UndoDnsSearchDomains ( dns_domains_undo_data_t undo_data)
static

Removes DNS domains from a search list they were previously added to.

Parameters
undo_datapointer to dns_domains_undo_data_t

Definition at line 1628 of file interactive.c.

References ApplyDnsSettings(), dns_domains_undo_data_t::domains, GetDnsSearchListKey(), dns_domains_undo_data_t::itf_name, and RemoveDnsSearchDomains().

Referenced by Undo().

◆ UndoNrptRules()

static void UndoNrptRules ( DWORD  ovpn_pid)
static

Delete a process' NRPT rules and apply the reduced set of rules.

Parameters
ovpn_pidOpenVPN process id to delete rules for

Definition at line 2746 of file interactive.c.

References ApplyDnsSettings(), and DeleteNrptRules().

Referenced by Undo().

◆ UpdateWaitHandles()

static DWORD UpdateWaitHandles ( LPHANDLE *  handles_ptr,
LPDWORD  count,
HANDLE  io_event,
HANDLE  exit_event,
list_item_t threads 
)
static

Definition at line 3654 of file interactive.c.

References _list_item::data, exit_event, _list_item::next, and pos().

Referenced by ServiceStartInteractive().

◆ ValidateOptions()

static BOOL ValidateOptions ( HANDLE  pipe,
const WCHAR *  workdir,
const WCHAR *  options,
WCHAR *  errmsg,
DWORD  capacity 
)
static

Definition at line 359 of file interactive.c.

References CheckOption(), IsOption(), settings_t::ovpn_admin_group, and settings.

Referenced by RunOpenvpn().

◆ WritePipeAsync()

static DWORD WritePipeAsync ( HANDLE  pipe,
LPVOID  data,
DWORD  size,
DWORD  count,
LPHANDLE  events 
)
static

Definition at line 288 of file interactive.c.

References AsyncPipeOp(), and write.

Referenced by HandleMessage(), ReturnError(), and ReturnProcessId().

Variable Documentation

◆ exit_event

HANDLE exit_event = NULL
static

◆ interactive_service

openvpn_service_t interactive_service
Initial value:
= {
_L(PACKAGE_NAME) L"ServiceInteractive",
_L(PACKAGE_NAME) L" Interactive Service",
SERVICE_AUTO_START
}
#define PACKAGE_NAME
Definition config.h:492
#define SERVICE_DEPENDENCIES
Definition service.h:38
@ interactive
Definition service.h:50
#define _L(q)
Definition basic.h:37

Definition at line 60 of file interactive.c.

Referenced by ServiceStartInteractive(), and wmain().

◆ rdns_semaphore

HANDLE rdns_semaphore = NULL
static

Definition at line 55 of file interactive.c.

Referenced by RegisterDNS(), and ServiceStartInteractive().

◆ service

SERVICE_STATUS_HANDLE service
static

◆ settings

settings_t settings
static

◆ status

SERVICE_STATUS status = { .dwServiceType = SERVICE_WIN32_SHARE_PROCESS }
static

Definition at line 52 of file interactive.c.

Referenced by add_route(), add_route_ipapi(), add_route_ipv6(), ApplyDnsSettings(), bio_write_post(), check_for_client_reason(), check_status(), close_tun(), CmdRemoveServices(), dco_get_supported_ciphers(), del_route_ipapi(), delete_route(), delete_temp_addresses(), dhcp_release_by_adapter_index(), dhcp_renew_by_adapter_index(), do_open_tun(), do_preresolve(), do_preresolve_host(), do_route_ipv6_service(), establish_http_proxy_passthru(), exec_command(), fork_to_self(), get_adapter_info_list(), get_best_route(), get_console_input_win32(), get_default_gateway(), get_default_gateway_ipv6(), get_device_instance_id_interface(), get_interface_info_list(), get_openvpn_reg_value(), get_pa_var(), get_panel_reg(), get_per_adapter_info(), get_special_addr(), get_tap_reg(), get_windows_routing_table(), getaddr(), GetOpenvpnSettings(), GetRegString(), helper_client_server(), in_extra_dispatch(), in_src_get(), incoming_push_message(), init_route(), InterfaceLuid(), io_wait_dowork(), link_socket_write_win32(), man_block(), man_client_deny(), man_client_kill(), man_connect(), man_kill(), man_proxy(), man_remote(), man_send_cc_message(), man_settings_init(), man_standalone_event_loop(), management_callback_remote_entry_get(), management_callback_send_cc_message(), management_io(), multi_get_create_instance_udp(), multi_io_wait(), multi_process_io_udp(), net_event_win32_reset_write(), openvpn_connect(), openvpn_exit(), openvpn_getaddrinfo(), openvpn_gettimeofday(), openvpn_plugin_func_v1(), openvpn_plugin_open_v3(), openvpn_popen(), openvpn_waitpid_check(), pam_auth(), plugin_call_item(), plugin_call_ssl(), print_sockaddr_ex(), process_io(), read_incoming_link(), read_incoming_tls_ciphertext(), read_incoming_tls_plaintext(), recv_line(), recv_socks_reply(), report_command_status(), ReportStatusToSCMgr(), resolve_bind_local(), resolve_remote(), semaphore_lock(), send_push_options(), send_push_reply(), ServiceCtrlInteractive(), ServiceStartInteractive(), ServiceStartInteractiveOwn(), set_win_sys_path_via_env(), socket_connect(), socket_connection_reset(), socket_listen_accept(), socket_recv_queue(), socket_send_queue(), sockethandle_finalize(), socks_handshake(), socks_username_password_auth(), strerror_win32(), tap_allow_nonadmin_access_handle(), test_adapter_ip_netmask(), tls_pre_decrypt_lite(), tls_process_state(), tun_read_queue(), tun_write_queue(), tun_write_win32(), tunnel_server_loop(), tuntap_abort(), tuntap_is_dco_win_timeout(), tuntap_set_connected(), tuntap_set_ip_addr(), tuntap_set_ptp(), tuntap_stop(), we_wait(), win32_sleep(), win_get_exe_path(), win_wfp_block(), write_outgoing_tls_ciphertext(), and x_check_status().